pdf-raku / PDF-Font-Loader-raku

Font loader for the PDF tool-chain
Artistic License 2.0
1 stars 3 forks source link

If possible, for find-font, add named param to select: mono, serif, or sans #29

Closed tbrowder closed 1 year ago

tbrowder commented 1 year ago

It looks like one of the fontconfig bin programs (fc-list) shows sans, serif, or mono as "atoms" for fonts it lists. You are not presently using the "style" as a named parameter that I see so far.

dwarring commented 1 year ago

Latest PDF::Font::Loader 0.7.1 has a :serif option. :serif for :serif fonts and :!serif for sans-serif fonts. This is implemented by passing serif or sans-serif as the family name to fontconfig, which should treat these as special generic font names. See https://wiki.archlinux.org/title/Font_configuration/Examples#Default_fonts

Also, this release passes any additional find-font or load-font options through to fontconfig. A monospace font can be selected by passing :spacing<mono>, which is a standard fontconfig property.

tbrowder commented 1 year ago

Thanks, David!