Need to find out list of Chinese fonts installed on OS

Hi,

I have tried the following code:

String [] fontNames = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames(new Locale("CN","zh"));

for(int i=0; i<fontNames.length; i++){

System.out.println(""+fontNames[i]);

}

And I have set language in Regional and Language options to Chinese(PRC).

But it's giving me list of all fonts installed on my OS.

Can anybody help me in this?

Regards,

Kalyani.>

[727 byte] By [kalyani_bhadekara] at [2007-11-27 8:49:10]
# 1

There is no mystery as to why your code does not work: a font has nothing to do with the locale you happen to run in. You don't want to be restricted to reading or writing Chinese, even though you are running in a Chinese locale, right?

You should be querying according to scripts, not locales. I don't know how to do it, and I see several obstacles to getting what you want (what about Unicode fonts, for instance).

one_danea at 2007-7-12 20:57:53 > top of Java-index,Desktop,I18N...