Follow-up Comment #7, bug #59402 (group groff): On Tuesday, 3 November 2026 01:48:40 Greenwich Mean Time Dave wrote: > Follow-up Comment #5, bug #59402 (group groff): > > [comment #3 comment #3:] > >> Unlike uconv, which can be asked to output NFD, preconv >> always outputs NFC unicode. > > It appears to me that preconv is equally willing to output NFC or NFD > depending on what its input uses.
> $ printf "co\xF6perate\n" | LC_CTYPE=en_US.iso88591 uconv -f latin1 -x
> Any-NFD | preconv -eUTF-8 -r
>
> coo\[u0308]perate
>
> $ printf "co\xF6perate\n" | LC_CTYPE=en_US.iso88591 uconv -f latin1 -x
> Any-NFC | preconv -eUTF-8 -r
>
> co\[u00F6]perate
First a little experiment to see what uconv is doing:-
derij@pip:~/.groff/fonts/devpdf $ printf "\xf6"|uconv -f latin1 -x Any-NFD |
wc --chars
2
derij@pip:~/.groff/fonts/devpdf $ printf "\xf6"|uconv -f latin1 -x Any-NFC |
wc --chars
1
With NFD it outputs 2 characters - 'o' and 'combining diaeresis' (U+0308).
Both of these are coded in utf8. When preconv sees the first character it is
ascii so passes it on, when it reads the second character it is valid utf8 so
it outputs \[u0308). Since preconv does neither compose nor decompose simply
outputting either ascii or the groff representation of the unicode number -
\[uXXXX(X(X))] - you get the expected 'o' plus combining diaeresis when
output.
Preconv has not used NFD it has just 'passed on' the characters which have
been already decomposed (NFD) by uconv. Technically it would be possible for
groff to re-compose the character back to \[u00F6] by looking at the unicode
number of the previous 'character' node on the stack, combining it with the
unicode number of the current character (006F_0308) and do a reverse lookup on
its current decompose table, if found alter the previous node to be 00F6.
../src/libs/libgroff/uniuni.cpp: { "00F6", "2006F_0308" },
NB the initial digit '2' is just a count of the number of elements in the
composed character.
Although this would not be difficult to achieve I would not recommend it, if
someone has gone to the great trouble of decomposing a character before
passing it to groff/preconv they must really, really want the output to be
'built' from 2 separate glyphs rather than the composed glyph which would
normally be used. Who are we to argue!!
>> Also, this bug is incorrectly named, troff does recognise
>> the preconv output, it is just telling you that the
>> decomposed character requires a combining diaeresis
>> which is not available in the selected font. If you have
>> a font which contains u0308 troff would not complain.
>
> Ah, thank you for shedding light on this important point. So this means
> there's not a problem in the formatter at all, and the changes Branden
> despaired of shouldn't be necessary even in the long term when groff is
> chewing up Unicode input directly. We may just want better glyph coverage
> in the default fonts that ship with groff by then.
>
The formatter is doing exactly what it was told to do, output 'o' followed by
a combining diaeresis, rather than 'o with diaresis'. For -Tpdf we could
easily ship 'special' fonts with better glyph coverage (subject to license
compatibility), my personal groff DESC file is:-
derij@pip:~/.groff/fonts/devpdf $ cat DESC
res 72000
hor 1
vert 1
sizescale 1000
unitwidth 1000
sizes 1000-10000000 0
styles R B BI I Li LiI
family CN
fonts 9 0 0 0 0 0 SS Math NotoEmoji Symbola
tcommand
postpro gropdf
papersize a4
They are big files compared to Symbol and Dingbats which we supply and grops
would need to embed the whole file if even 1 glyph were used because it does
not do font subsetting. Also the Symbol font we use is closely matched to eqn,
some equations look a bit odd if using other fonts.
I'm afraid you may notice my default family is CN (windows Comic-Neue) it just
tickles my fancy reading all man-pages in comic-neue.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?59402>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
signature.asc
Description: PGP signature
