Follow-up Comment #12, bug #59402 (group groff):

At 2026-11-10T11:15:10-0500, Deri James wrote:
> Afmtodit used to warn when it was creating duplicate keys in a groff
> font, this was silenced by commit 389b3e7f.

That's not true in general.  The "silencing" affects only three pairs of
code points.


diff --git a/ChangeLog b/ChangeLog
index c48b23afb..ff19197d2 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2025-08-05  G. Branden Robinson <[email protected]>
+
+       * src/utils/afmtodit/afmtodit.pl: Stop throwing duplicate
+       mapping warning diagnostics in a handful of cases where we
+       expect them.  (All are cases of classical Greek letters
+       repurposed for technical applications).  Per James Cloos, some
+       redundant character code points, and thus duplicate Unicode->AGL
+       mappings, exist to preserve round-trip compatibility when
+       converting between character sets.
+
 2025-08-03  G. Branden Robinson <[email protected]>

        * src/utils/afmtodit/afmtodit.pl: Fix up new diagnostic message
diff --git a/src/utils/afmtodit/afmtodit.pl b/src/utils/afmtodit/afmtodit.pl
index 75dd4c9de..99c975e9a 100644
--- a/src/utils/afmtodit/afmtodit.pl
+++ b/src/utils/afmtodit/afmtodit.pl
@@ -490,7 +490,14 @@ if (!$opt_x) {
            $u =~ s/^_/u/;
            if ($u) {
                if (defined $mapped{$u}) {
-                   whine("both $mapped{$u} and $ch map to $u");
+                   # Don't whine about duplicates that exist to
+                   # preserve round-trip conversions; thanks to James
+                   # Cloos for pointing this out.
+                   if (!(($mapped{$u} eq 'Delta' and ($ch eq 'uni0394'))
+                        or ($mapped{$u} eq 'mu' and ($ch eq 'uni03BC'))
+                        or ($mapped{$u} eq 'uni03A9' and ($ch eq
'uni2126')))) {
+                       whine("both $mapped{$u} and $ch map to $u");
+                   }
                }
                else {
                    $mapped{$u} = $ch;


In fact we have a whole section of the afmtodit(1) man page discussing
the issue of duplicate mapping warnings, which often occur during groff
builds (when URW fonts are found and used).


Diagnostics
     AGL name 'x' already mapped to groff name 'y'; ignoring AGL name
     'uniXXXX'
            You can disregard these if they’re in the form shown, where
            the ignored AGL name contains four hexadecimal digits XXXX.
            The Adobe Glyph List (AGL) has its own names for glyphs;
            they often differ from groff’s special character names.
            afmtodit is constructing a mapping from groff special
            character names to AGL names; this can be a one‐to‐one or
            many‐to‐one mapping, but one‐to‐many does not work, so
            afmtodit discards the excess mappings.  For example, if x is
            Delta, y is *D, and XXXX is 0394, afmtodit is telling you
            that the groff font description that it is writing cannot
            map the groff special character \[*D] to AGL glyphs Delta
            and uni0394 at the same time.

            If you get a message like this but are unhappy with which
            mapping is ignored, a remedy is to craft an alternative map‐
            file and re‐run afmtodit using it.

            When the -q option is used, these messages are suppressed in
            favor of a count of how many would have been emitted were
            the option not present.


How is it that you were unaware of these facts?  They are not recent
developments.  If you _were_ aware of them, why are you making such
distorted claims on a topic that desperately needs better understanding
by your fellow developers?



    _______________________________________________________

Reply to this item at:

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

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

Attachment: signature.asc
Description: PGP signature

Reply via email to