[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: An ignoramus question about textmap

From: G. Branden Robinson
Subject: Re: An ignoramus question about textmap
Date: Thu, 6 Apr 2023 05:26:06 -0500

At 2023-04-06T10:03:17+0200, Oliver Corff wrote:
> please forgive me if I am asking a blatantly uninformed question.

No danger of that, I think--running afmtodit(1) is something not a lot
of people do.  :)

> Currently I am trying to add a font containing Greek and Cyrillic
> characters to groff by using Peter Schaffter's script,
> following the steps T. Kurt Bond's summary.[1]
> Starting with the font in my working directory, the script asks for a
> file named textmap. I found one in
> /usr/share/groff/current/font/devpdf/map/, and the same file in
> ../devps/generate/.

Yes.  FYI, for consistency with other such mapping files (used by grops,
grolj4, and grodvi[1]), this file is renamed to "" in groff
1.23.0.rc2 and later.

The script is asking for a file called "textmap" because a groff utility
called "afmtodit" wants it.

> I opened textmap in order to get an idea of its contents, and while I
> think I understand its basic structure I did not find comprehensive
> entries for Greek and Cyrillic.
> Are these optional or mandatory? If mandatory, is there an "official"
> list of character names I have to adhere to?

To the best of my knowledge they are optional, and I have a guess as to
why they're not already present.

That reason would be that historically, PostScript fonts did not have
glyph coverage for Cyrillic or modern Greek[2] scripts.  I conclude this
based on my copy of the PostScript Language Reference, 3rd edition
(1999), ISBN 0-201-37922-8, tables E.1 through E.4, pp. 775-778.

Where I am less certain is what the best thing to do is.  You can surely
try employing the font(s) without use of the mapping file, or with a
mapping file that doesn't cover the Cyrillic or Greek characters (i.e.,
like the "textmap" file already available as part of the groff
installation).  According to afmtodit(1),

    If a PostScript glyph is not mentioned in map-file, and a groff
    character name can't be deduced using the Adobe Glyph List (AGL,
    built into afmtodit), then afmtodit puts the PostScript glyph into
    the groff font description file as an unnamed glyph which can only
    be accessed by the "\N" escape sequence in a roff document.  In
    particular, this is true for glyph variants named in the form
    ""; all glyph names containing one or more periods are mapped
    to unnamed entities.

The Adobe Glyph List[3] _does_ appear to have coverage of the Cyrillic
and modern Greek script alphabets.  For example, the version used by
groff 1.23.0.rc{2,3} has "Abrevecyrillic", "Alpha", and "alpha", and
this file associates them with their Unicode code points, which are in
the correct blocks for Cyrillic and Greek (and Coptic) scripts.  The
afmtodit(1) command uses this information, so it should not be necessary
to manually map them to groff's Unicode special character escape
sequences--\[u0391] for Greek Alpha, for instance.

So, given a preconv(1)ed UTF-8 input document, one using Dorai Sitaram's
new "rfc1345.tmac" macro file, or one laboriously typed with \[uXXXX]
all over the place, one _should_ be off to the races.

The foregoing is a really long way of saying that a font should "just
work" using the default file even though that mapping file
doesn't meaningfully cover the scripts; the AGL and the Unicode code
point assignments do the work for us.  But if it fails, the above
presentation may help us track down where things went wrong and why.


[1] gropdf copies a subset of grops's mapping files; it doesn't need the
    ones grops has for slanted symbols and reversed dingbats.

[2] The PostScript symbol font has significant coverage of classical
    Greek letters.  The lowercase forms are upright (unlike those of the
    "special" font of the Graphic Systems C/A/T device driven by the
    original Unix troff).  I suppose, with overstriking of an acute
    accent on the occasional vowel, this is enough to render
    intelligible modern Greek script, but only in a single face; from a
    typographical perspective, I don't think it can be said that its
    Greek script coverage is on par with that of Latin, which enjoys
    three font families of four styles each.


Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]