[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Changing Text Fonts
From: |
Werner LEMBERG |
Subject: |
Re: Changing Text Fonts |
Date: |
Sun, 25 Jan 2015 06:20:59 +0100 (CET) |
>> The example below does not work
>
> To my knowledge, Lilypond has difficulty — i.e., fails completely —
> with older Mac OS True Type (.ttf) fonts, and Baghdad is one of
> those [at least on my machine].
Being an old Mac OS TTF per se is not a problem. A font must have a
Unicode cmap so that lilypond can use it – to be more precise,
FreeType must be able to synthesize a Unicode cmap. The library does
this for easy cases like Mac Roman encoding, IIRC, but it doesn't
apply complicated encoding mappings.
In case of Baghdad.ttf (which I just downloaded from the internet),
the font is lying. While it has a Unicode cmap, it is completely
wrong, mapping the Arabic characters to Latin code points. Putting
the font into a place where fontconfig can find it, I get the attached
result while compiling the following
\header {
title = \markup {
\override #'(font-name . "Baghdad")
"This my Masterpiece"
}
}
{ c'' }
>> Attached is a picture of the Font Book application on my Mac. How
>> do I know the exact name of the font-name that should be used in
>> the ly file? Could this differ from what I see in the FontBook?
>
> The name in the “Full Name” field of FontBook is, I believe, the one
> you should use.
In case of doubt, call
lilypond -dshow-available-fonts 2>&1 | less
on the command line and search for the font file. For example, on my
GNU/Linux box, I get
family Baghdad
Baghdad:style=Regular
If you want more precise information, try
fc-list | less
This time, I get
/home/wl/.fonts/Baghdad.ttf: Baghdad:style=Regular
BTW, the above output also shows the directories searched by
fontconfig.
>> Also, I usually like to increase the kerning of the Title. Is this
>> possible?
>
> I don’t believe so.
You probably don't mean kerning but the spacing between the glyphs in
a title, right? You can manually insert small horizontal whitespace
between the title characters, using e.g.
H = \markup { \hspace #0.5 }
{
c''^\markup { foo }
c''^\markup { \concat { f \H o \H o } }
}
Werner