fontconfig

M

maxwell

I'm using a Java-based application (XMLmind) on MsWindows XP SP2,
which is relevant, because the support for rendering Bengali Unicode
was fixed in SP2. However, I'm unable to get the fix to be used by
this Java app.

Specifically, I want the app to use a particular font, the Vrinda.ttf
font, for Unicode Bengali (but not for other regions of Unicode).
Can't seem to make it work.

I've been advised to edit the fontconfig file, using the instructions
at http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html.
The instructions seem (to me) a bit unclear; apparently Java looks for
a file with a name like 'fontconfig.properties' (there are no
fontconfig.XP.properties files, etc. on my PC). I don't have such a
file, only the compiled version, but I also have the source for that
compiled version, namely fontconfig.properties.src. If I'm
understanding the instructions correctly, you just copy that
fontconfig.properties.src file to fontconfig.properties, and edit the
latter; I guess Java then reads the fontconfig.properties file at
startup rather than the fontconfig.properties.bfc file, which
presumably means starting takes fractionally longer. If on the other
hand I need to compile my modified fontconfig.properties file, that
probably explains my lack of results--but I don't know how to compile
it.

I'm also not certain what I have to do to make Java re-load the
fontconfig.properties file. I'm assuming that if I shut down XMLmind,
and re-start it, that Java also shuts down and re-starts, and in re-
starting it reads in the modified fontconfig.properties file.
(Actually, I just checked that with the Windows Task Manager, and
indeed Java is shutting down when I close XMLmind. Whether Java is
reading in my munged fontconfig.properties file, I can't tell.)

Assuming I've guessed right thus far, I made the following changes to
the fontconfig.properties file, following the existing code for
Devanagari:

--Added a line at the top of the 'Component Font Mappings':
allfonts.bengali=Vrinda
--Modifed the UTF-8 Search Sequence line to include Bengali:
sequence.allfonts.UTF-8.hi=alphabetic/
1252,devanagari,bengali,dingbats,symbol
--Added a line at the top of the 'Font File Names':
filename.Vrinda=VRINDA.TTF
(The vrinda.ttf file is indeed in my Windows/fonts directory.)

This has no effect; XMLmind is still not using the Vrinda font to
render UTF-8 Bengali text.

A couple things occur to me. How does Java know what to do with the
string 'bengali'? Does it in fact know that this refers to the
Unicode range U+0980 to U+09FF? Does Java actually read the
fontconfig.properties file, i.e. is fontconfig.properties.src the
correct format, or do I need to compile this file? If so, how? Or is
it perhaps the case that XMLmind overrides what Java thinks it's
supposed to do for rendering Bengali text? (The XMLmind people are
the ones who told me to mung the fontconfig.properties file, so I
don't think this is the case; but how could I test it, i.e. how can I
get raw Java to render some Bengali text for me?)

Suggestions?

Mike Maxwell
CASL/ U MD
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,020
Latest member
GenesisGai

Latest Threads

Top