OpenPrinting / OpenPrinting/cups-filters
texttopdf filter does not find FreeFonts
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 197
- Forks
- 158
- Avg merge
- 3h 29m
- Merged PRs (30d)
- 1
Description
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:
- 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
...
-
run the above test case
-
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
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the texttopdf filter and the pdf.utf-8.freefont charset configuration shown in the report, then inspect the strace entries for FreeMono.ttf and the font-matching output. Reproduce the command from the issue and determine why accessible FreeFonts are rejected; done means UTF-8 input produces a PDF without “No viable font found” or “Ignored bad font” warnings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- backend
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100