Document how to embed fonts in FX apps

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: P3
    • fx2.0
    • Affects Version/s: fx1.2
    • Component/s: javafx

      You embed the font along with your application. You load the font by name. Simply place the ttf font file in a package in your application. Then you need to include a fonts.mf file in the META-INF of the jar so that we can discover the embedded fonts at runtime. The fonts.mf file is simply a properties file that lists the name of the font and the location of the font.

      fonts.mf:

      Arindam\ Neo\ Bold = /com/mycompany/fonts/arind.ttf

      for example. Then in code you just load a font by name, using the name that you entered into your fonts.mf:

      Font {
        name: "Arindam Neo Bold"
        size: 27
      }

            Assignee:
            Philip Race
            Reporter:
            Richard Bair (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported: