Follow-up Comment #6, bug #68923 (group groff):

At 2026-11-20T19:43:35-0500, Deri James wrote:
> Follow-up Comment #5, bug #68923 (group groff):
>
> Branden is not completely wrong. He is correct that both troff and
> grops share the same library code to read groff fonts into memory, and
> gropdf doesn't (neither does afmtodit which creates the files read by
> the library routines0.

Hmm, I forgot about afmtodit not linking libgroff; but of course it
cannot (easily) because it's in Perl.  Hrm.

> The library code reads the charset data into a type of hashed lookup
> keyed on the value of the first column (which could be a duplicate),
> and so does gropdf. The difference is what they do when they find a
> duplicate, the library seems to replace the 'old' entry with the new
> one, gropdf checks if it would be a duplicate and discards the new
> entry.
>
> Both methods are incorrect because alhough the characters are the same
> (when normalised) the glyphs are different, and so we are in danger of
> delivering the wrong glyph based on the users actual input. This can
> only be "solved" by using a unique key in our font files.

I imagine this could be a problem with language that have "final",
"medial" and other context-dependent glyph shapes.

Some examples that aren't too exotic are ancient Greek, with its
terminal sigma, cf. "normal" sigma, and early modern English, with its
terminal "s" which is the normal one nowadays, and the "long s" which
was non-terminals.

Thus, we at one time had a "Congreſs of the United States", where in
cursive the long s was written more like a slanted integral sign.

> Branden is wrong in saying we can only deduce what is happening when
> we have the super-sized .pchar directive,

No, that's not what I said.  Here's what I said:

[comment #1]:
>> This wouldn't strictly depend on bug #67492, but it'd be a lot easier
>> to convincingly demonstrate that it's fixed (and that resolution
>> differs between the drivers now) if that ticket were fixed first.

...meaning that it'd be easier to convince _me_ that we're making
consistent decisions when I can get the formatter to disclose to me what
it's thinking in the character-to-glyph resolution process.

You may not need convincing and that's fine, but I feel a responsibility
to understand any changes that get made to the formatter.  Not least
because this community seems largely to leave it up to me to document
and write tests for things.

> We have the \w and subsequent \n[rst] which will report the library's
> view of the width and height of a particular glyph, e.g. \w'\[u03B9]'.

Yes, but not the glyph's _identity_.  Which might _also_ be worth wiring
up to a writable register populated by `\w`...

> These come from the first two fields in the glyphs meta-data in column
> 2 (adjusted to the current font size). So by comparing these numbers
> with the entries in column 2 we can deduce which entry the library
> routines are using.

That sounds like a wonderful job for a machine to do.  Why shovel this
coal by hand?

[...]

I can't comment on modern Greek orthography.

> It's a mess. The decision to normalise input is a mistake, since it
> creates duplicates, (but it is not Branden's - when I asked what
> advantages there were (for groff)  in normalising to NFD he suggested
> I ask someone else).

I said that because I do not consider myself an expert on Unicode
normalization forms and why they exist.

> Troff is not a word processor which needs to track both input
> characters (normalised for searching/spell checking) and the precise
> glyph which corresponds to the input code.  This is why you can input
> both U+03B9 and U+1FFB (different forms of iota) to a word rocessor,
> both are found when searching for "iotas" but separate glyphs are
> shown on output.  Troff and afmtodit do not use the original input
> code to access font entries, but rather the NFD normalised code.

I think that when these parts of troff were written/revised, people
were thinking only of pre-composed vs. composed characters, as discussed
in groff_char(7)...


     Unicode code points can be composed as well; when they are, GNU
     troff requires NFD (Normalization Form D), where all Unicode glyphs
     are maximally decomposed.  (Exception: precomposed characters in
     the Latin‐1 supplement described above are also accepted.  Do not
     count on this exception remaining in a future GNU troff that
     accepts UTF‐8 input directly.)  Thus, GNU troff accepts “caf\['e]”,
     “caf\[e aa]”, and “caf\[u0065_0301]”, as ways to input
“café”.
     (Due to its legacy 8‐bit encoding compatibility, at present it also
     accepts “caf\[u00E9]” on ISO Latin‐1 systems.)


...and not about characters whose base glyphs' rendered shapes can
mutate in a context-dependent way.



    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?68923>

_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/

Attachment: signature.asc
Description: PGP signature

Reply via email to