Sample Header Ad - 728x90

Fontconfig not matching msttcore fonts

0 votes
0 answers
18 views
On my Fedora Linux system, fontconfig does not use the msttcore fonts when it should. Here's one example; let's concentrate on the Courier New Bold font in a PDF file:
$ pdffonts -subst a.pdf | grep 'Courier New Bold'
Courier New Bold                       8345  0 Noto Sans Mono Regular               /usr/share/fonts/google-noto-vf/NotoSansMono[wght].ttf
fontconfig thinks that Noto Sans Mono Regular is the best available match for Courier New Bold. Now, fontconfig is aware that the msttcore fonts are installed:
$ fc-list | grep courbd
/usr/share/fonts/msttcore/courbd.ttf: Courier New:style=Bold,Negreta,tučné,fed,Fett,Έντονα,Negrita,Lihavoitu,Gras,Félkövér,Grassetto,Vet,Halvfet,Pogrubiony,Negrito,Полужирный,Fet,Kalın,Krepko,đậm,Lodia

$ fc-query /usr/share/fonts/msttcore/courbd.ttf
Pattern has 29 elts (size 32)
	family: "Courier New"(s)
	familylang: "en"(s)
	style: "Bold"(s) "Negreta"(s) "tučné"(s) "fed"(s) "Fett"(s) "Έντονα"(s) "Negrita"(s) "Lihavoitu"(s) "Gras"(s) "Félkövér"(s) "Grassetto"(s) "Vet"(s) "Halvfet"(s) "Pogrubiony"(s) "Negrito"(s) "Полужирный"(s) "Fet"(s) "Kalın"(s) "Krepko"(s) "đậm"(s) "Lodia"(s)
	stylelang: "en"(s) "ca"(s) "cs"(s) "da"(s) "de"(s) "el"(s) "es"(s) "fi"(s) "fr"(s) "hu"(s) "it"(s) "nl"(s) "no"(s) "pl"(s) "pt"(s) "ru"(s) "sv"(s) "tr"(s) "sl"(s) "vi"(s) "eu"(s)
	fullname: "Courier New Bold"(s) "Courier New Negreta"(s) "Courier New tučné"(s) "Courier New fed"(s) "Courier New Fett"(s) "Courier New Έντονα"(s) "Courier New Negrita"(s) "Courier New Lihavoitu"(s) "Courier New Gras"(s) "Courier New Félkövér"(s) "Courier New Grassetto"(s) "Courier New Vet"(s) "Courier New Halvfet"(s) "Courier New Pogrubiony"(s) "Courier New Negrito"(s) "Courier New Полужирный"(s) "Courier New Fet"(s) "Courier New Kalın"(s) "Courier New Krepko"(s) "Courier New đậm"(s) "Courier New Lodia"(s)
	fullnamelang: "en"(s) "ca"(s) "cs"(s) "da"(s) "de"(s) "el"(s) "es"(s) "fi"(s) "fr"(s) "hu"(s) "it"(s) "nl"(s) "no"(s) "pl"(s) "pt"(s) "ru"(s) "sv"(s) "tr"(s) "sl"(s) "vi"(s) "eu"(s)
	slant: 0(i)(s)
	weight: 200(f)(s)
	width: 100(f)(s)
	spacing: 100(i)(s)
	foundry: "Mono"(s)
	file: "/usr/share/fonts/msttcore/courbd.ttf"(s)
	index: 0(i)(s)
	outline: True(s)
	scalable: True(s)
	charset: 
	0000: 00000000 ffffffff ffffffff 7fffffff 00000000 ffffffff ffffffff ffffffff
        ... a bunch of stuff omitted ...
	lang: aa|af|ar|av|ay|az-az|be|bg|bi|bin|br|bs|bua|ca|ce|ch|co|cs|cy|da|de|el|en|eo|es|et|eu|fi|fj|fo|fr|fur|fy|gd|gl|gn|gv|he|ho|hr|hu|ia|ig|id|ie|ik|io|is|it|kaa|ki|kk|kl|kum|ky|la|lb|lez|lt|lv|mg|mh|mt|nb|nds|nl|nn|no|nr|nso|ny|oc|om|os|pl|pt|rm|ru|se|sel|sk|sl|sma|smj|smn|so|sq|sr|ss|st|sv|sw|tk|tl|tn|tr|ts|tt|tyv|uk|uz|vo|vot|wa|wen|wo|xh|yap|yi|zu|an|crh|csb|fil|hsb|ht|jv|kj|ku-tr|kwm|lg|li|mn-mn|ms|na|ng|pap-an|pap-aw|rn|rw|sc|sg|sn|su|za|agr|ayc|bem|dsb|lij|mfe|mhr|miq|mjw|nhn|niu|szl|tpi|unm|wae|yuw(s)
	fontversion: 184812(i)(s)
	capability: "otlayout:arab"(s)
	fontformat: "TrueType"(s)
	decorative: False(s)
	postscriptname: "CourierNewPS-BoldMT"(s)
	color: False(s)
	symbol: False(s)
	variable: False(s)
	fonthashint: True(s)
	order: 0(i)(s)
	namedinstance: False(s)
	fontwrapper: "SFNT"(s)
Why doesn't fontconfig use this font, which is a perfect match for the font in the PDF file, rather than Noto Sans Mono Regular? What is wrong with my setup and how can I fix it?
Asked by Alan Stern (1 rep)
Oct 26, 2024, 01:51 AM