FULL PRODUCT VERSION :
java version "1.7.0-ea"
Java(TM) SE Runtime Environment (build 1.7.0-ea-b11)
Java HotSpot(TM) Server VM (build 1.7.0-ea-b11, mixed mode)
EXTRA RELEVANT SYSTEM CONFIGURATION :
Linux helium 2.6.20-15-generic #2 SMP Sun Apr 15 07:36:31 UTC 2007 i686 GNU/Linux
A DESCRIPTION OF THE PROBLEM :
On Solaris, if i want a composite font with "Lucida Sans Typewriter", i can just choose "Monospaced". on Windows, i'm screwed.
if i want a composite *proportional* font, i can use StyleContext.getDefaultStyleContext().getFont() instead of "new Font", but sun.font.FontManager hard-codes "Dialog" as the source of the other slots' fonts.
a step forward would be to factor sun.font.FontManager.getCompositeFontUIResource so there's a version where "dialog" is passed as a parameter, so the truly desperate could at least use reflection to create their own CompositeFont.
but something like Font.setFallbackLogicalFont(String), so i could say something like:
Font f = new Font("Lucida Sans Typewriter", Font.PLAIN, 10);
and have f be like Solaris' "Monospaced" everywhere, even Windows, would be sweet.
This bug can be reproduced always.
CUSTOMER SUBMITTED WORKAROUND :
i haven't found a workaround, and not for want of trying. FontManager.replaceFont and CompositeFont.replaceComponentFont seem to lead to pain and misery. FontManager.getCompositeFontUIResource, as i say, is only usable if i'm dealing with a proportional physical font.
Alternatively, you could use Mac OS. i'm not sure what layer does it, but there all physical fonts seem to get appropriate fallbacks. that rocks. if you could tell the difference between monospaced and proportional fonts (i raised a bug requesting such a Java API years ago), you could automatically add fallbacks to any physical font.