|
From: | Urs Liska |
Subject: | Re: How to determine if a font is a fallback font? |
Date: | Tue, 28 Apr 2015 10:12:57 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 |
Am 28.04.2015 um 10:07 schrieb Thomas Morley:
2015-04-28 9:23 GMT+02:00 Urs Liska <address@hidden>:Hi all, #(ly:font-config-get-font-file "Emmentaler-13") gives me the full path to the font file used by the "Emmentaler-13" font. If I use a non-existent font name, say #(ly:font-config-get-font-file "SomeFont") I get a reference to emmentaler-11.otf, which is obviously used as fallback font by fontconfig. However, a Windows user reported that the same references "marlett.ttf" on his system.On my very old and outdated Ubuntu-system #(display (ly:font-config-get-font-file "emmentaler-13.otf")) in a lily-file returns: /home/harm/.fonts/wds052801.ttf which is surely not what I'd expect.
And what about #(display (ly:font-config-get-font-file "Emmentaler-13")) ?(it expects the font name and not the file name (actually that's the point of the function))
But it shows that my assumption was correct that the approach isn't reliably enough.
What's the output of #(display (ly:ttf-ps-name (ly:font-config-get-font-file "Emmentaler-13"))) ? Urs
Cheers, Harm Btw, none of the fallbacks in the file you sent privately works for me.
Which is clear from the above.
I wanted to use this approach to determine if a requested font exists on the user's system, but now I'm not sure anymore if that's a reliable approach. Of course I can simply add the check for marlett.ttf, but I have the impression that the returned fallback font isn't hard-coded but can vary with the user's installation or font availability. So: 1) Does anyone know of another approach to determine if a given font is visible to fontconfig? (I can't check for the file name because this doesn't necessarily match the font name) or 2) Is there a function to retrieve the "font name" from a given file name? It would be a viable approach if I could compare the result of that request with the original font name. TIA Urs _______________________________________________ lilypond-user mailing list address@hidden https://lists.gnu.org/mailman/listinfo/lilypond-user
[Prev in Thread] | Current Thread | [Next in Thread] |