[Fontconfig] Font matching questions in Fontconfig, Portable

mathog mathog at caltech.edu
Mon Oct 1 11:20:30 PDT 2012


PowerPoint on Windows XP lists fonts:  Times, Times New Roman, Arial, 
and Helvetica.  While Arial and Helvetica are identical
(which can easily be seen by taking some text in both fonts, coloring 
them differently, and overlapping them),
Times and Times New Roman are not.  They are very close, but not 
exactly the same.

Now the goal is to get text in these (and other fonts) into Inkscape 
through EMF files, and vice versa.
Inkscape on both XP and Linux lists these fonts:   Arial, Times New 
Roman.  There is no Times, Helvetica, or
Vera(*) listed in its pull down font list.  Text imported as Times maps 
to Sans and is very much screwed up in
its spacing, whereas if that text is given font "Times New Roman" the 
spacing is very close to what it should be.

The total description of the font in the EMF file just its name, 
"Times" or whatever.

How does one use fontconfig to straighten this mess out in a portable 
manner?

When fontconfig looks up fonts by name on Windows XP (under cygwin) it
comes back with, respectively (TrueType font unless otherwise 
indicated):

Arial            C:/WINDOWS/fonts/arial.ttf     (style Normal)
Helvetica        C:/WINDOWS/fonts/VeraSe.ttf    (style Roman)
Times            C:/WINDOWS/fonts/Vera.ttf      (style Roman)
Times New Roman  C:/WINDOWS/fonts/times.ttf     (style Normal)

and on Linux

Arial            /usr/share/fonts/truetype/msttcorefonts/Arial.ttf 
(style Normal)
Helvetica        /usr/share/fonts/X11/Type1/n019003l.pfb           
(style Regular, Type 1 font)
Times            /usr/share/fonts/X11/Type1/n021003l.pfb           
(style Regular, Type 1 font)
Times New Roman  
/usr/share/fonts/truetype/msttcorefonts/Times_New_Roman.ttf (style 
Normal)

Working outside of FontConfig one could have a lookup table that 
converts Times->Times New Roman,
Helvetica -> Arial, but it isn't clear to me that that is portable, 
some machine might have a real Helvetica
and no Arial, for instance.  Is there some way to get  FontConfig to 
"do the right thing" instead?

Thank you,

David Mathog
mathog at caltech.edu
Manager, Sequence Analysis Facility, Biology Division, Caltech


More information about the Fontconfig mailing list