lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Arbitrary accidental glyphs


From: Graham Breed
Subject: Arbitrary accidental glyphs
Date: Thu, 17 Jul 2008 22:10:11 +0800
User-agent: Thunderbird 2.0.0.14 (X11/20080505)

I'm trying to get accidentals using glyphs that don't come from the standard font. This is in order to get arbitrary microtonal accidentals, particularly using Sagittal. Torsten Anders has looked at this before and I'm picking up on his work.

The idea is that you install the Sagittal font from here:

http://users.bigpond.net.au/d.keenan/sagittal/

stick

      \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. I've tried hacking the code to use numbered glyphs instead, but that didn't work. Neither did loading the Sagittal font using the same method as the music font.

Now I'm trying to get it to work in the obvious way. I've copied these methods from Open_type_font to Pango_font:

Box get_indexed_char (size_t) const;
size_t name_to_index (string) const;

And my test script fails like this:

Backtrace:
In unknown file:
   ?:  9* [#<procedure {#f} ()>]
In /home/graham/usr/share/lilypond/2.11.52/scm/lily.scm:
 734: 10* [ly:parse-file "ET22-sagittal.ly"]
In /home/graham/usr/share/lilypond/2.11.52/ly/init.ly:
  38: 11* (if (or # output-empty-score-list) (# parser #))
  39: 12  [print-book-with-defaults # #]
In /home/graham/usr/share/lilypond/2.11.52/scm/lily-library.scm:
    ...
135: 13 [ly:book-process #<Book> #< Output_def> #< Output_def> "ET22-sagittal"]
In unknown file:
?: 14* [output-framework "ET22-sagittal" #<Paper_book> (#<module b6cb5cd0>) ()]
In /home/graham/usr/share/lilypond/2.11.52/scm/framework-ps.scm:
 460: 15* (let* (# # # # ...) (if # #) (if # #) ...)
 491: 16* [for-each #<procedure {#f} (page)> (#<Stencil  >)]
In unknown file:
   ?: 17* [#<procedure {#f} (page)> #<Stencil  >]
In /home/graham/usr/share/lilypond/2.11.52/scm/framework-ps.scm:
 494: 18* [dump-page #<Paper_outputter> #<Stencil  > 1 1 {#f}]
120: 19* [ly:outputter-dump-stencil #<Paper_outputter> #<Stencil >]
In unknown file:
   ?: 20* [placebox 91.5904809657505 -20.5881212598425 ...
   ?: 21* [named-glyph #<Font_metric (#f . 1.0)> "flat"]
In /home/graham/usr/share/lilypond/2.11.52/scm/output-ps.scm:
 185: 22  [ly:format "~a /~a glyphshow " ...
 186: 23* [ps-font-command #<Font_metric (#f . 1.0)>]
In /home/graham/usr/share/lilypond/2.11.52/scm/framework-ps.scm:
  28: 24  (let* (# #) (string-append "magfont" # "m" ...))
  31: 25  [string-append "magfont" ...
  33: 26* [ly:string-substitute " " "_" ...
  35: 27* [ly:string-substitute "/" "_" ...
  37: 28* [ly:string-substitute "%" "_" {#f}]

So it looks like the Scheme isn't getting something it wants from the Font_metric object. I haven't worked out what yet.

Any help on this would be welcome! I don't want to replace the Stencil in Scheme unless there's no other way. I'd obviously prefer a solution that can be merged into the official distribution so that I don't have to maintain a patched version. Allowing the music font to be overridden is the best way because it might be useful for other things as well.


                   Graham




reply via email to

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