MCMastery
MCMastery

Reputation: 3249

Java font compatibility

Are logical fonts in Java (Dialog, DialogInput, Monospaced, etc.) compatible with Windows and Macintosh computers? If not, are there any fonts common with both Windows and Macintosh computers?

Upvotes: 2

Views: 1423

Answers (1)

ring bearer
ring bearer

Reputation: 20783

Logical fonts are the five font families defined by the Java platform which must be supported by any Java runtime environment: Serif, SansSerif, Monospaced, Dialog, and DialogInput.

These logical fonts are not actual font libraries. Instead, the logical font names are mapped to physical fonts by the Java runtime environment. It also depends on the Locale. It is assumed that all the OSs support a different set of fonts, Swing implementors decided to ensure at least these five fonts were supported everywhere.

They will be automatically mapped onto the most suitable font available at a given platform. Have a look at jre/lib/fontconfig.properties.src for details. Will there be common Fonts ? we can not be very sure as the platform specific fonts keep changing on OS revisions ( ex: windows 7/8 and OS X yosemite, Ubuntu etc). As a fall back some fonts are provided with the JRE - take a look at the folder under jre/lib/fonts.

Finally have a look at https://docs.oracle.com/javase/8/docs/technotes/guides/intl/fontconfig.html further details on this.

Upvotes: 3

Related Questions