bug-groff
[Top][All Lists]
Advanced

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

[bug #63018] [PATCH] make glyphs in ZD font accessible via their Unicode


From: Deri James
Subject: [bug #63018] [PATCH] make glyphs in ZD font accessible via their Unicode spellings
Date: Tue, 14 May 2024 18:47:47 -0400 (EDT)

Follow-up Comment #31, bug #63018 (group groff):

I have been investigating the AFMs Branden found with a view to using them as
a way to recreate the grops fonts, particularly in situations where there have
been changes to the maps, encoding files and afmtodit itself. Since the last
release afmtodit, and dingbats map have been altered, and the grops fonts have
been hand edited by me to add the UTF-16 code as a comment. Afmtodit is to be
changed soon to add the new spacewidth algorithm and improvements to the font
comments.

For all these reasons it would be convenient to have an automated procedure
which generates the grops fonts. The attached grops-fonts-AFMs.tar.gz has
everything required to do this. It contains the afms from the
Adobe-Core35_AFMs-229.tar.gz from CTAN, with one change, the Symbol.afm has
been replaced with symbol.afm from the git grops directory, since I suspect
this has been edited to work best with eqn. Investigation showed that the
original Symbol.afm from the 229 tar.gz produced different italic corrections,
whereas the copy from the grops directory produces identical results.

All the AFMs have had the ellipsis kerning lines added, (see script
EllipsisFix.sh - a blatant rip off from Daves code in bug #58897 - except it
now operates on the KPX lines in the AFM files, so no need to run it again,
but left in place to show what was done).

The script BuildPSfonts.pl runs afmtodit with the correct parameters. It takes
4 parameters:-

BuildPSfonts.pl [-F font-directory] [-map directory-with-map-files] [-enc
directory-with-enc-files] [-afm directory-with-afm-files]

>From the build directory I ran it with this parameter:-

./BuildPSfonts.pl -F ./devps -enc ../font/devps -map ../font/devps/generate
-afm grops-fonts-AFMs

Note I used a separate directory for the new fonts so I could then compare
them with the current files for checking.

When you check the results you will notice a few differences:-

The final glyph in each file has a different UTF-16 comment, the new versions
are correct, mistake in my hand editing when I committed them, the new
generated files are correct.

In some fonts there is one case where the position of the ellipsis and period
kern lines are swapped, this has no effect, it happens when afmtodit is
processing a glyph alias (i.e. when two groff names refer to the same glyph,
contains just a name and a " in the font entry. In this case generates two
kern entries and sorts them alphabetically. Dave's sed script which added an
epsilon kern after each '.' kern, so the order would be like this:-

. rq -70
u2026 rq -70
. ' -70
u2026 ' -70

Whereas afmtodit sorts the kern list alphabetically so it becomes:-

. rq -70
. ' -70
u2026 rq -70
u2026 ' -70

This has no effect.

The S font has the most changes. There is a new glyph Upsilon which is not in
the current font, and it is given the groff name "u03A5" rather than *U,which
is assigned to 03D2 "GREEK UPSILON WITH HOOK SYMBOL", so I don't think this
will cause an issue. The rest of the difference are all to do with the comment
field and have no effect.

The SS font is a problem. There is a file called symbolsl.afm in the devps
directory which one could reasonably assume was used to produce the SS file
via afmtodit. However, if you look at the file you will see it has problems:-

C 33 ; WX 333 ; N exclam ; B 128 -13 240 686 ;

The width is shown as 333, but this produces:-

---     296,598,15,137,-73,99   3       33      exclam

Where the width is now 296 (=333*.89) and the height goes from 673 (686-13) to
598 (=673*.89). The .89 factor is from the transformation applied to the
normal symbol file in the file symbolsl.ps:-

%%IncludeResource: font Symbol

/Symbol-Slanted
[.89 0.0 15.5 dup sin exch cos div .89 0.0 0.0]
/Symbol
MakeTransformedFont

Which seems to be a zoom factor plus either a rotate or shear transformation
(my maths is not up to it). I was 17 before I had my first proper maths
lesson, the benefits of going to a school where you are not expected to be
academic. :-)

So I don't think we can faithfully reproduce the SS font from source files,
unless someone is mathematical enough to apply a transformation to the llx,
lly, urx, ury (which defines a rectangle) so if someone can convert the
postscript transformation to a formula which converts the rectangle, we could
add it as an option to afmtodit

Another issue which applies to SS, is that because it is defined in DESC fonts
before the S font and will be searched first, it is important that only the
symbol glyphs we want to become slanted (i.e. lowercase greek for equations)
are named, the rest need to be unnamed (---) so groff will look for them in
the normal symbol font instead. This script does that as well.

I have done a fair bit of work on this, because I think it is important we
have the ability to recreate the grops fonts, but I am now stuck: need help
with the maths outlined above and also guidance on implementing this as a make
target.

(file #56053)

    _______________________________________________________

Additional Item Attachment:

File name: grops-fonts-AFMs.tar.gz        Size: 168KiB
    <https://file.savannah.gnu.org/file/grops-fonts-AFMs.tar.gz?file_id=56053>


    AGPL NOTICE

These attachments are served by Savane. You can download the corresponding
source code of Savane at
https://git.savannah.nongnu.org/cgit/administration/savane.git/snapshot/savane-4b48cbb9570c156bf7d681225b664258d7028914.tar.gz


    _______________________________________________________

Reply to this item at:

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

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




reply via email to

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