groff
[Top][All Lists]
Advanced

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

Re: Font path issue


From: Deri
Subject: Re: Font path issue
Date: Sun, 21 Aug 2022 01:12:07 +0100

On Saturday, 20 August 2022 01:05:02 BST Peter Schaffter wrote:
> In this post, "system" means groff/current/font/ and "local" means
> /groff/site-font.

Hi Peter,

"current" should be a symlink to a numbered version in the groff directory. 
Where does it point on your system?

> After implementing Robert G's advice that the contents of the system
> /devps 'download' file be copied into the 'download' file in the local
> /devps 'download', I decided to explore the matter further by
> building the local /devps and /devpdf from scratch.  I emptied the
> two directories of all files and created a test file:
> 
>   .sp |1i
>   .ps 20
>   .vs 24
>   .nf
>   .ft TR
>   € (unicode)
>   \[eu] \\[eu]
>   \[Eu] \\[Eu]
>   The quick brown fox jumps over the lazy dog.
>   .EQ
>   alpha beta gamma delta
>   .EN
> 
> Without explicitly setting GROFF_FONT_PATH and with both
> local directories empty,
>   groff -Tps -ke test > test.ps
> built the file without complaining, but with upright Greek glyphs
> instead of the expected slanted ones.  

This is indicative of grops not finding Symbol-Slanted in the download file, 
so it does not get embedded as a font.

> When I tried
>   groff -Tpdf -ke test > test.pdf
> groff produced an error
>   test.mom: Failed to open font 'TR'
> I tried again using the U-TR font, which is unique to gropdf, but
> got the same error
>   test.mom: Failed to open font 'U-TR'

This error could come from troff, if the error occurred when reading your 
input file, or gropdf if it occurred when processing the groff_out commands.

> According to the groff documentation, groff is supposed to search
> both the system and local /devps and /devpdf font directories (plus
> any given to '-F' at the command line), however it is not; TR and
> U-TR are both present in the system /devpdf and should have been
> picked up.
> 
> With both local directories still empty, I explicitly set
>   export GROFF_FONT_PATH=/usr/local/share/groff/current/font/
> and ran the -Tps and -Tpdf tests again.  Bingo.  The .ps file had
> the expected slanted Greek glyphs and groff didn't complain about
> not finding TR with -Tpdf.

These default paths to look for fonts are "baked" into the executables at 
build time. The "groff -v" command will give an indication. The version 
numbers shown should be the same and that version number should be its own 
directory in the groff directory. If you look at gropdf around line 55, you 
should see something like:-

$cfg{GROFF_VERSION}='1.22.4';
$cfg{GROFF_FONT_PATH}='/usr/share/groff/site-font:/usr/share/groff/1.22.4/
font:/usr/lib/font';

Here you can see site-font and 1.22.4/font referenced and on my system the 
groff directory contains:-

[derij@pip ~]$ ls -l /usr/share/groff/
total 4
drwxr-xr-x 1 root root 44 Mar 21  2021 1.22.4/
lrwxrwxrwx 1 root root  6 Feb 14  2020 current -> 1.22.4/
drwxr-xr-x 1 root root 22 Jul 27 15:16 site-font/
drwxr-xr-x 1 root root 38 Mar 21  2021 site-tmac/

If your groff/current has become a real directory, rather than a symlink to a 
version directory, this might explain the problems you describe. Otherwise, 
look carefully at the paths in gropdf as shown above.

> It seems that Robert G's suggestion fixed his issue without
> addressing the problem, which is that the system /devps and /devpdf
> font directories are not being read by default.  There's no need
> for the system 'download' contents to be copied over to the local
> 'download'.  What's required is explicitly pointing GROFF_FONT_PATH
> to the system /devps and /devpdf font directories.
> 
> Is this a bug, or is it something that needs to be documented?  I'm
> running a 1.22.4.7-72b4 build; perhaps it's already been corrected?

All works fine here. I believe what hit Robert is that grops stops looking 
when it finds the first download file (which would be the one in site-font if 
it exists) which  means that if there are any entries in the system download 
they would not be found. This is why copying those entries to site-font 
download fixed his problem.

Gropdf is different, it takes into account all download files found, so there 
is no need to duplicate entries into the site-font download file. You could 
organise your fonts into separate families, each with its own separate 
download file just for that family, and then list the directories separated by 
a ":" in GROFF_FONT_PATH.

Cheers

Deri






reply via email to

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