lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

How to determine if a font is a fallback font?


From: Urs Liska
Subject: How to determine if a font is a fallback font?
Date: Tue, 28 Apr 2015 09:23:51 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

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.

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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]