[XeTeX] Fwd: Re: [NTG-context] XeTeX fonts
Jonathan Kew
jonathan_kew at sil.org
Sat Oct 30 18:18:26 CEST 2004
On 30 Oct 2004, at 1:51 pm, Ross Moore wrote:
> Hi Jonathan, Hans, and others
>
> On 29/10/2004, at 9:37 PM, Jonathan Kew wrote:
>
>> On 26 Oct 2004, at 2:59 pm, Adam Lindsay wrote:
>>
>>> Adam Lindsay wrote:
>>>
>>>>> ^^@:35: Extra tokens will be flushed.
>>>>> <to be read again>
>>>>> Hoefler
>>>>> l.35 defaultfont:=""Hoefler
>>>>> Text: Ligatures=Diphthongs"";
>>>
>>> hm, the "'s interfere here
>
> I've not checked, but this looks like ConTeXt has encountered
> the same problem with the \fontname primitive that we did,
It's not really the same situation as we had in LaTeX font specs; it
looks to me like ConTeXt is generating MF (or MP) code where it wants
to provide the font name as a string, and so it *always* puts quotes
around it. And it doesn't attempt to scan the name for already-existing
quotes as one wouldn't normally expect them in a simple filename
(although I suppose it's possible, at least on some platforms).
[snip]
>>> (Hoefler Text: Ligatures=Diphthongs) at 10pt
>
> Yes; and ConTeXt can safely put "..."s around this.
>
> Though one must ask why ConTeXt is doing this.
To make a MetaPost string.
> Surely it should scan for quotes in the name, and act accordingly.
It's so long since I wrote any MF code that I don't remember offhand:
is there a way to escape a quote within a string? Double it?
[snip]
>> I'll add (....) as another "quoting" option for file and font names,
>> if that's convenient; however, remember that in principle any of
>> these characters could occur within a font/feature name, which is why
>> I provided more than one option.
>
> Fine, but how will a user control what is returned ?
> By a command-line option ?
I suppose something like \XeTeXpreferredfontnamequote, settable to `\",
`\', or `\(. But remember that there might be occurrences of these in
the name, so we need either the freedom to pick a quoting option that
doesn't clash with what's actually in the name, or an escaping
mechanism to allow the quoting character to also be embedded.
Currently, \fontname in XeTeX will return a name with "...." unless
there's a double quote in the name, in which case it will return
'....'. (You can't have a font name containing both " and ' because you
wouldn't have been able to load it in the first place!)
(It will return a plain unquoted name for legacy .tfm-based fonts, just
like standard TeX.)
> This will complicate the coding of packages, which otherwise
> might naively build routines that scan for "..." to separate the
> real font name from its size/scaling information.
This is already unreliable, see above. True, a font name that includes
", causing XeTeX to generate the form '....', is unlikely; but it's not
impossible, and once you consider features as well as the basic font
name, it becomes more plausible.
If I were to implement \XeTeXpreferredfontnamequote (any better
suggestions for a name?), ConTeXt could set this to `\( when it wants
to get a font name that it's going to turn into a Metafont string. This
should work unless you have a font name that includes parentheses, in
which case XeTeX would have to switch to a different quoting character
for that name.
Incidentally, do we know if the problem name in the original error
message really comes from an instance of \fontname in ConTeXt? Or is it
a name that was directly provided by the user in TeX source, in which
case simply using '...' instead of "..." there would probably fix it,
for this case; ConTeXt would then generate MF source such as:
defaultfont:="'Hoefler Text: Ligatures=Diphthongs'";
which (I assume) would be perfectly valid.
JK
More information about the XeTeX
mailing list