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: Urs Liska
Subject: Re: How to determine if a font is a fallback font?
Date: Wed, 29 Apr 2015 09:42:12 +0200
User-agent: Mozilla/5.0 (X11; Linux i686; rv:31.0) Gecko/20100101 Thunderbird/31.6.0



Am 29.04.2015 um 02:14 schrieb David Nalesnik:
I tried this out on my VM (Ubuntu 10.04.4 -- yes, I need to update to the most recent LilyDev...)

Should it work for any font that's listed by ly:font-config-display-fonts?  It works for most of the names I've tried, though not all.  For example. "Kedage" returns #f.

AFAICS it should, What is the "font name" of Kedage?

Here is a part of the output of (display (ly:font-config-display-fonts):

family DejaVu Sans Mono
 DejaVu Sans Mono:style=Book
family DejaVu Sans Mono
 DejaVu Sans Mono:style=Bold
family Century Schoolbook L
 Century Schoolbook L:style=BoldItalic
family Liberation Serif
 Liberation Serif:style=Italic
family Umpush
 Umpush:style=BoldOblique
family Kedage
 Kedage:style=Normal
family Lohit Bengali
 Lohit Bengali:style=Regular

I simply used the family name, so
\fontExists "Kedage"

Doing so with this list, all return #t except Kedage and Umpush.

Both

(display (ly:font-config-get-font-file "Kedage"))

and

(display (ly:font-config-get-font-file "Umpush"))

return

/usr/share/fonts/truetype/thai/TlwgTypo.ttf

so I presume I am using the right name for the two fonts.

 
You could try out with my version from the second-to-last post, which returns the "plain" result of the fontconfig lookup.

OK, here with both Umpush and Kedage I get
Tlwg Typo

\fontExists "Tlwg Typo"
does in fact return #t with the later patch.

but then one of the entries from ly:font-config-display-fonts is

family Tlwg Typo
 Tlwg Typo:style=Oblique

...so I'm pretty sure I understand nothing of what is going on here :(


I assume this has to do with fontconfig not handling these special fonts.

I just installed the  ttf-thai-tlwg package (which installs fonts in a slightly different location on my system) which contains Umpush and the Tlwg fonts but no Kedage. Umpush and Tlwg Typo are shown in ly:font-config-display-fonts;

family Umpush
 Umpush:style=LightOblique

family Tlwg Typo
 Tlwg Typo:style=Bold

while ly:font-config-get-font-file "Umpush" returns the fallback file, in my case the emmentaler-11 font file.

fc-match (on the command line) correctly locates both fonts.

I conclude that the lookup function used in ly:font-config-get-font-file is not absolutely correct, but has never been so.
So I tend to ignore this for now and open an issue about it so it could be handled separately *if* someone has the knowledge to do so.

Urs

reply via email to

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