Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Shouldn't they look exactly the same? Or does Java not have its own fonts? Does it just map font names to OS fonts?

share|improve this question
Java does not have its own fonts AFAIK. It uses set of fonts from OS. Like you said, its taking from OS if nothing is specified. – vpram86 Feb 23 '10 at 9:16
Could you post screenshots to show the difference? That way everyone knows what we're talking about :-) – Ivo Flipse Feb 23 '10 at 10:37
couldn't figure out how to post directly with superuser, so here's a link: top left "EUR/USD" is MAC, other 2 are XP to show the difference... notice the 7s and 8s look different. Plus the characters kinda feel a bit wider in OS X screenshot. And the "EUR/USD" looks wider or bolder than the XP GBP/JPY text. – Mikey Feb 23 '10 at 12:24
up vote 6 down vote accepted

Java normally uses system fonts, just like other programs. According to the spec: "All implementations of the Java 2 platform must support TrueType fonts; support for other font technologies is implementation dependent." (Javadocs of java.awt.font).

There's one twist: Since a Java program cannot know in advance what fonts will be available on the target platform, there are "logical font names" ("serif", "monospaced" etc.). These are always available in Java; the Java runtime will map these pseudo-fontnames to an approriate font on the system.

This mapping is configurable. See

I suspect that the Java app in question uses these logical font names, which are simply mapped to different fonts on Windows and on Mac OS.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.