[XeTeX] fontconfig and the same name fonts
Jonathan Kew
jonathan_kew at sil.org
Sun Apr 29 10:52:32 CEST 2007
On 29 Apr 2007, at 6:16 am, Nikola Lecic wrote:
> On Sun, 29 Apr 2007 12:10:54 +0930
> Will Robertson <wspr81 at gmail.com> wrote:
>
>> On 29/04/2007, at 11:50 , Nikola Lecic wrote:
>>
>>> Is there any recommended method in situation when we have OTF and
>>> TTF font with the same name and need to have both installed?
My current recommendation would be "don't do this"! :)
>>> (GFS
>>> fonts are a good example: download any pair from http://
>>> www.greekfontsociety.org.) In such cases, fc-list lists only one
>>> name, despite inspecting and registering both files. How can we be
>>> sure what font file XeTeX actually uses and what fonts.conf or
>>> XeTeX directives can make such a situation clear?
How can you be sure which font file *any* application uses in such a
case? If the OTF and TTF versions are exactly equivalent in
repertoire, behavior, metrics, etc., then it shouldn't matter which
is used (and so why bother installing both?); and if they're not
equivalent, then you need a way to control which is used in all cases
(not just for XeTeX). It seems to me that if they aren't
interchangeable, they shouldn't have the same name.
>>
>> It sounds like a funny idea to need to do this in the first place;
>> if you need both at once, presumably it's to test them against each
>> other. In which case, you could just load them without installing
>> them system-wide with
>> \font\x="[GFS Bodoni.ttf]" at 12pt% (without fontspec)
>> or
>> \newfontfamily\x[ExternalLocation]{GFS Dodoni.ttf}% (with
>> fontspec)
>
> Yes, I realised I wasn't clear enough :) Comparing fonts against
> each other isn't primary goal. I need OTF version for XeTeX and TTF
> version for OpenOffice, for example.
Just curious... what's wrong with using the TTF version in XeTeX as
well?
> So, besides a possibility to call all OTF fonts (if used in XeTeX
> only) by means of ExternalLocation, can fontspec/XeTeX return a
> real file name of font found in the system through fontconfig?
Not at the moment. (In the general case, this might be a hard
problem; under some operating systems, at least, fonts need not
actually exist on disk with a "real file name"; they could be coming
from some other source.)
In any case, I see relatively little benefit in returning the file
name unless there is also some way for you to choose among the
multiple fonts with the same name.
What might be possible is to provide a way to express a preference
for one font format or another; e.g, \XeTeXpreferredfontformat "OTF".
Or maybe there is already a way to do this globally for fontconfig
via settings in fonts.conf; it'd be worth checking the FC
documentation for this.
JK
More information about the XeTeX
mailing list