How to get Swing-look font rendering in JavaFX?

These are the screens of the same text in JavaFX (smoothing lcd and gray font) and Swing (by default) in Windows 7 (Java JDK 8u45):

Both JavaFX and Swing fonts are the same (family: Segoe user interface, style: plain, size: 12).

JavaFX 8 (lcd)enter image description here JavaFX 8 (lcd)

JavaFX 8 (gray)enter image description here JavaFX 8 (gray)

Swingenter image description here Swing

The differences are small but noticeable.

Note. I do not want to include Swing components in JavaFX.

+4
source share
1 answer

tl; dr : It is not possible to get a Swing font that displays it using any combination of the available JavaFX font handles. It seems your only option is to dig into JavaFX sources, fix it and / or put it on the JavaFX mailing list.


Linux , , . Swing [1] [2]:

Windows, , , Swing, : https://i.imgur.com/I7wLuYJ.png

:

(?) , FX ( Windows) - , .

, . , , , .


Fedora 23 freetype-freeworld rpmfusion:

Xft.autohint:   0
Xft.antialias:  1
Xft.hinting:    1
Xft.hintstyle:  hintfull
Xft.rgba:   rgb
Xft.lcdfilter:  lcddefault
+4

All Articles