Re: White diamond, black diamond, and possible small sponsorship?
On 1/23/07, v!ctor [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Trevor, I suppose you thought of just changing the size of the black diamond, like this: %%% BEGIN %%% %\version 2.11.7 \layout { ragged-right = ##t } \new Staff { \override NoteHead #'font-size = #3 \once \override NoteHead #'style = #'harmonic c'4 \override NoteHead #'font-size = #6 \once \set shapeNoteStyles = ##(mi mi mi mi mi mi mi) c'4 } %%% END %%% Obviously, the shape is still not the same although the sizes now match. You can also try something like this, although it might seem a bit too hacky: %%% BEGIN %%% %\version 2.11.7 \layout { ragged-right = ##t } \new Staff { \override NoteHead #'font-size = #3 \once \override NoteHead #'style = #'harmonic c'4 \once \override NoteHead #'stencil = #ly:text-interface::print \once \override NoteHead #'text = #(markup #:combine #:musicglyph noteheads.s0harmonic #:fontsize 2 #:musicglyph noteheads.s2neomensural) c'4 } %%% END %%% Notice how, while the diamonds are now identical in shape, the stem of the black diamond does not reach its correct position. Not sure exactly why, but I guess you would have to make a \once tweak of this too. Let me know if you find a better way. Hi Victor, As it turns out, Max opened up FontForge and made the new glyph this week. It works great so long as you have Max's new font folder, so I'm urging him to mail -devel for inclusion in the standard distribution. (And stem alignment does work correctly with Max's new glyph, too.) -- Trevor Bača [EMAIL PROTECTED] ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Questions regarding creation of a new glyph (was: White diamond, black diamond, and possible small sponsorship?)
Hi everyone, a couple of days ago Trevor asked for help with regard to a certain special note head (a black diamond of 'harmonic' style, where a white one already existed). Since Trevor sent his initial request on the lilypond-user list but I feel that -devel is the right place to get the information I need, I'm sending this to both lists (just in case other users who don't read -devel are interested, too). I just saw that there has been another reply which tries to achieve the wanted output with syntax tweaks. This was my first approach, too -- an unsuccessful one, though. Since for some time I have been looking for an opportunity to dive into lilypond's internals and get acquainted a bit with the source code, I decided to check out a git version and start experimenting, trying to make sophisticated guesses. Contrary to my expectations :), I finally succeeded to create the glyph as requested, but there are still some open questions and since I only started to scratch the surface of some of the topics involved, I would be grateful for some advice. Be warned that I am a complete beginner with regard to font issues, so all of my insights are gained from reading the source and trying to make sense of it. However, if everything is OK (or if I am told what I did wrong) and there is interest I can easily provide a patch to include the black diamond in future releases. On to my questions: 1) Is it correct that all I need to do in order to create a new glyph is to modify the metafont source file of the corresponding font? That is, are all the other files (*.otf, *.svg, etc.) created during the compilation process of lilypond? (My experiments seem to indicate this). 2) The definition of the existing white diamond-shaped head is contained in the file 'mf/parmesan-heads.mf'. What I basically did was copy the existing definition and change the description of the glyph, its name (I chose s2harmonic -- see question 3+4 below) and the function which draws it. Correct so far? Inspecting the other font formats I saw that the svg files sometimes contain unicode numbers of the glyphs (although not for the parmesan font, as it seems). Do I have to take care of that and other related issues or can I ignore these aspects and rely on the compilation process to sort it all out? 3) After compiling the source it is possible to use the new glyph by explicitly setting \once \override NoteHead #'style = #'harmonic \once \override NoteHead #'glyph-name = #'2harmonic . (BTW, the definition in mf/parmesan-heads.mf is 's2harmonic' -- what causes the leading 's' to be inserted in the name?). Now with neomensural instead of harmonic style, lilypond prints the black notehead automatically when the note has quarter duration. This automatic recognition of the correct head does not work yet with the new harmonic glyph. Which further changes in the source are required to implement this? I hoped that the digit 2 in the name would be enough to tell lilypond to use the black head (similar to the neomensural case), but I was wrong. Any hints? If this behaviour is not related to the glyph name, would it be better to rename it to s1harmonic instead (because s0harmonic already exists) or even to something completey different? 4) In the *.mf file there already exists a function called draw_neomensural_black_head which draws a black diamond of the required shape. It is called when drawing the open diamond (the black head is overwritten with a smaller white one to create the open notehead). Since the functionality is already there -- is there a good reason why the black diamond is not yet included as a separate glyph in the font? I have no experience whatsoever with ancient or other special noteheads so maybe it doesn't make sense to have a black diamond in the 'harmonic' style. Should a new style containing this single glyph be created? If so, what would be a good name? 5) IIRC, some time ago there were other questions related to fonts which mentioned the inadequacy of certain formats and suggested a conversion of the fonts. Since font issues are still a rather closed book to me -- is the *.mf file the right place at all to make changes? Does it maybe make more sense to modify other formats? If so, how? (I first tried to use fontforge but did not really manage to correctly export the file into the various formats, that's why I decided to dive into the metafont source directly). 6) Possibly this is related to question 5: After compiling my modified git version of lilypond and processing a sample *.ly file, all the glyphs (including, e.g., clefs) seem to have rather rough outlines when viewing the *.pdf output with xpdf (on Debian Linux). Increasing the zoom level smoothens them out a bit, which indicates that it is probably only a viewing problem (in addition, they appear perfectly smooth in Acrobat Reader). But since the font files shipped with the official binary do not show this behaviour -- am I missing something? Is there another
Re: Questions regarding creation of a new glyph (was: White diamond, black diamond, and possible small sponsorship?)
Maximilian Albert escreveu: On to my questions: 1) Is it correct that all I need to do in order to create a new glyph is to modify the metafont source file of the corresponding font? That is, are all the other files (*.otf, *.svg, etc.) created during the compilation process of lilypond? (My experiments seem to indicate this). correct Inspecting the other font formats I saw that the svg files sometimes contain unicode numbers of the glyphs (although not for the parmesan font, as it seems). Do I have to take care of that and other related issues or can I ignore these aspects and rely on the compilation process to sort it all out? Ignore, just copy the pattern of the other glyphs. \once \override NoteHead #'style = #'harmonic \once \override NoteHead #'glyph-name = #'2harmonic if you set glyph-name, style is no longer necessary. (BTW, the definition in mf/parmesan-heads.mf is 's2harmonic' -- what causes the leading 's' to be inserted in the name?). s is for symmetric. Some heads have u and d forms (upstem, downstem). Now with neomensural instead of harmonic style, lilypond prints the black notehead automatically when the note has quarter duration. This automatic recognition of the correct head does not work yet with the new harmonic glyph. Which further changes in the source are required to implement this? I hoped that the digit 2 in the name would be enough to tell lilypond to use the black head (similar to the neomensural case), but I was wrong. Any hints? If this behaviour is not related to see scm/output-lib.scm, function note-head::calc-glyph-name. Also, see define-grobs.scm , grob NoteHead to see how all these functions work together. 4) In the *.mf file there already exists a function called draw_neomensural_black_head which draws a black diamond of the required shape. It is called when drawing the open diamond (the black head is overwritten with a smaller white one to create the open notehead). Since the functionality is already there -- is there a good reason why the black diamond is not yet included as a separate glyph in A harmonic head is slightly bigger so it protudes through the staff lines, if printed in a space. AFAIK, they only exist in the open form, and Trevor's use of the black form is not canonical. 5) IIRC, some time ago there were other questions related to fonts which mentioned the inadequacy of certain formats and suggested a conversion of the fonts. Since font issues are still a rather closed book to me -- is the *.mf file the right place at all to make changes? yes, but do take the hints in mf/README at heart. 6) Possibly this is related to question 5: After compiling my modified git version of lilypond and processing a sample *.ly file, all the glyphs (including, e.g., clefs) seem to have rather rough outlines when viewing the *.pdf output with xpdf (on Debian Linux). Increasing the zoom level smoothens them out a bit, which indicates that it is probably only a viewing problem (in addition, they appear perfectly smooth in Acrobat Reader). But since the font files shipped with the official binary do not show this behaviour -- am I missing something? Is there another way to compile the fonts which makes them behave more nicely? It might be related to the version of fontforge that you use. -- Han-Wen Nienhuys - [EMAIL PROTECTED] - http://www.xs4all.nl/~hanwen LilyPond Software Design -- Code for Music Notation http://www.lilypond-design.com ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
Re: White diamond, black diamond, and possible small sponsorship?
Trevor, I suppose you thought of just changing the size of the black diamond, like this: %%% BEGIN %%% %\version 2.11.7 \layout { ragged-right = ##t } \new Staff { \override NoteHead #'font-size = #3 \once \override NoteHead #'style = #'harmonic c'4 \override NoteHead #'font-size = #6 \once \set shapeNoteStyles = ##(mi mi mi mi mi mi mi) c'4 } %%% END %%% Obviously, the shape is still not the same although the sizes now match. You can also try something like this, although it might seem a bit too hacky: %%% BEGIN %%% %\version 2.11.7 \layout { ragged-right = ##t } \new Staff { \override NoteHead #'font-size = #3 \once \override NoteHead #'style = #'harmonic c'4 \once \override NoteHead #'stencil = #ly:text-interface::print \once \override NoteHead #'text = #(markup #:combine #:musicglyph noteheads.s0harmonic #:fontsize 2 #:musicglyph noteheads.s2neomensural) c'4 } %%% END %%% Notice how, while the diamonds are now identical in shape, the stem of the black diamond does not reach its correct position. Not sure exactly why, but I guess you would have to make a \once tweak of this too. Let me know if you find a better way. Victor. On 1/19/07, Trevor Bača [EMAIL PROTECTED] wrote: Hi, The black diamond shape notehead carries a different shape than the white diamond harmonic notehead. %%% BEGIN %%% \version 2.11.7 \layout { ragged-right = ##t } \new Staff { \override NoteHead #'font-size = #3 \once \override NoteHead #'style = #'harmonic c'4 \once \set shapeNoteStyles = ##(mi mi mi mi mi mi mi) c'4 } %%% END %%% Does anyone know a way to get a black diamond notehead that carries exactly the same shape as the white diamond harmonic (a filled harmonic, in other words)? I've poked around and don't believe this is currently possible. If I'm correct and it is, in fact, not currently possible, would anyone be interested in creating such a notehead? I'd be willing to put a small bounty of some euros on it. (Seems like making this filled harmonic glyph might be a fun side project for somebody who's been looking for an excuse to dive in and modify the source, and therefore might not distract Han-Wen, which is another bonus.) If interested, please let me know ... -- Trevor Bača [EMAIL PROTECTED] ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user
White diamond, black diamond, and possible small sponsorship?
Hi, The black diamond shape notehead carries a different shape than the white diamond harmonic notehead. %%% BEGIN %%% \version 2.11.7 \layout { ragged-right = ##t } \new Staff { \override NoteHead #'font-size = #3 \once \override NoteHead #'style = #'harmonic c'4 \once \set shapeNoteStyles = ##(mi mi mi mi mi mi mi) c'4 } %%% END %%% Does anyone know a way to get a black diamond notehead that carries exactly the same shape as the white diamond harmonic (a filled harmonic, in other words)? I've poked around and don't believe this is currently possible. If I'm correct and it is, in fact, not currently possible, would anyone be interested in creating such a notehead? I'd be willing to put a small bounty of some euros on it. (Seems like making this filled harmonic glyph might be a fun side project for somebody who's been looking for an excuse to dive in and modify the source, and therefore might not distract Han-Wen, which is another bonus.) If interested, please let me know ... -- Trevor Bača [EMAIL PROTECTED] ___ lilypond-user mailing list lilypond-user@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-user