[texhax] xetex: using fonts with missing glyphs
Reinhard Kotucha
reinhard.kotucha at web.de
Tue Nov 30 01:44:07 CET 2010
On 29 November 2010 Uwe Lueck wrote:
> "Susan Dittmar" <Susan.Dittmar at gmx.de>, 26.11.2010 13:57:11:
> > I just did my first steps with xelatex and immediately ran into a
> > problem. I would like to use a font which has only a very sparse
> > set of glyphs. Even comma and fullstop are missing.
> >
> > Is there an easy way to tell xelatex which font to use as
> > fallback for missing glyphs? (This is for glyphs that are missing
> > completely, like the comma.)
> >
> > Is there an easy way to tell xelatex on a case-by-case basis
> > which glyph (or combination of glyphs) to use for a special
> > missing glyph? (This is for glyphs that can be replaced by
> > existing glyphs.)
>
> I even never have tried xelatex at all and may be the wrong one to
> answer.
>
> Just curious: How can this happen? What are you doing?
> Does this mean you see a glyph in the editor but it is omitted
> in the .pdf?
There are plenty of fonts in the public domain which are incomplete.
Most of them were designed for company logos and the like. There are
many fonts which provide uppercase letters only. Most of these fonts
are lacking numbers and punctuation marks.
These fonts are quite useless in general, except if you use them for
what they are designed for. Some of them can be used for headlines,
for instance.
> If you have a font to which you want to "fall back," why don't
> you just use that other font?
Maybe because it looks different. ;)
> For combining fonts, there have been virtual fonts, but I still must
> learn this myself, and I wonder whether it really still works with
> XeTeX.
I suppose that XeTeX supports virtual fonts because it's an extension
of Knuth's TeX. Creating a virtual font requires at least that you
are halfways familiar with fontinst. I'm wondering whether it's
really worth the effort in this case.
> If an extra glyph is rare, it should be possible to call it by a
> macro that simply internally and locally switches to the font
> containing the glyph.
Sure. It's a bit inconvenient but much more robust than active
characters.
> Another solution could be with active characters in the good
> old way, but with unicode the active character is rather something
> like an active byte working like a macro with parameters
> (I guess ...)
You already said in another mail, that an active comma can cause
trouble when used in comma-separated lists. I can imagine that an
active decimal point can cause trouble too. Active characters are
always a potential cause of trouble and should be handled with care,
or better be avoided if possible. I remember the trouble I had with
german.sty and px/tx fonts. german.sty makes `\" active and the font
packages used hexadecimal numbers in TeX's "xy notation (babel is much
smarter in this respect).
I can imagine another solution, which is absolutely bomb-proof in
respect of TeX's macro processing: If only the comma and the period
are missing, why not add them to the font? The solution I have in
mind is FontForge.
Creation of new glyphs requires a lot of experience and is better done
by experienced font designers. A period, however, is either a circle
or a square, and it shouldn't take more than 5 minutes to create one.
You don't have to be a font designer in order to draw a circle or a
square. The comma might be more difficult. It's probably difficult
to draw a Computer Modern like comma (a circle with a tail) but maybe
it's sufficient to approximate it by a polygon.
I can't claim that I've any experience with FontForge, I just used it
recently in order to modify some glyphs. But when I saved the
modified font (a .pfb file), I was quite surprised that FontForge
automatically created all the files necessary in order to use the font
with TeX immediately.
I think that creating a virtual font is too much work and not worth
the effort. It's probably a reasonable solution for people who are
familiar with fontinst already. Active characters are problematic and
macros are inconvenient. Maybe FontForge is the most straightforward
approach. It's bullet-proof, at least.
Regards,
Reinhard
--
----------------------------------------------------------------------------
Reinhard Kotucha Phone: +49-511-3373112
Marschnerstr. 25
D-30167 Hannover mailto:reinhard.kotucha at web.de
----------------------------------------------------------------------------
Microsoft isn't the answer. Microsoft is the question, and the answer is NO.
----------------------------------------------------------------------------
More information about the texhax
mailing list