cups-filters icon indicating copy to clipboard operation
cups-filters copied to clipboard

texttopdf filter does not find FreeFonts

Open gurucubano opened this issue 1 year ago • 0 comments

Describe the bug

We use since "ages" the components

cups-2.3.6 fontconfig-2.13.93 cups-filters-1.0.62

to print UTF-8 test files to Postscript printers through the filter "texttops". I recompiled everything for OpenSSL 3.0.12 and since then "texttops" stops working with the following messages:

CHARSET=utf-8 strace -s128 -o texttopdf.tr /usr/local/sisis-pap/cups2/lib/cups/filter/texttopdf 1 1 1 1 1 UTF-8-demo.txt > out.pdf
No viable font found
WARNING: Ignored bad font "FreeMono"
No viable font found
WARNING: Ignored bad font "FreeMono"
No viable font found
...

The identical error messages show up in the cupsd "error_log" when yout let cupsd process this as a job.

To Reproduce Steps to reproduce the behavior:

  1. Create the config as:
ls -l /usr/local/sisis-pap/cups2/share/cups/charsets/pdf.utf-8
lrwxrwxrwx 1 root root 18  4. Sep 12:17 /usr/local/sisis-pap/cups2/share/cups/charsets/pdf.utf-8 -> pdf.utf-8.freefont

head /usr/local/sisis-pap/cups2/share/cups/charsets/pdf.utf-8
charset utf8

#
# This file defines the font mappings used for Unicode/UTF-8 text printing
# through PDF.
# ...
# ...
0000 00FF ltor single FreeMono FreeMono:bold FreeMono:oblique FreeMono:bold:oblique
0100 02FF ltor single FreeMono FreeMono:bold FreeMono:oblique FreeMono:bold:oblique
...
  1. run the above test case

  2. check the traces produced by "strace" which show that the font files are accessed:

grep FreeFont texttopdf.tr | grep open | grep ttf | grep -v NOENT  | more
openat(AT_FDCWD, "/usr/share/fonts/FreeFont/FreeMono.ttf", O_RDONLY) = 6
openat(AT_FDCWD, "/usr/share/fonts/FreeFont/FreeMono.ttf", O_RDONLY) = 6
openat(AT_FDCWD, "/usr/share/fonts/FreeFont/FreeMonoBold.ttf", O_RDONLY) = 6
openat(AT_FDCWD, "/usr/share/fonts/FreeFont/FreeMonoBold.ttf", O_RDONLY) = 6
...

/usr/local/sisis-pap/cups2/bin/fc-match -s FreeMono  | grep Free
FreeMono.ttf: "FreeMono" "Standard"
FreeSerif.ttf: "FreeSerif" "Mittel"
FreeSans.ttf: "FreeSans" "Mittel"

System Information:

  • OS: SuSE Linux Enterprise 15.0 SP5

gurucubano avatar Sep 04 '24 11:09 gurucubano