Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 5.3

Table of Contents

JavaFX and Fonts

JavaFX will usually require no additional setup of fonts. However, some configurations or use cases require additional setup of fonts.

...

For Linux, MacOSx and Windows, JavaFX defaults to a native rasterizer library. It is still possible to fallback if needed to the previous rasterier with -Dprism.text=t2k

On Linux, the font config tools can be used to discover which fonts are present, for example fc-list and fc-match. To determine the "system" font that JavaFX will use for a logical font:

    $ fc-match sans.regular 

Note: for embedded environments, the use of native rasterization by default will happen after 8u26.

...

You can include a custom font in a JavaFX application JAR bundle. Refer to How to Embed Fonts. You can also load a web font by passing the URL to using the loadFont() method. Refer to the Font class in the JavaFX API Documentation.

Big Fonts

Fonts can be rendered by either using a cached raster (bitmap) or with a path. Generally fonts look better when rendered from a raster includes hinting and other tricks to make it look its best. JavaFX caches rasterized characters up to a size limit, and then uses paths for rendering after than. Adjusting this limit might improve performance for some types of applications that a limited set of very large characters, though at an impact to the texture cache. To change the default value of 80 pixels, use

    -Dprism.fontSizeLimit=xx

Embedded Device Fonts

On Linux, JavaFX will use fontconfig to find fonts. Fontconfig provides for a powerful means of identifying and finding installed fonts. It is usually associated with X11, but does not require it.

...