Loading fonts in TeX, various formats, by filename vs. full name

terry.s at Safe-mail.net terry.s at Safe-mail.net
Thu Oct 26 20:14:04 CEST 2023


Hello,

My name is Terry, and I've been a LaTeX user on and off for about 3 years. I am new to (plain) TeX and eplain. I'm want to learn (plain) TeX for a few reasons (caps for emphasis where necessary):

a) I recently tested OpTeX and I really like it! It removes avoids LaTeX renaming of essentially TeX macros, requires fewer commands to do the same thing, was written from the ground-up to support Unicode, and adds stable (and simpler) macros for things like customized headers, code listings and many things without loading external packages. But if you DO want to customize, learning TeX is important because OpTeX does NOT duplicate things that exist in TeX, it only adds improvements.

Unfortunately, it only supports a limited # of languages, both in terms of "hyphenation patterns" (some languages DON'T use interword spacing + hyphenation) and ability to map extended character slots to glyphs; so Asian characters in source code are not supported, period. In addition, there is no support for true vertical typesetting as in the Japanese engines with vertical-oriented classes. The engine supports only about a dozen packages; OpTeX has 1 maintainer, Petr Oslak. I also have some trouble understanding how to customize the header macros for multi-level sections. (The defaults are similar to what you could do with "fancy" defaults in LaTeX, but it's built into OpTeX.) Clearly knowing TeX would help!

I may also be able to at least get Japanese text to "print" via some plain TeX commands (or maybe not), minus hyphenation patterns, yet still appropriate for short phrases in an otherwise-English document.

b) I want to create some custom classes for (real 12-month) calendars and other (real) calendars. OpTeX is probably sufficient for this, because it's so easy to set geometry (no package required), but undoubtedly I will have need of TeX primitives to do what I want (import holidays from a user list, import photos and captions from a list, control the month grid, allow for some branding). I also want some fonts for this besides Computer Modern (not a problem for OpTeX).

c) I am learning 日本語 (Japanese), but there's virtually NO 英語 (English) documentationof Japanese engines. I am a self-taught beginner and cannot even find modern technical/computer dictionaries, online nor in stores, so I can't read the 日本語 documentation. The ONLY engine documentation found in days of searching are the "official" pTeX/upTeX PDFs that mostly cover installation and very rudimentary user commands. I can have a lovely typeset document from the classes, but know virtually NO engine-specific user commands. (For example, I want to have documents with mixed vertical/horizontal text; the only way I can do this is with \shadowbox because it's one of the FEW user commands documentated in English, and it's really not appropriate except perhaps short "aside" material!) To do anything beyond type basic text, I must learn TeX --- TeX is transferrable to all engines, obviously, even if they redefine or remove a few primitives here and there.

In summary, I must learn TeX to use OpTeX efficiently. Furthermore, I must learn to support various font-types with TeX, have multiple sectioning levels, etc. (Thus I was also using eplain.) Finally, I must learn TeX commands so I can use them in upTeX. For this reason (and aesthetics for books and documents in general), fonts are NOT a "peripheral issue" for me and my learning of TeX. In the modern world, most of us want to use the best fonts for a particular media, appropriate to subject matter, and for readability, a fresh look and even branding.

I had some discussion with members of the tex-eplain list on fonts, but clearly this is TeX-specific, and I was advised to pursue the topic on a more appropriate list.

--- The issues and what's been attempted ---
I have TeX Live 2022 installed on Windows 8. (For some reason 2023 fails, but unless there's a font bug or new utlity that would help me, I'm ignoring that for now). I have no problem loading (non-Asian) fonts in the OpTeX engine with OpTeX's commands. These font errors are specific to TeX.

1) I obviously want to load ENTIRE FAMILIES, not just 1 variant of a family. Karl Berry does this to create a font-switch by name:

> > \font\1="Liberation Serif" % quotes are required
> > {\1 This is Liberation Serif.}

However, this doesn't work for me, even for fonts which have a `.tfm' file. Furthermore, error messages reference only the FIRST word ... I discovered I must use {}, not "" around font-names. However, this doesn't address the error itself, which is that TeX can't find a '.tfm' file for said font. (Yes, I tested with 1-word fonts, too.) Even "Computer Modern" won't work! The command works fine for T1 variants referenced by filename but not family-name.

I got different results for ab"DSSerif": TeX found and loaded it without error, but comiling with dvidpfmx gave this error:

> > "`dvipdfmx:fatal: CFF: Inconsistent DICT argument number.

2) I was reminded to update my kpathsea DB by Laurence Finston. I ran: mktexlsr

Nothing much has changed except TeX now has the '.tfm' error for "DSSerif", too.

3) I remembered I still had fonts installed in my 2021 "texmf-local" which was restored (onto a different computer with a clean 2022 TeX Live) from backups along with my other documents. They exhibit identical behavior: I can load variants by filename but not families by family-name.

4) But there's ANOTHER ISSUE with some of those fonts: spaces in text are ignored! (minimal example attached)

5) I know TeX Live has a lot of fonts installed for various engines, or fonts distributed but not installed, or (just learned) fonts with `.tfm' font metric files for NON-free fonts where the GLYPHS ('.pdf' files) are NOT installed, as a convenience in case you should buy and install them.
I have a screenshot from a StackExchange post of a Don Knuth list, "Individual Font Families", which is said to be fonts directly usable by TeX. I don't know the list's date, but I recognize several popular, modern fonts on that list (e.g. DejaVuSans). The screenshot is attached. (Sorry, I have cleaned out the email with the link.)

I THINK my next step is TEST installing a couple font types (T1, OTF, TTF) with "installfont-tl" and even "fontforge" (there was a Windows .msi) AND/OR checking the documentation for "dvipdfmx". There was some discussion in said StackExchange post relating to specific engines, but it mentioned that your DVI DRIVER must support the font, too! Someone even mentioned a driver may produce FALSE '.tfm' errors, when a missing '.tfm' is not the actual issue.

However, I'm hoping someone can suggest ideas on new tools that may solve the issues, or what the issues truly are?
I'm starting to browse "TeX for the Impatient" and "TeX by Topic" regarding fonts.

I also attached a minimal example testing several fonts in TeX Live, in my "texmf-dist", and from DK's list, along with the PDF result.

Sincerely,
Terry S.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Individual Font Families in TeX - Don Knuth.png
Type: image/png
Size: 385943 bytes
Desc: not available
URL: <https://tug.org/pipermail/texhax/attachments/20231026/5e31f131/attachment-0001.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TeX-fonts.tex
Type: application/octet-stream
Size: 3268 bytes
Desc: not available
URL: <https://tug.org/pipermail/texhax/attachments/20231026/5e31f131/attachment-0001.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TeX-fonts.pdf
Type: application/pdf
Size: 50480 bytes
Desc: not available
URL: <https://tug.org/pipermail/texhax/attachments/20231026/5e31f131/attachment-0001.pdf>


More information about the texhax mailing list.