diff options
author | Pierre Ducroquet <pinaraf@pinaraf.info> | 2021-08-21 15:45:50 +0200 |
---|---|---|
committer | Pierre Ducroquet <pinaraf@pinaraf.info> | 2022-01-13 11:34:25 +0100 |
commit | 3fcdd60a1ddadbac4b7471ada48ea073411555bb (patch) | |
tree | 568de8ea7836cff5260892ee6612770d14123883 | |
parent | 7b09c81dab9b53068abb5f546fe3b143916bf847 (diff) | |
download | fontconfig-3fcdd60a1ddadbac4b7471ada48ea073411555bb.tar.gz |
Add a configuration to switch to monospace if spacing=100 is requested
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.
-rw-r--r-- | conf.d/48-spacing.conf | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/conf.d/48-spacing.conf b/conf.d/48-spacing.conf new file mode 100644 index 0000000..95f394d --- /dev/null +++ b/conf.d/48-spacing.conf @@ -0,0 +1,25 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "urn:fontconfig:fonts.dtd"> +<fontconfig> + <description>Add mono to the family when no generic name and spacing is 100</description> +<!-- + If the font has no generic name and spacing 100, add mono + --> + <match target="pattern"> + <test qual="all" name="family" compare="not_eq"> + <string>sans-serif</string> + </test> + <test qual="all" name="family" compare="not_eq"> + <string>serif</string> + </test> + <test qual="all" name="family" compare="not_eq"> + <string>monospace</string> + </test> + <test qual="all" name="spacing" compare="eq"> + <int>100</int> + </test> + <edit name="family" mode="append_last"> + <string>monospace</string> + </edit> + </match> +</fontconfig> |