-
Bug
-
Resolution: Duplicate
-
P4
-
8
main.css:
.root {
/* Fonts */
-fx-font-family: serif;
-fx-font-size: 15pt;
}
=> Font family is serif
But when I change the font-size of my text, the font family is overriden/returns to the system default (a non-serifed font).
http://imageshack.us/scaled/thumb/818/4gi5.png => the Text in the middle should still be serifed, only smaller.
FontTest.scala:
package fonttest
import scala.collection.JavaConverters._
import scalafx.Includes._
import scalafx.application.JFXApp
import scalafx.scene.Scene
import scalafx.stage.Stage
import scalafx.scene.layout.VBox
import scalafx.scene.text.Text
object FontTest extends JFXApp {
stage = new JFXApp.PrimaryStage {
width = 600
height = 450
scene = new Scene {
stylesheets = Set("main.css")
content = Set(new VBox {
content = Set(
new Text("Font"),
new Text("Font") {
style = "-fx-font-size: 11px;" // <= should be smaller, but still serifed like others
},
new Text("Font")
)
}
)
}
}
}
https://docs.google.com/file/d/0B7lrDAvzeFVySmZ5Q2VxQlVEUE0/edit?usp=sharing => for the minimal source code + gradle build.
.root {
/* Fonts */
-fx-font-family: serif;
-fx-font-size: 15pt;
}
=> Font family is serif
But when I change the font-size of my text, the font family is overriden/returns to the system default (a non-serifed font).
http://imageshack.us/scaled/thumb/818/4gi5.png => the Text in the middle should still be serifed, only smaller.
FontTest.scala:
package fonttest
import scala.collection.JavaConverters._
import scalafx.Includes._
import scalafx.application.JFXApp
import scalafx.scene.Scene
import scalafx.stage.Stage
import scalafx.scene.layout.VBox
import scalafx.scene.text.Text
object FontTest extends JFXApp {
stage = new JFXApp.PrimaryStage {
width = 600
height = 450
scene = new Scene {
stylesheets = Set("main.css")
content = Set(new VBox {
content = Set(
new Text("Font"),
new Text("Font") {
style = "-fx-font-size: 11px;" // <= should be smaller, but still serifed like others
},
new Text("Font")
)
}
)
}
}
}
https://docs.google.com/file/d/0B7lrDAvzeFVySmZ5Q2VxQlVEUE0/edit?usp=sharing => for the minimal source code + gradle build.
- relates to
-
JDK-8124740 CSS: style "-fx-font" of parent node replaces style "-fx-font-family" of children node
-
- Closed
-