From: Alejandro Colomar <alx@kernel.org>
To: linux-man@vger.kernel.org, groff@gnu.org
Cc: "G. Branden Robinson" <branden@debian.org>,
Deri James <deri@chuzzlewit.myzen.co.uk>
Subject: Problems building the unifont PFA and DIT files for the PDF book
Date: Sat, 20 Apr 2024 14:26:17 +0200 [thread overview]
Message-ID: <ZiO0cHOWPyuiJGQq@debian> (raw)
[-- Attachment #1: Type: text/plain, Size: 8835 bytes --]
Hi,
I've tried groff-ifying the Unifont, in the same way I do it with the
Tinos font. However, I've had a few problems.
Here's the Tinos font that's packaged with Debian:
$ apt-file find tinos | grep ttf
texlive-fonts-extra-links: /usr/share/texlive/texmf-dist/fonts/truetype/google/tinos/Tinos-Bold.ttf
texlive-fonts-extra-links: /usr/share/texlive/texmf-dist/fonts/truetype/google/tinos/Tinos-BoldItalic.ttf
texlive-fonts-extra-links: /usr/share/texlive/texmf-dist/fonts/truetype/google/tinos/Tinos-Italic.ttf
texlive-fonts-extra-links: /usr/share/texlive/texmf-dist/fonts/truetype/google/tinos/Tinos-Regular.ttf
And here's the Unifont:
$ apt-file find unifont | grep otf | grep fonts | grep -v japanese
fonts-unifont: /usr/share/fonts/opentype/unifont/unifont.otf
fonts-unifont: /usr/share/fonts/opentype/unifont/unifont_csur.otf
fonts-unifont: /usr/share/fonts/opentype/unifont/unifont_jp.otf
fonts-unifont: /usr/share/fonts/opentype/unifont/unifont_jp_sample.otf
fonts-unifont: /usr/share/fonts/opentype/unifont/unifont_sample.otf
fonts-unifont: /usr/share/fonts/opentype/unifont/unifont_upper.otf
fonts-unifont: /usr/share/fonts/opentype/unifont/unifont_upper_sample.otf
First problem:
In the Unifont, I don't see a "Regular" font. I assumed I should take
the unifont.otf file.
Here's how I've been groff-ifying the Tinos font:
$ make build-fonts-tinos -B --debug=pretty
MKDIR .tmp/fonts/devpdf/
install -m 755 -d .tmp/fonts/devpdf/
PFBTOPS .tmp/fonts/devpdf/Tinos.pfa
pfbtops </usr/share/texlive/texmf-dist/fonts/type1/google/tinos/Tinos.pfb >.tmp/fonts/devpdf/Tinos.pfa
FONTFORGE .tmp/fonts/devpdf/TinosR.afm
fontforge -lang=ff -c 'Open("/usr/share/texlive/texmf-dist/fonts/truetype/google/tinos/Tinos-Regular.ttf");Generate(".tmp/fonts/devpdf/TinosR.afm");'
Copyright (c) 2000-2024. See AUTHORS for Contributors.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
Version: 20230101
Based on sources from 2024-03-07 23:15 UTC-ML-D-GDK3.
PythonUI_Init()
copyUIMethodsToBaseTable()
Program root: /usr
The following table(s) in the font have been ignored by FontForge
Ignoring 'DSIG' digital signature table
The glyph named null is mapped to U+0000.
But its name indicates it should be mapped to U+2400.
The glyph named periodcentered is mapped to U+2219.
But its name indicates it should be mapped to U+00B7.
The glyph named Delta is mapped to U+0394.
But its name indicates it should be mapped to U+2206.
The glyph named Omega is mapped to U+03A9.
But its name indicates it should be mapped to U+2126.
The glyph named mu is mapped to U+03BC.
But its name indicates it should be mapped to U+00B5.
AFMTODIT .tmp/fonts/devpdf/TinosR
afmtodit -e /usr/share/groff/current/font/devpdf/enc/text.enc .tmp/fonts/devpdf/TinosR.afm /usr/share/groff/current/font/devpdf/map/text.map .tmp/fonts/devpdf/TinosR
/usr/local/bin/afmtodit: AGL name 'mu' already mapped to groff name 'mc'; ignoring AGL name 'uni00B5'
/usr/local/bin/afmtodit: AGL name 'periodcentered' already mapped to groff name 'pc'; ignoring AGL name 'uni00B7'
/usr/local/bin/afmtodit: both gravecomb and uni0340 map to u0300 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both acutecomb and uni0341 map to u0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both uni0313 and uni0343 map to u0313 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both uni02B9 and uni0374 map to u02B9 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both alphatonos and uni1F71 map to u03B1_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both epsilontonos and uni1F73 map to u03B5_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both etatonos and uni1F75 map to u03B7_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both iotatonos and uni1F77 map to u03B9_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both omicrontonos and uni1F79 map to u03BF_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both omegatonos and uni1F7D map to u03C9_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both Alphatonos and uni1FBB map to u0391_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both Epsilontonos and uni1FC9 map to u0395_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both Etatonos and uni1FCB map to u0397_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both iotadieresistonos and uni1FD3 map to u03B9_0308_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both Iotatonos and uni1FDB map to u0399_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both Upsilontonos and uni1FEB map to u03A5_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both dieresistonos and uni1FEE map to u00A8_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both Omicrontonos and uni1FF9 map to u039F_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both Omegatonos and uni1FFB map to u03A9_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both uni2000 and uni2002 map to u2002 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both uni2001 and uni2003 map to u2003 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both Ohm and uni2126 map to u03A9 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both uni1FE3 and upsilondieresistonos map to u03C5_0308_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both uni1F7B and upsilontonos map to u03C5_0301 at /usr/local/bin/afmtodit line 6586.
/usr/local/bin/afmtodit: both patah and yodyod_patah map to u05B7 at /usr/local/bin/afmtodit line 6586.
Are any of those warnings something I should take care of? Or should I
just ignore them? If they're unimportant, can I ask that low severity
warnings not be printed? Or should I just 2>/dev/null?
Well, apart from those warnings, that works. Now, I repeat the process
with the Unifont:
$ make build-fonts-unifont -B --debug=pretty
MKDIR .tmp/fonts/devpdf/
install -m 755 -d .tmp/fonts/devpdf/
FONTFORGE .tmp/fonts/devpdf/Unifont.pfa
fontforge -lang=ff \
-c 'Open("/usr/share/fonts/opentype/unifont/unifont.otf");Generate(".tmp/fonts/devpdf/Unifont.pfa");'
Copyright (c) 2000-2024. See AUTHORS for Contributors.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
with many parts BSD <http://fontforge.org/license.html>. Please read LICENSE.
Version: 20230101
Based on sources from 2024-03-07 23:15 UTC-ML-D-GDK3.
PythonUI_Init()
copyUIMethodsToBaseTable()
Program root: /usr
AFMTODIT .tmp/fonts/devpdf/UnifontR
afmtodit -e /usr/share/groff/current/font/devpdf/enc/text.enc .tmp/fonts/devpdf/Unifont.afm /usr/share/groff/current/font/devpdf/map/text.map .tmp/fonts/devpdf/UnifontR
Much nicer on stderr, which gave me hope at first.
But then I try to build the PDF book with both fonts.
$ grep -rh -e Tinos -e Unifont share/mk/build/pdf/book/
print ".pdfpagenumbering D . 1\n.nr PDFOUTLINE.FOLDLEVEL 0\n.defcolor pdf:href.colour rgb 0.00 0.25 0.75\n.pdfinfo /Title \"The Linux man-pages Book\"\n.special TinosR UnifontR S\n";
And I get a warning about the Unifont:
$ make build-pdf-book
GROPDF .tmp/man-pages-6.7-70-gd80376b08.pdf
troff:.tmp/fonts/devpdf/UnifontR: error: font description 'spacewidth' directive missing
troff:fanotify_init.2:322: warning [page 192, 4.2i]: cannot adjust line
troff:membarrier.2:272: warning [page 475, 3.0i]: cannot adjust line
statx.2:240: warning: table wider than line length minus indentation
troff:syscall.2:171: warning: cannot select font 'CW'
troff:syscall.2:301: warning: cannot select font 'CW'
troff:syscalls.2:205: warning [page 1074, 5.7i (diversion '3tbd17,0', 0.0i)]: cannot adjust line
troff:syscalls.2:760: warning [page 1074, 5.7i (diversion '3tbd174,0', 0.0i)]: cannot break line
troff:syscalls.2:1278: warning [page 1074, 5.7i (diversion '3tbd317,0', 0.0i)]: cannot break line
^Cmake: *** [/home/alx/src/linux/man-pages/man-pages/contrib/share/mk/build/pdf/book/_.mk:39: .tmp/man-pages-6.7-70-gd80376b08.pdf] Interrupt
Did I do anything wrong with the Unifont? I suspect of treating it as a
Regular font without any indication that I should.
(The Tinos changes are already in master. The Unifont changes are in
the contrib branch, since I'm not yet happy with them.)
Have a lovely day!
Alex
--
<https://www.alejandro-colomar.es/>
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next reply other threads:[~2024-04-20 12:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-20 12:26 Alejandro Colomar [this message]
2024-04-20 15:52 ` Problems building the unifont PFA and DIT files for the PDF book G. Branden Robinson
2024-04-20 20:11 ` Brian Inglis
2024-04-20 22:32 ` Alejandro Colomar
2024-04-20 22:20 ` Alejandro Colomar
[not found] ` <2272286.muIFQpQJ8V@pip>
2024-04-21 20:08 ` Alejandro Colomar
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZiO0cHOWPyuiJGQq@debian \
--to=alx@kernel.org \
--cc=branden@debian.org \
--cc=deri@chuzzlewit.myzen.co.uk \
--cc=groff@gnu.org \
--cc=linux-man@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.