- Loading...
| Table of Contents |
|---|
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.
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=xxOn 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.
...