I have listed all available fonts in system by calling
GraphicsEnvironment graphicsEnvironment = GraphicsEnvironment.getLocalGraphicsEnvironment();
Font[] fontNames = graphicsEnvironment.getAllFonts();
for (Font s : fontNames) {
System.out.println(s);
}
On console I can see many fonts but the list looks very uncomplete. For example: My OS has installed the "System" font but in output I can't see that font:
...
java.awt.Font[family=Sylfaen,name=Sylfaen,style=plain,size=1]
java.awt.Font[family=Symbol,name=Symbol,style=plain,size=1]
java.awt.Font[family=Tahoma,name=Tahoma,style=plain,size=1]
...
Installed fonts (sorry for polish OS):
Why is that?
Another thing is that in WordPad I can see "System" font. However in MS Word 2010 "System" font is not available.
The problem is not with this particular "System" font. There are several fonts installed but missing in Java.
EDIT: Why am I asking? My application use BIRT Report Designer to generate .rpt files with reports templates. Next I use these files to render Swing components like JLabel, JTextField etc. Main problem is: User can generate report with fields that use font that Java Swing can't handle.
The part of sample xml file generated by BIRT:
<property name="fieldName">Blablabla{Label}</property>
<property name="fontFamily">"System"</property>
<property name="fontSize">16pt</property>
Our customer requirment specifies that font can't differ between generated report and Java swing components.
What I want to do is either handle all system fonts in Java or exclude in BIRT fonts which java can't handle.
graphicsEnvironment.getAvailableFontFamilyNames()
return a complete list? – Rustic.
so that search should pick up everything with both font & Java! Point to some pages that actually include the string.fon
along with Java. – KarinakarineSystem
font is calledSystem Pogrubiona
according to that information. 2) On the other hand I have aSystem Bold
font here that is visible in Windows but not Java. – Karinakarine