OpenPrinting / OpenPrinting/cups-filters

texttopdf filter does not find FreeFonts

Open
#596 0 comments 0 reactions 0 assignees View on GitHub

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:

  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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.