diff options
author | Bertrand Bordage <bordage.bertrand@gmail.com> | 2011-09-17 18:05:04 +0200 |
---|---|---|
committer | Bertrand Bordage <bordage.bertrand@gmail.com> | 2011-09-17 18:29:06 +0200 |
commit | 0dcc93c0a5a97d048db2f7631966f41ae0059ab5 (patch) | |
tree | eca1f80f455d00aaffbd91671bde2d2171ae4ca5 | |
parent | 47f5cb2e80eca506ff4897b7628129597a60f5cb (diff) |
Improves parmesan noteheads.
* Separates parmesan-noteheads in its own sub-font.
* Adds a new Staff called PetrucciStaff (with its PetrucciVoice).
Fixes numerous issues for Petrucci/mensural/neomensural styles:
* Stems centered around the attachment point.
* Attachment point lowered.
* Adds brevis/longa/maxima pointing upward.
* Increases the hole height for brevis/longa/maxima
that are on a staff line.
* Decreases the hole height for brevis/longa/maxima
that are between staff lines.
* Shortens and thickens the stem of the longa.
* Improves the design of brevis/longa/maxima.
Improves the design of Petrucci/neomensural notes shorter than a brevis:
* Adds small curves inside the hole of
Petrucci/neomensural whole/half notes and inside harmonics.
* Reduces the height and the hole width of Petrucci whole/half notes.
* Increases the size of neomensural notes shorter than a brevis.
-rw-r--r-- | input/regression/mensural-ligatures.ly | 2 | ||||
-rw-r--r-- | input/regression/note-head-style.ly | 10 | ||||
-rw-r--r-- | lily/mensural-ligature-engraver.cc | 2 | ||||
-rw-r--r-- | lily/mensural-ligature.cc | 64 | ||||
-rw-r--r-- | lily/note-head.cc | 21 | ||||
-rw-r--r-- | lily/stem.cc | 6 | ||||
-rw-r--r-- | ly/engraver-init.ly | 57 | ||||
-rw-r--r-- | mf/GNUmakefile | 15 | ||||
-rw-r--r-- | mf/parmesan-generic.mf | 1 | ||||
-rw-r--r-- | mf/parmesan-noteheads.mf | 583 | ||||
-rw-r--r-- | scm/define-grobs.scm | 2 | ||||
-rw-r--r-- | scripts/build/gen-emmentaler-scripts.py | 1 | ||||
-rw-r--r-- | scripts/build/mf-to-table.py | 2 |
13 files changed, 485 insertions, 281 deletions
diff --git a/input/regression/mensural-ligatures.ly b/input/regression/mensural-ligatures.ly index eb87f9c6e2..779bd09350 100644 --- a/input/regression/mensural-ligatures.ly +++ b/input/regression/mensural-ligatures.ly @@ -1,4 +1,4 @@ -\version "2.14.0" +\version "2.15.12" \header { texidoc = "Mensural ligatures show different shapes, depending on the diff --git a/input/regression/note-head-style.ly b/input/regression/note-head-style.ly index 471b79d9ee..255ce007dd 100644 --- a/input/regression/note-head-style.ly +++ b/input/regression/note-head-style.ly @@ -1,13 +1,13 @@ -\version "2.14.0" +\version "2.15.12" \header{ texidoc=" -Note head shapes may be set from several choices. -The stem endings should be adjusted according to the note head. +Note head shapes may be set from several choices. +The stem endings should be adjusted according to the note head. If you want different note head styles on one stem, you must create a special context. Harmonic notes have a different shape and different -dimensions. +dimensions. " } @@ -23,7 +23,7 @@ pattern = << } \new Voice { \override Stem #'direction = #DOWN - a4 a2. a1 a\breve*1/2 a\longa*1/4 + g4 g2. g1 g\breve*1/2 g\longa*1/4 } >> diff --git a/lily/mensural-ligature-engraver.cc b/lily/mensural-ligature-engraver.cc index a51f223e18..c79da4dc96 100644 --- a/lily/mensural-ligature-engraver.cc +++ b/lily/mensural-ligature-engraver.cc @@ -339,7 +339,7 @@ Mensural_ligature_engraver::propagate_properties (Spanner *ligature, vector<Grob_info> primitives) { Real thickness - = robust_scm2double (ligature->get_property ("thickness"), 1.4); + = robust_scm2double (ligature->get_property ("thickness"), 1.3); thickness *= ligature->layout ()->get_dimension (ly_symbol2scm ("line-thickness")); diff --git a/lily/mensural-ligature.cc b/lily/mensural-ligature.cc index 4148c47199..aad23357d8 100644 --- a/lily/mensural-ligature.cc +++ b/lily/mensural-ligature.cc @@ -20,6 +20,7 @@ #include "mensural-ligature.hh" +#include "directional-element-interface.hh" #include "font-interface.hh" #include "international.hh" #include "item.hh" @@ -121,50 +122,67 @@ internal_brew_primitive (Grob *me) } int primitive = scm_to_int (primitive_scm); - Stencil out; Real thickness = 0.0; Real width = 0.0; Real flexa_width = 0.0; Real staff_space = Staff_symbol_referencer::staff_space (me); - bool const color - = me->get_property ("style") == ly_symbol2scm ("blackpetrucci"); + SCM style = me->get_property ("style"); + bool const black + = scm_is_eq (style, ly_symbol2scm ("blackpetrucci")); bool const semi - = me->get_property ("style") == ly_symbol2scm ("semipetrucci"); + = scm_is_eq (style, ly_symbol2scm ("semipetrucci")); if (primitive & MLP_ANY) { - thickness = robust_scm2double (me->get_property ("thickness"), .14); + thickness = robust_scm2double (me->get_property ("thickness"), .13); width = robust_scm2double (me->get_property ("head-width"), staff_space); } if (primitive & MLP_FLEXA) flexa_width = robust_scm2double (me->get_property ("flexa-width"), 2.0) * staff_space; + Stencil out; int const note_shape = primitive & MLP_ANY; + int duration_log = 0; + Font_metric *fm = Font_interface::get_default_font (me); + string prefix = "noteheads."; + string index; + string suffix; + string color = ""; + if (black) + color = "black"; + if (semi) + color = "semi"; switch (note_shape) { case MLP_NONE: return Lookup::blank (Box (Interval (0, 0), Interval (0, 0))); - case MLP_LONGA: // mensural brevis head with right cauda - out = Font_interface::get_default_font (me)->find_by_name - (color ? "noteheads.sM2blackmensural" - : semi ? "noteheads.sM2semimensural" : "noteheads.sM2mensural"); - break; - case MLP_BREVIS: // mensural brevis head - out = Font_interface::get_default_font (me)->find_by_name - (color ? "noteheads.sM1blackmensural" - : semi ? "noteheads.sM1semimensural" : "noteheads.sM1mensural"); - break; - case MLP_MAXIMA: // should be mensural maxima head without stem - out = Font_interface::get_default_font (me)->find_by_name - (color ? "noteheads.sM3blackligmensural" - : semi ? "noteheads.sM3semiligmensural" : "noteheads.sM3ligmensural"); + case MLP_MAXIMA: + duration_log--; + case MLP_LONGA: + duration_log--; + case MLP_BREVIS: + duration_log--; + suffix = to_string (duration_log) + color + + (duration_log == -3 ? "lig" : "") + "mensural"; + index = prefix + "s"; + out = fm->find_by_name (index + suffix); + if (out.is_empty ()) + index = prefix + "d"; + out = fm->find_by_name (index + "r" + suffix); + if (!out.is_empty () && scm_is_false ( + scm_zero_p ( + scm_modulo ( + me->get_property ("staff-position"), + scm_from_int (2))))) + index += "r"; + out = fm->find_by_name (index + suffix); break; case MLP_FLEXA_BEGIN: case MLP_FLEXA_END: - out = brew_flexa (me, color, flexa_width, thickness, + out = brew_flexa (me, black, flexa_width, thickness, note_shape == MLP_FLEXA_BEGIN); break; default: @@ -179,12 +197,12 @@ internal_brew_primitive (Grob *me) if (primitive & MLP_STEM) { // assume MLP_UP - Real y_bottom = 0.0, y_top = 3.0 * staff_space; + Real y_bottom = 0.5 * staff_space, y_top = 2.5 * staff_space; if (primitive & MLP_DOWN) { y_bottom = -y_top; - y_top = 0.0; + y_top = -0.5 * staff_space; } Interval x_extent (0, thickness); @@ -219,7 +237,7 @@ internal_brew_primitive (Grob *me) Font_interface::get_default_font (???)->find_by_name ("noteheads.s-2mensural").extent (Y_AXIS).length () * 0.5 */ - y_bottom -= 3.0 * staff_space; + y_bottom -= 2.5 * staff_space; } Interval x_extent (width - thickness, width); diff --git a/lily/note-head.cc b/lily/note-head.cc index 614ba547ad..0ddba1fe13 100644 --- a/lily/note-head.cc +++ b/lily/note-head.cc @@ -50,26 +50,31 @@ internal_print (Grob *me, string *font_char) Font_metric *fm = Font_interface::get_default_font (me); + string prefix = "noteheads."; string idx_symmetric; string idx_directed; - string idx_either; - idx_symmetric = idx_either = "noteheads.s" + suffix; - Stencil out = fm->find_by_name (idx_symmetric); + string idx_either = idx_symmetric = prefix + "s"; + Stencil out = fm->find_by_name (idx_either + suffix); if (out.is_empty ()) { - string prefix = "noteheads."; - Grob *stem = unsmob_grob (me->get_object ("stem")); Direction stem_dir = stem ? get_grob_direction (stem) : CENTER; if (stem_dir == CENTER) programming_error ("must have stem dir for note head"); - idx_directed = idx_either - = prefix + ((stem_dir == UP) ? "u" : "d") + suffix; - out = fm->find_by_name (idx_directed); + idx_either = idx_directed = prefix + ((stem_dir == UP) ? "u" : "d"); } + out = fm->find_by_name (idx_either + "r" + suffix); + if (!out.is_empty () && scm_is_false ( + scm_zero_p ( + scm_modulo (me->get_property ("staff-position"), + scm_from_int (2))))) + idx_either += "r"; + + idx_either += suffix; + out = fm->find_by_name (idx_either); if (out.is_empty ()) { me->warning (_f ("none of note heads `%s' or `%s' found", diff --git a/lily/stem.cc b/lily/stem.cc index 93ebea4c96..6575914789 100644 --- a/lily/stem.cc +++ b/lily/stem.cc @@ -849,7 +849,11 @@ Stem::offset_callback (SCM smob) Real r = real_attach; /* If not centered: correct for stem thickness. */ - if (attach) + extract_grob_set (me, "note-heads", heads); + SCM style = heads[0]->get_property ("style"); + if (attach && !scm_is_eq (style, ly_symbol2scm ("mensural")) + && !scm_is_eq (style, ly_symbol2scm ("neomensural")) + && !scm_is_eq (style, ly_symbol2scm ("petrucci"))) { Real rule_thick = thickness (me); r += -d * rule_thick * 0.5; diff --git a/ly/engraver-init.ly b/ly/engraver-init.ly index a2ba6551f6..d719d4a43f 100644 --- a/ly/engraver-init.ly +++ b/ly/engraver-init.ly @@ -543,6 +543,7 @@ automatically when an output definition (a @code{\score} or \accepts "VaticanaStaff" \accepts "GregorianTranscriptionStaff" \accepts "MensuralStaff" + \accepts "PetrucciStaff" \accepts "StaffGroup" \accepts "DrumStaff" \accepts "Lyrics" @@ -988,6 +989,7 @@ accommodated for typesetting a piece in mensural style." %% Set default head for notes outside of \[ \]. \override NoteHead #'style = #'mensural \override Rest #'style = #'mensural + \override Flag #'style = #'mensural %% There are no beams in mensural notation. autoBeaming = ##f @@ -1038,6 +1040,61 @@ accommodated for typesetting a piece in mensural style." printKeyCancellation = ##f } +\context { + \Voice + \name "PetrucciVoice" + \alias "Voice" + \description "Same as @code{Voice} context, except that it is +accommodated for typesetting a piece in Petrucci style." + + \remove "Ligature_bracket_engraver" + \consists "Mensural_ligature_engraver" + + %% Set glyph styles. + \override NoteHead #'style = #'petrucci + \override Rest #'style = #'mensural + + % Thickens and shortens stems. + \override Stem #'thickness = #1.7 + \override Stem #'length = #5 + + %% There are no beams in Petrucci notation. + autoBeaming = ##f +} + +\context { + \Staff + \name "PetrucciStaff" + \alias "Staff" + \denies "Voice" + \defaultchild "PetrucciVoice" + \accepts "PetrucciVoice" + \description "Same as @code{Staff} context, except that it is +accommodated for typesetting a piece in Petrucci style." + + \consists "Custos_engraver" + + \override StaffSymbol #'thickness = #1.3 + + %% Choose Petrucci g clef on 2nd line as default. + clefGlyph = #"clefs.petrucci.g" + middleCClefPosition = #-6 + middleCPosition = #-6 + clefPosition = #-2 + clefOctavation = #0 + + \override Custos #'style = #'mensural + \override Custos #'neutral-position = #3 + \override Custos #'neutral-direction = #DOWN + + %% Accidentals are valid only once (if the following note is different) + extraNatural = ##f + autoAccidentals = #`(Staff ,(make-accidental-rule 'same-octave 0) + ,neo-modern-accidental-rule) + autoCautionaries = #'() + printKeyCancellation = ##f +} + %% Keep the old definitions in here for compatibility (they erase previous %% settings to the corresponding context!). %% For new scores, one should simply insert the \RemoveEmptyStaves settings diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 1fa0a73790..97bcd42ef4 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -16,9 +16,10 @@ EXTRA_DIST_FILES += README mf2pt1.mp FETA_MF_FILES = $(call src-wildcard,feta[0-9]*.mf) \ $(call src-wildcard,feta-braces-[a-z].mf) \ $(call src-wildcard,feta-alphabet*[0-9].mf) \ - $(call src-wildcard,feta-notehead*[0-9].mf) \ + $(call src-wildcard,feta-noteheads*[0-9].mf) \ $(call src-wildcard,feta-flags*[0-9].mf) \ - $(call src-wildcard,parmesan[0-9]*.mf) + $(call src-wildcard,parmesan[0-9]*.mf) \ + $(call src-wildcard,parmesan-noteheads*[0-9].mf) STAFF_SIZES = 11 13 14 16 18 20 23 26 BRACES = a b c d e f g h i @@ -69,6 +70,7 @@ $(outdir)/emmentaler-%.otf\ $(outdir)/feta-flags%.pfb \ $(outdir)/feta-alphabet%.pfb \ $(outdir)/parmesan%.pfb \ + $(outdir)/parmesan-noteheads%.pfb \ $(outdir)/feta%.otf-table \ $(outdir)/feta%.otf-gtable cd $(outdir) && $(FONTFORGE) -script $(notdir $(basename ,$@).pe) @@ -84,6 +86,7 @@ $(outdir)/%.pfb: $(outdir)/%.log $(outdir)/%.otf-table: $(outdir)/%.lisp cat $< $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) \ + $(if $(findstring brace,$<),,$(subst feta,parmesan-noteheads,$<)) \ $(if $(findstring brace,$<),,$(subst feta,feta-noteheads,$<)) \ $(if $(findstring brace,$<),,$(subst feta,feta-flags,$<)) \ $(if $(findstring brace,$<),,$(subst feta,feta-alphabet,$<)) > $@ @@ -94,41 +97,49 @@ $(outdir)/feta26.otf-table: $(outdir)/feta26.lisp \ $(outdir)/feta-noteheads26.lisp \ $(outdir)/feta-flags26.lisp \ $(outdir)/parmesan26.lisp \ + $(outdir)/parmesan-noteheads26.lisp \ $(outdir)/feta-alphabet26.lisp $(outdir)/feta23.otf-table: $(outdir)/feta23.lisp \ $(outdir)/feta-noteheads23.lisp \ $(outdir)/feta-flags23.lisp \ $(outdir)/parmesan23.lisp \ + $(outdir)/parmesan-noteheads23.lisp \ $(outdir)/feta-alphabet23.lisp $(outdir)/feta20.otf-table: $(outdir)/feta20.lisp \ $(outdir)/feta-noteheads20.lisp \ $(outdir)/feta-flags20.lisp \ $(outdir)/parmesan20.lisp \ + $(outdir)/parmesan-noteheads20.lisp \ $(outdir)/feta-alphabet20.lisp $(outdir)/feta18.otf-table: $(outdir)/feta18.lisp \ $(outdir)/feta-noteheads18.lisp \ $(outdir)/feta-flags18.lisp \ $(outdir)/parmesan18.lisp \ + $(outdir)/parmesan-noteheads18.lisp \ $(outdir)/feta-alphabet18.lisp $(outdir)/feta16.otf-table: $(outdir)/feta16.lisp \ $(outdir)/feta-noteheads16.lisp \ $(outdir)/feta-flags16.lisp \ $(outdir)/parmesan16.lisp \ + $(outdir)/parmesan-noteheads16.lisp \ $(outdir)/feta-alphabet16.lisp $(outdir)/feta14.otf-table: $(outdir)/feta14.lisp \ $(outdir)/feta-noteheads14.lisp \ $(outdir)/feta-flags14.lisp \ $(outdir)/parmesan14.lisp \ + $(outdir)/parmesan-noteheads14.lisp \ $(outdir)/feta-alphabet14.lisp $(outdir)/feta13.otf-table: $(outdir)/feta13.lisp \ $(outdir)/feta-noteheads13.lisp \ $(outdir)/feta-flags13.lisp \ $(outdir)/parmesan13.lisp \ + $(outdir)/parmesan-noteheads13.lisp \ $(outdir)/feta-alphabet13.lisp $(outdir)/feta11.otf-table: $(outdir)/feta11.lisp \ $(outdir)/feta-noteheads11.lisp \ $(outdir)/feta-flags11.lisp \ $(outdir)/parmesan11.lisp \ + $(outdir)/parmesan-noteheads11.lisp \ $(outdir)/feta-alphabet11.lisp $(outdir)/emmentaler-brace.otf: $(outdir)/emmentaler-brace.subfonts \ diff --git a/mf/parmesan-generic.mf b/mf/parmesan-generic.mf index aff67dbfd8..f85cc2e132 100644 --- a/mf/parmesan-generic.mf +++ b/mf/parmesan-generic.mf @@ -38,7 +38,6 @@ font_x_height staff_space#; fet_beginfont ("parmesan", design_size, "parmesanMusic"); if test = 0: input parmesan-rests; - input parmesan-noteheads; input parmesan-clefs; input parmesan-custodes input parmesan-accidentals; diff --git a/mf/parmesan-noteheads.mf b/mf/parmesan-noteheads.mf index 130c3c50d4..c1b6e1d53a 100644 --- a/mf/parmesan-noteheads.mf +++ b/mf/parmesan-noteheads.mf @@ -6,7 +6,6 @@ % Neo-mensural heads originally by % Christian Mondrup and Mats Bengtsson % -% % LilyPond is free software: you can redistribute it and/or modify % it under the terms of the GNU General Public License as published by % the Free Software Foundation, either version 3 of the License, or @@ -57,31 +56,30 @@ define_pixels (noteheight); % % % -% MENSURAL NOTATION +% NEO-MENSURAL NOTATION % % % -def draw_neomensural_brevis (expr brevwid, open, full) = - save beamheight, head_width; - save holeheight, stem_width; - save serif_size, serif_protrude; +def draw_neomensural_brevis (expr brevwid, holeheight, open, full) = + save beamheight, head_width, head_height; + save stem_width, serif_size, serif_protrude; - head_width# = brevwid; - holeheight = 3 stafflinethickness; - stem_width = 1.4 stafflinethickness; + head_width# := brevwid; + head_height# := noteheight#; + stem_width := 1.3 linethickness; - define_pixels (head_width); + define_pixels (head_width, head_height); set_char_box (0, head_width#, - noteheight# / 2, noteheight# / 2); + head_height# / 2, head_height# / 2); - 2 beamheight + holeheight = noteheight; - serif_size = (holeheight - stafflinethickness) / 2; - serif_protrude = 1.5 serif_size; + 2 beamheight + holeheight = head_height; + serif_size := .75 linethickness; + serif_protrude := .15 head_height; z1l = (0, 0); - z2l = (0, -stafflinethickness / 2); + z2l = (0, - (holeheight - 2 serif_size) / 2); z3r = z2r + serif_size * (1, -1); y4r = y3r; x4r = head_width / 2; @@ -135,50 +133,20 @@ def draw_neomensural_brevis (expr brevwid, open, full) = enddef; -%%% This head does not seem to be used anywhere. Junk me? -- jr -def draw_neomensural_left_stemmed_head (expr wid) = - draw_neomensural_brevis (wid, true, true); - - x6 = x7 = stem_width / 2; - y6 = y5; - y7 = y5 - 2.25 staff_space; - - z17 = (x7, y7 - stem_width / 2); - - penpos6 (stem_width, 0); - penpos7 (stem_width, 0); - - fill z7l - -- z6l - -- z6r - -- z7r - .. z17 - .. cycle; - - penlabels (6, 7); - labels (17); -enddef; - - -%%% This head does not seem to be used anywhere. Junk me? -- jr -fet_beginchar ("Left stemmed notehead", "slneomensural"); - draw_neomensural_left_stemmed_head (2 staff_space#); -fet_endchar; - - % % Some sources (eg. Musix/OpusTeX) think that the appendage should be on % the left, some say right. Right wins democratically. % -def draw_neomensural_longa (expr wid) = - draw_neomensural_brevis (wid, true, true); +def draw_neomensural_longa (expr wid, holeheight, direction) = + draw_neomensural_brevis (wid, holeheight, true, true); - save theta; + save theta, dir; + dir := -direction; - x7r = head_width; - y7 = y5; - z6 - z7 = (stem_width / 2, -staff_space); - theta = angle (z6 - z7) + 90; + x7 = head_width - stem_width / 2; + y7 = dir * y5; + z6 - z7 = (stem_width / 2, -dir * staff_space); + theta = dir * angle (z6 - z7) + 90; penpos7 (stem_width, 0); penpos6 (1.2 stem_width, theta); @@ -198,43 +166,28 @@ def draw_neomensural_longa (expr wid) = enddef; -% -% En wij presenteren U: de opvolgster van Emily -% -% (ze is wel breed) -% -fet_beginchar ("Neo-mensural maxima notehead", "sM3neomensural"); - draw_neomensural_longa (2.6 staff_space#); -fet_endchar; - - -fet_beginchar ("Neo-mensural longa notehead", "sM2neomensural"); - draw_neomensural_longa (2 staff_space#); -fet_endchar; - - -fet_beginchar ("Neo-mensural brevis notehead", "sM1neomensural"); - draw_neomensural_brevis (2 staff_space#, true, true); -fet_endchar; - - def draw_neomensural_black_head (expr wid, height) = - save head_width; - save ne, nw, ne_dist, nw_dist; + save head_height, head_width, stem_width, + ne, nw, ne_dist, nw_dist, penthickness; pair ne, nw, ne_dist, nw_dist; - head_width# = wid; + penthickness# = linethickness#; + head_height# := height + penthickness#; + head_width# := wid + penthickness#; + stem_width# := 1.3 linethickness#; set_char_box (0, head_width#, - height / 2, height / 2); + head_height# / 2, head_height# / 2); charwx := head_width# / 2; - charwy := height / 2; + charwy := head_height# / 2 - 2 stem_width#; + + define_pixels (penthickness); y3 = y1 = 0; - x2 = x4 = (x1 + x3) / 2; + x2 = x4 = 1/2 [x1, x3]; - pickup pencircle scaled blot_diameter; + pickup pencircle scaled penthickness; top y2 = h; bot y4 = -d; @@ -242,22 +195,22 @@ def draw_neomensural_black_head (expr wid, height) = rt x3 = w; ne := unitvector (z2 - z1); - nw_dist := (ne rotated 90) * 0.5 blot_diameter; + nw_dist := (ne rotated 90) * penthickness / 2; nw := unitvector (z2 - z3); - ne_dist := (nw rotated -90) * 0.5 blot_diameter; - - fill lft z1{up} - .. (z1 + nw_dist){ne} - -- (z2 + nw_dist){ne} - .. top z2{right} - .. (z2 + ne_dist){-nw} - -- (z3 + ne_dist){-nw} - .. rt z3{down} - .. (z3 - nw_dist){-ne} - -- (z4 - nw_dist){-ne} - .. bot z4{left} - .. (z4 - ne_dist){nw} - -- (z1 - ne_dist){nw} + ne_dist := (nw rotated -90) * penthickness / 2; + + fill lft z1 + .. (z1 + nw_dist) + -- (z2 + nw_dist) + .. top z2 + .. (z2 + ne_dist) + -- (z3 + ne_dist) + .. rt z3 + .. (z3 - nw_dist) + -- (z4 - nw_dist) + .. bot z4 + .. (z4 - ne_dist) + -- (z1 - ne_dist) .. cycle; labels (1, 2, 3, 4); @@ -267,105 +220,171 @@ enddef; def draw_neomensural_open_head (expr wid, height)= draw_neomensural_black_head (wid, height); - save diamNW, diamSW; + save headNW, headSW, stem_width; - diamNW = length (z2 - z1) + blot_diameter; - diamSW = length (z4 - z1) + blot_diameter; + headNW = length (z2 - z1) + penthickness; + headSW = length (z4 - z1) + penthickness; + stem_width = 1.3 linethickness; save hole_widthNW, hole_widthSW; - hole_widthNW = 0.34 diamNW ; - hole_widthSW + 2.6 linethickness = diamSW; - - (z7 + z5) / 2 = (w / 2, 0); - (z8 + z6) / 2 = (w / 2, 0); - z6 - z5 = hole_widthNW * unitvector (z2 - z1); - z7 - z6 = hole_widthSW * unitvector (z4 - z1); - - unfill z5 - -- z6 - -- z7 - -- z8 - -- cycle; + hole_widthNW = .25 headNW; + hole_widthSW + 2 stem_width = headSW; + + (rt z7 + lft z5) / 2 = (w / 2, 0); + (bot z8 + top z6) / 2 = (w / 2, 0); + z6 - z5 = (hole_widthNW - penthickness) * unitvector (z2 - z1); + z7 - z6 = (hole_widthSW - penthickness) * unitvector (z4 - z1); + + unfill lft z5 + .. (z5 + nw_dist) + -- (z6 + nw_dist) + .. top z6 + .. (z6 + ne_dist) + -- (z7 + ne_dist) + .. rt z7 + .. (z7 - nw_dist) + -- (z8 - nw_dist) + .. bot z8 + .. (z8 - ne_dist) + -- (z5 - ne_dist) + .. cycle; labels (5, 6, 7, 8); enddef; % -% WL says the thin lines should be thinner. +% Neo-mensural maxima/longa/brevis % -fet_beginchar ("Harmonic notehead (Neo-mensural open)", "s0harmonic"); - draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#); - charwx := head_width#; - charwy := 0; +% En wij presenteren U: de opvolgster van Emily +% +% (ze is wel breed) +% + +save nm_maxima_width, nm_longa_width, nm_brevis_width, + nm_holeheight, nm_red_holeheight; +nm_maxima_width := 2.6 staff_space#; +nm_longa_width := 2 staff_space#; +nm_brevis_width := nm_longa_width; +nm_holeheight := 4 linethickness; +nm_red_holeheight := 2.5 linethickness; + +fet_beginchar ("Neo-mensural maxima notehead (up)", "uM3neomensural"); + draw_neomensural_longa (nm_maxima_width, nm_holeheight, 1); fet_endchar; +fet_beginchar ("Neo-mensural maxima notehead (down)", "dM3neomensural"); + draw_neomensural_longa (nm_maxima_width, nm_holeheight, -1); +fet_endchar; -fet_beginchar ("Harmonic notehead (Neo-mensural black)", "s2harmonic"); - draw_neomensural_black_head (1.3 staff_space#, 1.3 noteheight#); - charwx := head_width#; - charwy := 0; +fet_beginchar ("Neo-mensural longa notehead (up)", "uM2neomensural"); + draw_neomensural_longa (nm_longa_width, nm_holeheight, 1); fet_endchar; +fet_beginchar ("Neo-mensural longa notehead (down)", "dM2neomensural"); + draw_neomensural_longa (nm_longa_width, nm_holeheight, -1); +fet_endchar; -fet_beginchar ("Neo-mensural semibrevis head", "s0neomensural"); - draw_neomensural_open_head (staff_space#, noteheight#); +fet_beginchar ("Neo-mensural brevis notehead", "sM1neomensural"); + draw_neomensural_brevis (nm_brevis_width, nm_holeheight, true, true); +fet_endchar; + +fet_beginchar ("Neo-mensural maxima notehead (up, reduced hole)", "urM3neomensural"); + draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, 1); fet_endchar; +fet_beginchar ("Neo-mensural maxima notehead (down, reduced hole)", "drM3neomensural"); + draw_neomensural_longa (nm_maxima_width, nm_red_holeheight, -1); +fet_endchar; -fet_beginchar ("Neo-mensural minima head", "s1neomensural"); - draw_neomensural_open_head (staff_space#, noteheight#); +fet_beginchar ("Neo-mensural longa notehead (up, reduced hole)", "urM2neomensural"); + draw_neomensural_longa (nm_longa_width, nm_red_holeheight, 1); fet_endchar; +fet_beginchar ("Neo-mensural longa notehead (down, reduced hole)", "drM2neomensural"); + draw_neomensural_longa (nm_longa_width, nm_red_holeheight, -1); +fet_endchar; -fet_beginchar ("Neo-mensural semiminima head", "s2neomensural"); - draw_neomensural_black_head (staff_space#, noteheight#); +fet_beginchar ("Neo-mensural brevis notehead (reduced hole)", "srM1neomensural"); + draw_neomensural_brevis (nm_brevis_width, nm_red_holeheight, true, true); fet_endchar; -def draw_mensural_brevis (expr wid, open, full) = - % TODO. For the moment, fall back to draw_neomensural_brevis. - draw_neomensural_brevis (wid, open, full); -enddef; +% +% Neo-mensural semibrevis/minima/semiminima +% +save nm_height, nm_width; +nm_height := noteheight#; +nm_width := staff_space#; +fet_beginchar ("Neo-mensural semibrevis head", "s0neomensural"); + draw_neomensural_open_head (nm_width, nm_height); +fet_endchar; -%%% This head does not seem to be used anywhere. Junk me? -- jr -def draw_mensural_left_stemmed_head (expr wid, open, full) = - draw_mensural_brevis (wid, open, full); +fet_beginchar ("Neo-mensural minima head", "s1neomensural"); + draw_neomensural_open_head (nm_width, nm_height); +fet_endchar; - x6 = x7 = stem_width / 2; - y6 = y5; - y7 = y5 - 2.25 staff_space; +fet_beginchar ("Neo-mensural semiminima head", "s2neomensural"); + draw_neomensural_black_head (nm_width, nm_height); +fet_endchar; - z17 = (x7, y7 - stem_width / 2); +%%%%%%%% +% +% +% +% HARMONIC NOTATION +% +% +% - penpos6 (stem_width, 0); - penpos7 (stem_width, 0); +% +% WL says the thin lines should be thinner. +% - fill z7l - -- z6l - -- z6r - -- z7r - .. z17 - .. cycle; +fet_beginchar ("Harmonic notehead (Neo-mensural open)", "s0harmonic"); + draw_neomensural_open_head (1.3 staff_space#, 1.3 noteheight#); + charwx := head_width#; + charwy := 0; +fet_endchar; - penlabels (6, 7); - labels (17); +fet_beginchar ("Harmonic notehead (Neo-mensural black)", "s2harmonic"); + draw_neomensural_black_head (1.3 staff_space#, 1.3 noteheight#); + charwx := head_width#; + charwy := 0; +fet_endchar; + + +%%%%%%%% +% +% +% +% MENSURAL/PETRUCCI NOTATIONS +% +% +% + +def draw_mensural_brevis (expr wid, holeheight, open, full) = + % TODO. For the moment, fall back to draw_neomensural_brevis. + draw_neomensural_brevis (wid, holeheight, open, full); enddef; -def draw_mensural_longa (expr wid, open, full) = - draw_mensural_brevis (wid, open, full); +def draw_mensural_longa (expr wid, holeheight, open, full, direction) = + draw_mensural_brevis (wid, holeheight, open, full); + + save dir; + dir := -direction; x6 = x7 = head_width - stem_width / 2; - y6 = y5; - y7 = y5 - 2.25 staff_space; + y6 = dir * y5; + y7 = dir * y5 -1.75 dir * staff_space; - z17 = (x7, y7 - stem_width / 2); + z17 = (x7, y7 - dir * stem_width / 2); penpos6 (stem_width, 0); - penpos7 (stem_width, 0); + penpos7 (1.5 stem_width, 0); fill z7l -- z6l @@ -379,72 +398,6 @@ def draw_mensural_longa (expr wid, open, full) = enddef; -%%% This head does not seem to be used anywhere. Junk me? -- jr -fet_beginchar ("Mensural left stemmed notehead", "slmensural"); - draw_mensural_left_stemmed_head (staff_space#, true, true); -fet_endchar; - - -fet_beginchar ("Mensural maxima notehead", "sM3mensural"); - draw_mensural_longa (2.0 staff_space#, true, true); -fet_endchar; - - -fet_beginchar ("Mensural maxima notehead in ligaturae", "sM3ligmensural"); - draw_mensural_brevis (2.0 staff_space#, true, true); -fet_endchar; - - -fet_beginchar ("Mensural longa notehead", "sM2mensural"); - draw_mensural_longa (staff_space#, true, true); -fet_endchar; - - -fet_beginchar ("Mensural brevis notehead", "sM1mensural"); - draw_mensural_brevis (staff_space#, true, true); -fet_endchar; - - -fet_beginchar ("Black mensural maxima notehead", "sM3blackmensural"); - draw_mensural_longa (2.0 staff_space#, false, false); -fet_endchar; - - -fet_beginchar ("Black mensural maxima notehead in ligaturae", "sM3blackligmensural"); - draw_mensural_brevis (2.0 staff_space#, false, false); -fet_endchar; - - -fet_beginchar ("Black mensural longa notehead", "sM2blackmensural"); - draw_mensural_longa (staff_space#, false, false); -fet_endchar; - - -fet_beginchar ("Black mensural brevis notehead", "sM1blackmensural"); - draw_mensural_brevis (staff_space#, false, false); -fet_endchar; - - -fet_beginchar ("Semi-colored mensural maxima notehead", "sM3semimensural"); - draw_mensural_longa (2.0 staff_space#, true, false); -fet_endchar; - - -fet_beginchar ("Semi-colored mensural maxima notehead in ligaturae", "sM3semiligmensural"); - draw_mensural_brevis (2.0 staff_space#, true, false); -fet_endchar; - - -fet_beginchar ("Semi-colored mensural longa notehead", "sM2semimensural"); - draw_mensural_longa (staff_space#, true, false); -fet_endchar; - - -fet_beginchar ("Semi-colored mensural brevis notehead", "sM1semimensural"); - draw_mensural_brevis (staff_space#, true, false); -fet_endchar; - - def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) = save head_width, head_height; save ellipse, ellipse_r; @@ -457,7 +410,7 @@ def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) = head_height# / 2, head_height# / 2); charwx := head_width# / 2; - charwy := head_height# / 2 - linethickness#; + charwy := head_height# / 2 - 2 linethickness#; define_pixels (head_width, head_height); @@ -506,59 +459,213 @@ def draw_diamond_head (expr head_h, pen_w, pen_h, angle, open) = enddef; +% +% Mensural/Petrucci maxima/longa/brevis +% + +save m_maxima_width, m_longa_width, m_brevis_width, + m_holeheight, m_red_holeheight; +m_maxima_width := 2.0 staff_space#; +m_longa_width := staff_space#; +m_brevis_width := m_longa_width; +m_holeheight := nm_holeheight; +m_red_holeheight := nm_red_holeheight; + +fet_beginchar ("Mensural maxima notehead (up)", "uM3mensural"); + draw_mensural_longa (m_maxima_width, m_holeheight, true, true, 1); +fet_endchar; + +fet_beginchar ("Mensural maxima notehead (down)", "dM3mensural"); + draw_mensural_longa (m_maxima_width, m_holeheight, true, true, -1); +fet_endchar; + +fet_beginchar ("Mensural maxima notehead (ligature)", "sM3ligmensural"); + draw_mensural_brevis (m_maxima_width, m_holeheight, true, true); +fet_endchar; + +fet_beginchar ("Mensural longa notehead (up)", "uM2mensural"); + draw_mensural_longa (m_longa_width, m_holeheight, true, true, 1); +fet_endchar; + +fet_beginchar ("Mensural longa notehead (down)", "dM2mensural"); + draw_mensural_longa (m_longa_width, m_holeheight, true, true, -1); +fet_endchar; + +fet_beginchar ("Mensural brevis notehead", "sM1mensural"); + draw_mensural_brevis (m_brevis_width, m_holeheight, true, true); +fet_endchar; + +fet_beginchar ("Mensural maxima notehead (up, reduced hole)", "urM3mensural"); + draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, 1); +fet_endchar; + +fet_beginchar ("Mensural maxima notehead (down, reduced hole)", "drM3mensural"); + draw_mensural_longa (m_maxima_width, m_red_holeheight, true, true, -1); +fet_endchar; + +fet_beginchar ("Mensural maxima notehead (ligature, reduced hole)", "srM3ligmensural"); + draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, true); +fet_endchar; + +fet_beginchar ("Mensural longa notehead (up, reduced hole)", "urM2mensural"); + draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, 1); +fet_endchar; + +fet_beginchar ("Mensural longa notehead (down, reduced hole)", "drM2mensural"); + draw_mensural_longa (m_longa_width, m_red_holeheight, true, true, -1); +fet_endchar; + +fet_beginchar ("Mensural brevis notehead (reduced hole)", "srM1mensural"); + draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, true); +fet_endchar; + + +% +% Semi-colored mensural/Petrucci maxima/longa/brevis +% + +fet_beginchar ("Semi-colored mensural maxima notehead (up)", "uM3semimensural"); + draw_mensural_longa (m_maxima_width, m_holeheight, true, false, 1); +fet_endchar; + +fet_beginchar ("Semi-colored mensural maxima notehead (down)", "dM3semimensural"); + draw_mensural_longa (m_maxima_width, m_holeheight, true, false, -1); +fet_endchar; + +fet_beginchar ("Semi-colored mensural maxima notehead (ligature)", "sM3semiligmensural"); + draw_mensural_brevis (m_maxima_width, m_holeheight, true, false); +fet_endchar; + +fet_beginchar ("Semi-colored mensural longa notehead (up)", "uM2semimensural"); + draw_mensural_longa (m_longa_width, m_holeheight, true, false, 1); +fet_endchar; + +fet_beginchar ("Semi-colored mensural longa notehead (down)", "dM2semimensural"); + draw_mensural_longa (m_longa_width, m_holeheight, true, false, -1); +fet_endchar; + +fet_beginchar ("Semi-colored mensural brevis notehead", "sM1semimensural"); + draw_mensural_brevis (m_brevis_width, m_holeheight, true, false); +fet_endchar; + +fet_beginchar ("Semi-colored mensural maxima notehead (up, reduced hole)", "urM3semimensural"); + draw_mensural_longa (m_maxima_width, m_red_holeheight, true, false, 1); +fet_endchar; + +fet_beginchar ("Semi-colored mensural maxima notehead (down, reduced hole)", "drM3semimensural"); + draw_mensural_longa (m_maxima_width, m_red_holeheight, true, false, -1); +fet_endchar; + +fet_beginchar ("Semi-colored mensural maxima notehead (ligature, reduced hole)", "srM3semiligmensural"); + draw_mensural_brevis (m_maxima_width, m_red_holeheight, true, false); +fet_endchar; + +fet_beginchar ("Semi-colored mensural longa notehead (up, reduced hole)", "urM2semimensural"); + draw_mensural_longa (m_longa_width, m_red_holeheight, true, false, 1); +fet_endchar; + +fet_beginchar ("Semi-colored mensural longa notehead (down, reduced hole)", "drM2semimensural"); + draw_mensural_longa (m_longa_width, m_red_holeheight, true, false, -1); +fet_endchar; + +fet_beginchar ("Semi-colored mensural brevis notehead (reduced hole)", "srM1semimensural"); + draw_mensural_brevis (m_brevis_width, m_red_holeheight, true, false); +fet_endchar; + + +% +% Black mensural/Petrucci maxima/longa/brevis +% + +fet_beginchar ("Black mensural maxima notehead (up)", "uM3blackmensural"); + draw_mensural_longa (m_maxima_width, 0, false, false, 1); +fet_endchar; + +fet_beginchar ("Black mensural maxima notehead (down)", "dM3blackmensural"); + draw_mensural_longa (m_maxima_width, 0, false, false, -1); +fet_endchar; + +fet_beginchar ("Black mensural maxima notehead (ligature)", "sM3blackligmensural"); + draw_mensural_brevis (m_maxima_width, 0, false, false); +fet_endchar; + +fet_beginchar ("Black mensural longa notehead (up)", "uM2blackmensural"); + draw_mensural_longa (m_longa_width, 0, false, false, 1); +fet_endchar; + +fet_beginchar ("Black mensural longa notehead (down)", "dM2blackmensural"); + draw_mensural_longa (m_longa_width, 0, false, false, -1); +fet_endchar; + +fet_beginchar ("Black mensural brevis notehead", "sM1blackmensural"); + draw_mensural_brevis (m_brevis_width, 0, false, false); +fet_endchar; + + +% +% Mensural semibrevis/minima/semiminima +% + fet_beginchar ("Mensural semibrevis head", "s0mensural"); draw_diamond_head (staff_space#, 0.15, 0.30, 30, true); fet_endchar; - fet_beginchar ("Mensural minima head", "s1mensural"); draw_diamond_head (staff_space#, 0.15, 0.30, 30, true); fet_endchar; - fet_beginchar ("Mensural semiminima head", "s2mensural"); draw_diamond_head (staff_space#, 0.15, 0.30, 30, false); fet_endchar; +% +% Black mensural semibrevis/minima/semiminima +% + fet_beginchar ("Black mensural semibrevis head", "s0blackmensural"); draw_diamond_head (staff_space#, 0.15, 0.30, 30, false); fet_endchar; +% +% Petrucci semibrevis/minima/semiminima +% +% These values can be measured in several sources. +% I used "Modulis ex sacris literis delecti, Liber primus" +% Josquin Desprez, BNF + +save petrucci_width, petrucci_height; +petrucci_height := 1.3 noteheight#; +petrucci_width := .72 petrucci_height; + fet_beginchar ("Petrucci semibrevis head", "s0petrucci"); -% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true); - draw_neomensural_open_head (staff_space#, 1.8 staff_space#); + draw_neomensural_open_head (petrucci_width, petrucci_height); fet_endchar; - fet_beginchar ("Petrucci minima head", "s1petrucci"); -% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true); - draw_neomensural_open_head (staff_space#, 1.8 staff_space#); + draw_neomensural_open_head (petrucci_width, petrucci_height); fet_endchar; - fet_beginchar ("Petrucci semiminima head", "s2petrucci"); -% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, false); - draw_neomensural_black_head (staff_space#, 1.8 staff_space#); + draw_neomensural_black_head (petrucci_width, petrucci_height); fet_endchar; +% +% Black Petrucci semibrevis/minima/semiminima +% + fet_beginchar ("Petrucci colored semibrevis head", "s0blackpetrucci"); -% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true); - draw_neomensural_black_head (staff_space#, 1.8 staff_space#); + draw_neomensural_black_head (petrucci_width, petrucci_height); fet_endchar; - fet_beginchar ("Petrucci colored minima head", "s1blackpetrucci"); -% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true); - draw_neomensural_black_head (staff_space#, 1.8 staff_space#); + draw_neomensural_black_head (petrucci_width, petrucci_height); fet_endchar; - fet_beginchar ("Petrucci colored semiminima head", "s2blackpetrucci"); -% draw_diamond_head (1.8 staff_space#, 0.15, 0.40, 30, true); - draw_neomensural_black_head (staff_space#, 1.8 staff_space#); + draw_neomensural_black_head (petrucci_width, petrucci_height); fet_endchar; diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index d7bc5ccb00..c8764e15e0 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -1284,7 +1284,7 @@ (MensuralLigature . ( (stencil . ,ly:mensural-ligature::print) - (thickness . 1.4) + (thickness . 1.3) (meta . ((class . Spanner) (interfaces . (font-interface mensural-ligature-interface)))))) diff --git a/scripts/build/gen-emmentaler-scripts.py b/scripts/build/gen-emmentaler-scripts.py index 8d7d08b214..dafb50c0ef 100644 --- a/scripts/build/gen-emmentaler-scripts.py +++ b/scripts/build/gen-emmentaler-scripts.py @@ -44,6 +44,7 @@ MergeFonts("feta%(design_size)d.pfb"); MergeFonts("feta-noteheads%(design_size)d.pfb"); MergeFonts("feta-flags%(design_size)d.pfb"); MergeFonts("parmesan%(design_size)d.pfb"); +MergeFonts("parmesan-noteheads%(design_size)d.pfb"); # load nummer/din after setting PUA. i = 0; diff --git a/scripts/build/mf-to-table.py b/scripts/build/mf-to-table.py index 4f8f92dbc5..8ffcde983b 100644 --- a/scripts/build/mf-to-table.py +++ b/scripts/build/mf-to-table.py @@ -242,6 +242,8 @@ for filenm in files: enc_name = 'FetaEncoding' if re.search ('parmesan', filenm): enc_name = 'ParmesanEncoding' + elif re.search ('parmesan-noteheads', filenm): + enc_name = 'ParmesanNoteheadsEncoding' elif re.search ('feta-noteheads', filenm): enc_name = 'FetaNoteheadsEncoding' elif re.search ('feta-flags', filenm): |