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

Difficulty using font variants in CSS

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P4 P4
    • tbd
    • 8
    • javafx
    • Mac OS X 10.9.1
      java 8b129

      I'm having difficulty using font variants in my CSS file and having it reflected in Scene Builder.

      In my example, I'm using the 'Source Sans Pro' font. If I create a label and assign it a CSS style:

      .normal-label-bold {
          -fx-font-family: 'Source Sans Pro';
          -fx-font-size: 1.1em;
      }

      it works OK. If I try to use a 'Light' variant of the font:

      .normal-label {
          -fx-font-family: 'Source Sans Pro Light';
          -fx-font-size: 1.1em;
      }

      this doesn't work. It shows the default System font.

      However, if I give the Label two styles: normal-label AND normal-label-bold, then the Light font shows correctly. I've also been able to get it to show correctly by fooling around with the Font and Style Class properties but I can't reproduce it reliably.

            Unassigned Unassigned
            cstanford Curtis Stanford
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: