Skip to content

Add a configuration to switch to monospace if spacing=100 is requested

Pierre Ducroquet requested to merge pinaraf/fontconfig:fix-spacing-query into main

Previously, requesting a monospace font with an invalid font family (for instance, when a font is not embedded in a PDF, poppler may issue such queries), the font family would be filled by configuration file 49-sansserrif.conf with sans-serif. This new rule set the family to monospace if spacing=100 is specified in the query.

Example query before:

% fc-match "Monospace821BT:spacing=100:lang=xx" file family
DejaVu Sans:file=/usr/share/fonts/TTF/DejaVuSans.ttf


% fc-match "Monospace821BT:spacing=100:lang=xx" file family
DejaVu Sans Mono:file=/usr/share/fonts/TTF/DejaVuSansMono.ttf

(Monospace821BT is a proprietary font used in some PDFs I have received, and this query has been generated by poppler)

Merge request reports