[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Arbitrary accidental glyphs
From: |
Graham Breed |
Subject: |
Re: Arbitrary accidental glyphs |
Date: |
Sun, 20 Jul 2008 06:58:24 +0800 |
User-agent: |
Thunderbird 2.0.0.14 (X11/20080505) |
Han-Wen Nienhuys wrote:
Looking a bit more into this, the memories of why this is so
complicated come back.
In paper.scm, the default fonts are setup in
(define-public (layout-set-absolute-staff-size-in-module module staff-height)
this sets a variable 'fonts, which is a Font-tree-element (see
scm/font.scm), a tree defining how to select a font using font-shape,
font-family, etc.
Okay. How do I get at the staff-height for a function that
isn't being called from this one? Well, minor detail, let's
go on...
When font-encoding is fetaMusic, the result is that one of the
emmentaler OTF files is selected. If you want to override this, you
would have to add your font similar to the mechanism for emmentaler,
but using a different value for font-encoding. You should probably do
this first inside font.scm, and if you can get this working, you can
select your custom font by doing
\override Accidental #'font-encoding = #'Sagitarius
When it works, try moving the function you added to a .ly, doing
Here's the function I added:
(define-public (add-music-font encoding-name font staff-height)
(add-font
(make-font-tree-node 'font-encoding encoding-name)
(list (cons 'font-encoding encoding-name))
(cons staff-height font)))
\paper {
#(add-music-font 'Sagitarius (ly:font-load "sagitarius") fonts)
}
and export enough variables to make it work in the .ly version too.
What I actually do then is
\paper {
#(add-music-font 'sagittal (ly:font-load "Sagittal") 100)
}
I added fonts called Sagittal.otf and Sagittal.pfb to the
relevant folders. The console output includes this:
[ET22-sagittal.ly[/home/graham/usr/share/lilypond/2.11.52/fonts/otf/Sagittal.otf
programming error: Free type error: SFNT font table missing
continuing, cross fingers
programming error: Free type error: SFNT font table missing
continuing, cross fingers
programming error: Free type error: SFNT font table missing
continuing, cross fingers
]]
Is that a problem with the font or is there something else I
have to do? I think it's important because
Open_type_font::name_to_index is now returning a fail value
(-1) for everything in Sagittal. That's pleasantly
different to the original problem where
Pango_font::name_to_index did the same thing. I'm not sure
if Pango was returning the Postscript or OpenType font
before but the glyph names should be the same ... if that's
the problem.
At least we know it's loaded an OpenType font through the
correct mechanism now.
Good luck.
Thank you!
Graham