maxwell at umiacs.umd.edu wrote: > Last year, we were creating documents that contained both Bengali and > English text (both in Unicode), and I was able to work through (with your > help!) how to tell Java (and thereby XXE) to use a particular Bengali > font. This involved editing the fontconfig.properties file in the latest > Java library. > > This year we're creating documents with Urdu and English. Urdu is written > with an Arabic script, and in fact with the Nasta'liq variant of that > font. I'm trying to get XXE to use a particular Arabic font (the 'Nafees > Nastaleeq' font) using the same approach I used for Bengali, and it isn't > working. > > Specifically, I've added the following lines to my fontconfig.properties > file (in each case putting the new lines at the top of the section; where > lines wrap in my email, I'm continuing them after a line-final '\'): > ----------- > allfonts.arabic=Nastaleeq > ... > sequence.allfonts=alphabetic/default,arabic,bengali,ipa,dingbats,symbol > ... > sequence.allfonts.UTF-8.hi=alphabetic/1252,arabic,devanagari,bengali,ipa,\ > dingbats,symbol > ... > exclusion.alphabetic=0600-1e9f,1f00-20ab,20ad-f8ff > #The above line was originally 0700-1e9f etc.; the Arabic Unicode > # range is 0600-06FF > exclusion.arabic=0600-06ff > #Not clear if this line is necessary (or hurts??) > ... > filename.Nastaleeq=Nafees_Nastaleeq_v1.01.ttf > ----------- > The above does not work. As far as I can tell, the Arabic/Urdu characters > continue to be rendered with the Arial Unicode font, which is my default > Sans Serif font. > > BTW, the actual filename is 'Nafees Nastaleeq v1.01.ttf'; I've replaced > the space chars with '_' following the directions at > http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html. At least > I think I'm following the directions--I'm assuming that when they say > 'Space characters in the platform font name must be replaced with > underscore characters ("_").', they mean in the fontconfig.properties > file, not in the actual filename in the directory. But just in case, I've > tried replacing this filename with other fonts which contain characters in > the Arabic Unicode range, with no discernible affect. > > The only thing I can think of that's different between the Arabic case and > the Bengali one, is that the default font did not provide any Bengali > characters at all--I just got square boxes in place of any Bengali chars; > so before, I was providing a font to fill in missing code points. Whereas > the default font does provide Arabic characters, and I'm trying to > *override* those default characters for the the Arabic code points. > > I have verified that XXE can display using the Nastaleeq font, by > selecting it in the Options | Preferences dlg as my default serif (or sans > serif) font. The only trouble with that as a work-around is, this font > has no Latin characters, so all my English text disappears... > > Has anyone succeeded in overriding the default Arabic font (or any other > default scripts that are already specified in the fontconfig.properties > file, such as Chinese, Thai, Devanagari, Hebrew, Japanese, or Korean)?
I've not succeeded in overriding the default Arabic font, but I'm 100% sure that it really works as described in http://java.sun.com/j2se/1.5.0/docs/guide/intl/fontconfig.html You probably did a little mistake. For example, I would say that you need to specify: filename.Nastaleeq=Nafees Nastaleeq v1.01.ttf (no '_') if the name of the font is actually "Nastaleeq" (as displayed by XXE's Options | Preferences dlg). If the name of the font is 'Nafees Nastaleeq' (as displayed by XXE's Options | Preferences dlg), you must specify: filename.Nafees_Nastaleeq=Nafees Nastaleeq v1.01.ttf Well, that's my understanding of the '_' issue! > BTW, there was some discussion in this mailing list over the years about > errors in cursor placement inside Arabic text. In experimenting with > that, it appears to me that the problem is that Arabic is displayed > right-to-left, and the cursor knows that, but the algorithm for inserting > text doesn't. That is, if I position the cursor five characters from the > left-hand end of a string of Arabic text and start typing space chars, the > spaces go in five characters from the right-hand end; and vice versa. > This might be easy to fix... No, not at all. That's why we have given up the idea of supporting bidirectional writing.

