> On Dec 1, 2015, at 5:38 AM, Urs Liska <u...@openlilylib.org> wrote: > > You have a rather small number of individual components (vertical, > horizontal and diagonal elements) that can all represented by a > postscript path. A function should be able to determine from the input > ratio which of these elements have to be combined and then generate the > appropriate path and eventually use that to replace Accidental.stencil.
Yep, sounds like a matter of creating path stencils for each component part, as static unchanging building blocks, and then have a function that dynamically combines these stencils to produce the accidental needed for a given note. Combining stencils in different ways is simpler than producing a path on the fly, so that will make things easier. I have done this kind of thing by creating an SVG with Inkscape and then opening the SVG file in a text editor where I can copy the path coordinates. Then I can paste those coordinates into a LilyPond include file, in a procedure that produces a path stencil. (With some tedious back and forth to get the scaling right.) Then that stencil is available to use by LilyPond. For Clairnote music notation I have code that replaces accidental signs with custom accidentals[0] that might be helpful to look at. It combines a dot stencil with a line stencil, so no paths are needed. However, I also use path coordinates to create whole note glyphs, so there’s an example of that as well. That code is available here: http://clairnote.org/software/ [0] http://clairnote.org/accidental-signs/ > How these paths can be created is something I won't be of much help, but > if you get to the point where you have very concrete necessities you'll > surely be able to get help by others with more experience in that. There are several ways to create a stencil from a path. Search the LSR for “path” for two different ways in addition to the \path markup command. The most recent development version of LilyPond (2.19.x) also has a make-path-stencil function that combines the benefits of the two ways documented on the LSR without their drawbacks, so I prefer to use that unless I’m supporting LilyPond 2.18. -Paul _______________________________________________ lilypond-user mailing list lilypond-user@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-user