Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8117255

Changing font size messes with font family

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P4
    • Resolution: Duplicate
    • Affects Version/s: 8
    • Fix Version/s: 8
    • Component/s: javafx
    • Labels:
    • Environment:

      Description

      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.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                dgrieve David Grieve
                Reporter:
                duke J. Duke (Inactive)
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Imported: