lilypond-user
[Top][All Lists]
Advanced

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

Re: How to determine if a font is a fallback font?


From: Thomas Morley
Subject: Re: How to determine if a font is a fallback font?
Date: Tue, 28 Apr 2015 10:07:25 +0200

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.

Cheers,
  Harm

Btw, none of the fallbacks in the file you sent privately works for me.

>
> 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



reply via email to

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