[XeTeX] Finding out if a font supports a particular Unicode character and using it

R (Chandra) Chandrasekhar chyavana at gmail.com
Sat Jan 30 11:15:02 CET 2010


Thank you, Peter, for giving us a tool to answer this question 
comprehensively.

Peter Baker wrote:
> Peter Baker wrote:
>> Let me check. I'm running Python 2.6.4; maybe I'm using something that 
>> appeared after 2.5. I'll check it out and rewrite it to run on 2.5 if 
>> I can.
>>
> I actually had a Python 2.5.x around to test on, and it definitely was a 
> matter of a feature that appeared between 2.5 and 2.6. I've removed 
> that, and it should work now. Fr. Michael points out that the script 
> doesn't run on Python 3.1: Python 3 retires the print statement! Thanks, 
> Chris and Fr. Michael: I think it might just work in both versions now.

I am on Kubuntu 9.10 with python 2.6.4 and python3. Here is what I did 
in order to run the script:

1. Install the packages

fontforge and python-fontforge

from the Ubuntu repositories.

2. Unzip and execute the script fontswith with an argumen (U+2605 in my 
case).

It worked flawlessly in python 2.6.4, but complained that there was no 
fontforge module in python3, which I think is because the package 
python-fontforge only caters to the current python 2.6.4. Being a 
newcomer to python, I do not know enough to make it work with python3 
(which is an academic issue for me at present anyway).

> I've also removed a dependency on a very recent feature in FontForge.
> 
> New file attached; also as before on 
> http://faculty.virginia.edu/OldEnglish/fontswith/fontswith.zip
> 
> Here's one more point. You can run it as a script in FontForge:
> 
> fontforge -script fontswith ~/myfonts adieresis

I have tried this route and got the same results as with running the 
script on its own.

> I hope it's useful to someone!

Most certainly! I think it will fill a very widespread need and merits 
being made available to a larger audience. I have now found all the 
fonts on my system with U+2605 in a few seconds :-)

> Peter

Thank you once more.

Chandra


More information about the XeTeX mailing list