groff
[Top][All Lists]
Advanced

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

Re: Computer Modern Font


From: Alexis
Subject: Re: Computer Modern Font
Date: Thu, 8 Jun 2023 13:40:36 +0200

Hi all,

I went ahead and updated the Makefile posted earlier in this thread,
so that the generated fonts work for groff 1.22.4 and 1.23.0 without 
producing errors.

To use the Makefile place it in a directory you feel comfortable
including in GROFF_FONT_PATH and run:

  % make download
  % make fonts aliases  # Must be a separate command for now

This will download the Computer Modern Unicode pfb source files,
generate the groff font files and create font aliases for easier use.
A font alias in this case is the same groff font file with a different
value for the name directive and filename.

Please find attached cmu.ms which showcases the available
Computer Modern Unicode fonts and font aliases produced by the Makefile.

When using the generated Computer Modern Unicode fonts with pdfroff,
grops complains about invalid input characters in the pfb files, e.g.:

  % pdfroff -t -ms -mcmu doc/ms.ms > doc/ms.pdf
  grops:$GROFF_FONT_PATH/devps/../cm-unicode-0.7.0/cmunbi.pfb (doc/ms.ms):3047: 
invalid input character code 3

What could be the cause for that?
Does someone know of afix or workaround? 


What follows are some thoughts on adding support for font aliases
to groff.

With groff 1.22.4 doing less validation of font files it was possible
to simply create symlink to a font file and that symlink would serve
as a font alias.
Since groff 1.23.0 does more validation of the font files than
groff 1.22.4 each font alias needs to be a separate file on disk,
although only the filename and value for the name directive differ.

Is it possible and feasible to change the format of the name directive
so that it allows for several names/aliases?
This would allow a single font file to be used for several font aliases.

Imagine a font file cmunrm containing the following name directive:

  name cmunrm CMUSerifR CMUSerifRoman
  
and CMUSerifR and CMUSerifRoman being symlinks to cmunrm.

This would make it easy to add a new font alias to a font and show
the relation of fonts and font aliases on the file system too.

So far I've only looked into supporting multiple names and aliases
during font file parsing in function font::load from
src/libs/libgroff/font.cpp:779 but know too little about groff's
font loading mechanism in general. Any pointers are greatly appreciated.

If folks think that this might be a useful change I'd be happy to
learn what other code parts might need changing and possible have
a first go at it.
What are your thoughts?


Best
Alexis

Attachment: Makefile
Description: Text document

Attachment: cmu.ms
Description: Troff MS-macros document


reply via email to

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