lilypond-devel
[Top][All Lists]
Advanced

[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 03:01:31 +0800
User-agent: Thunderbird 2.0.0.14 (X11/20080505)

Han-Wen Nienhuys wrote:
Ah, ok.  The problem is that the Pango font is 'virtual': pango
decomposes the string into sections each of which can use a different
font.

Oh, it is?  What do we do about it?

I found this in a file which I did get to work (in the sense of producing Sagittal symbols, not making any sense as notation) which is the same kind of thing:

/Sagittal 4.21679688 output-scale div selectfont
0.9902 0.0000 /boathookandarcdoubledown
1.0584 0.0000 /doubleleftboathookdoubledown
1.0584 0.0000 /arcandbarbdown
0.7512 0.0000 /leftscrollandboathookdoubledown
0.7512 0.0000 /leftarcandbarbdown
0.5121 0.0000 /space
0.7512 0.0000 /leftscrollandboathookdoubledown
1.0584 0.0000 /doubleleftboathookdoubledown
1.0584 0.0000 /doubleleftboathookdoubledown
0.8194 0.0000 /leftarcdoubledown
0.7512 0.0000 /rightarcdoubledown
11 print_glyphs

There's a load of other code in there to define the font.

This is the LilyPond file behind it (based on an example from the list, and obviously it won't work without the Sagittal font installed):

\version "2.11.52"
\relative c'{
\override Accidental #'font-name = #"Sagittal"
b
\once \override Accidental #'stencil = #ly:text-interface::print
\once \override Accidental #'text = \markup{"hello world"}
cis d e f g f e d c1 }


              Graham


On Sat, Jul 19, 2008 at 10:51 AM, Graham Breed <address@hidden> wrote:
Han-Wen Nienhuys wrote:
On Thu, Jul 17, 2008 at 11:10 AM, Graham Breed <address@hidden> wrote:

    \override Accidental #'font-name = #"Sagittal"

in a script, and characters from Accidental's glyph-name-alist can come
from
Sagittal.  The problem is that LilyPond can't retrieve named glyphs from
a
non-standard font.
that's wierd.  Lily basically outputs

 /glyphname showglyph

Postscript code, so it should work for any font that has glyph names.
The code is (scm/output-ps.scm)


(define (named-glyph font glyph)
 (ly:format "~a /~a glyphshow " ;;Why is there a space at the end?
            (ps-font-command font)
            glyph))


So it's also trying to output a description of the font, which expands to
include the filename, and a Pango_font doesn't have one.  Changing it to


(define (named-glyph font glyph)
 (ly:format "/~a glyphshow" glyph))


means no error gets generated but the output has things like this:


/noteheads.s2 showglyph
458.9567 -744.0706 moveto
0.0500 3.2322 -0.0250 -2.2722 0.0800 draw_round_box
9.3556 -746.5706 moveto
/sharp showglyph


It's trying to print the accidentals with the same font as the note heads.
 The result is garbage.  So how do we tell it to use the Pango_font?


                 Graham









reply via email to

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