tags:

views:

271

answers:

0

I have been playing with the fontconfig.properties file for a java 1.6 application. I wrote a simple program to create a window with some text written in a text area.

Here is the testing code.

 JFrame myFrame = new JFrame();
 myFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
 myFrame.setSize(200, 200);
 Container contentPane = myFrame.getContentPane();
 JTextArea textArea = new JTextArea();
 textArea.setText("Test String in " + textArea.getFont().getName() + " font and " 
     + textArea.getFont().getStyle() +" style");
 contentPane.add(textArea);
 myFrame.setVisible(true);

The default font for the JTextArea is the dialog logical font which by default maps to Arial with the following fontconfig.properties entries

# Component Font Mappings
dialog.plain.alphabetic=Arial
# Font File Names
filename.Arial=ARIAL.TTF

I am able to change the default font by changing the Font mapping like the following

# Component Font Mappings
#dialog.plain.alphabetic=Arial 
dialog.plain.alphabetic=Broadway
# Font File Names
filename.Arial=ARIAL.TTF
filename.Broadway=BROADW.TTF

But the following change seems to have no effect.

# Component Font Mappings
dialog.plain.alphabetic=Arial
# Font File Names
filename.Arial=BROADW.TTF

Can anyone tell me why changing the mapping to the physical font file has no effect?