Kees van den Doel wrote:
Hi Folks,

I made an init file "persian.ly" with support for Persian accidentals and scale 
signatures.
The only thing missing is correct glyphs for koron and sori. I include it below.

You don't want glyphs. You want strings, because we're not expecting a music font, so the mechanism for glyphs won't work.

This can stay here:

% Define accidental symbols. % Really need to have accidentals.koron and accidentals.sori

persianGlyphs = #`((-3/10 . "accidentals.mirroredflat")
       (1/5 . "accidentals.sharp.slashslash.stem")
       (0 . "accidentals.natural")
       (1/2 . "accidentals.sharp")
       (-1/2 . "accidentals.flat")
       (-1/10 . "")
       (-3/5 . "")
       (-1 . "accidentals.flatflat")
       ( 1 . "accidentals.doublesharp")
)

Then add:

persianStrings = #`((-3/10 . "???")
       (1/5 . "???")
...
)

where the ??? are replaced with the UTF-8 strings of the symbols you want. Then in "\context" add

\override Accidental #'stencil = #ly:text-interface::print
\override Accidental #'text = #accidental-text
\override Accidental #'font-name = #"???"
\override Accidental #'font-size = #?
\override Accidental #'text = #(lambda (grob)
        (cdr (assoc (ly:grob-property grob 'alteration)
                 persianStrings)))
\override Accidental #'X-extent = #(0 . 1)
\override Accidental #'Y-extent = #(-1 . 1)

and so on for KeySignature and whatever else you want to use the new symbols. The font name is what Pango uses to find the new font and you may need to adjust the font size. For the best results use lookups for the X- and Y-extents as well.

Something I'm doing is causing a bug on another system, but this works for me.


                         Graham


_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to