From 455972425ff391f3c4ab80c689a8e9e803af8cc7 Mon Sep 17 00:00:00 2001 From: Mark Polesky Date: Sun, 12 Jul 2009 11:26:28 -0700 Subject: [PATCH] Docs: NR B.6 The Feta font: Organize glyph list. (cherry picked from commit 84177901e16ecb0ed7c4a6db12bbf47be07a4208) --- Documentation/user/notation-appendices.itely | 207 ++++++++++++++++++- input/manual/font-table.ly | 172 ++++++++++++++- 2 files changed, 374 insertions(+), 5 deletions(-) diff --git a/Documentation/user/notation-appendices.itely b/Documentation/user/notation-appendices.itely index a2b055025f..aefb97e8c8 100644 --- a/Documentation/user/notation-appendices.itely +++ b/Documentation/user/notation-appendices.itely @@ -575,7 +575,212 @@ The following symbols are available in the Emmentaler font and may be accessed directly using text markup such as @code{g^\markup @{ \musicglyph #"scripts.segno" @}}, see @ref{Formatting text}. -@lilypondfile[noindent]{font-table.ly} + +@subsection Clefs + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #clefs +@end lilypond + + +@subsection Time Signatures + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #timesig +@end lilypond + + +@subsection Numbers + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #numbers +@end lilypond + + +@subsection Accidentals + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #accidentals +@end lilypond + + +@subsection Default Noteheads + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #default-noteheads +@end lilypond + + +@subsection Special Noteheads + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #special-noteheads +@end lilypond + + +@subsection Shape-note Noteheads + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #shape-note-noteheads +@end lilypond + + +@subsection Rests + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #rests +@end lilypond + + +@subsection Flags + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #flags +@end lilypond + + +@subsection Dots + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #dots +@end lilypond + + +@subsection Dynamics + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #dynamics +@end lilypond + + +@subsection Scripts + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #scripts +@end lilypond + + +@subsection Arrowheads + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #arrowheads +@end lilypond + + +@subsection Bracket-tips + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #brackettips +@end lilypond + + +@subsection Pedal + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #pedal +@end lilypond + + +@subsection Accordion + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #accordion +@end lilypond + + +@subsection Vaticana + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #vaticana +@end lilypond + + +@subsection Medicaea + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #medicaea +@end lilypond + + +@subsection Hufnagel + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #hufnagel +@end lilypond + + +@subsection Mensural + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #mensural +@end lilypond + + +@subsection Neomensural + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #neomensural +@end lilypond + + +@subsection Petrucci + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #petrucci +@end lilypond + + +@subsection Solesmes + +@lilypond[quote] +\include "font-table.ly" +\markuplines \override-lines #'(word-space . 4) + \doc-chars #solesmes +@end lilypond @node Note head styles diff --git a/input/manual/font-table.ly b/input/manual/font-table.ly index c8e0876b5d..b468deb016 100644 --- a/input/manual/font-table.ly +++ b/input/manual/font-table.ly @@ -1,5 +1,173 @@ #(set-global-staff-size 16) +#(begin + + ;; some helper functions + + (define (filter-out pred lst) + (filter (lambda (x) (not (pred x))) lst)) + + (define (filter-out-group glyph-list substring) + (filter-out (lambda (x) (string-contains x substring)) glyph-list)) + + (define (filter-out-groups glyph-list . substrings) + (let loop ((new glyph-list) (rem substrings)) + (if (null? rem) + new + (loop (filter-out-group new (car rem)) + (cdr rem))))) + + (define (get-group glyph-list substring) + (filter (lambda (x) (string-contains x substring)) glyph-list)) + + (define glyph-list + (delete ".notdef" + (ly:otf-glyph-list (ly:system-font-load "emmentaler-20")))) + + ;;;;;;;;; + + ;; define these 3 groups first since they're + ;; harder to get with (get-groups ...) + (define numbers + '("plus" "comma" "hyphen" "period" + "zero" "one" "two" "three" "four" + "five" "six" "seven" "eight" "nine")) + + (define default-noteheads + '("noteheads.uM2" "noteheads.dM2" "noteheads.sM1" + "noteheads.s0" "noteheads.s1" "noteheads.s2")) + + (define dynamics + '("space" "f" "m" "p" "r" "s" "z")) + + ;; remove them from the glyph-list + (for-each + (lambda (x) (set! glyph-list (delete x glyph-list))) + (append numbers + default-noteheads + dynamics)) + + ;;;;;;;;; + + ;; extract ancient-music groups before extracting default + ;; accidentals, rests, etc. to prevent duplication. + (define vaticana (get-group glyph-list "vaticana")) + (define medicaea (get-group glyph-list "medicaea")) + (define hufnagel (get-group glyph-list "hufnagel")) + (define neomensural (get-group glyph-list "neomensural")) + + ;; remove neomensural before defining mensural; otherwise, searching + ;; for "mensural" would return "neomensural" matches too. + (set! glyph-list + (filter-out-groups + glyph-list + "vaticana" + "medicaea" + "hufnagel" + "neomensural")) + + ;; get the rest of the ancient-music groups + (define mensural (get-group glyph-list "mensural")) + (define petrucci (get-group glyph-list "petrucci")) + (define solesmes (get-group glyph-list "solesmes")) + + ;; remove them from the glyph-list + (set! glyph-list + (filter-out-groups + glyph-list + "mensural" + "petrucci" + "solesmes")) + + ;; This would only get "rests.2classical". + ;; We're leaving it with the other rests for now. + ;; (define classical (get-group glyph-list "classical")) + ;; (set! glyph-list (filter-out-groups glyph-list "classical")) + + ;;;;;;;;; + + ;; get everything else except noteheads. + ;; * Some accidentals contain "slash" substring, so extract + ;; "accidentals" before extracting "slash" (noteheads). + ;; * Also use "pedal." not "pedal", for example, to prevent things + ;; like "scripts.upedalheel" ending up in the "pedal." list. + ;; * This doesn't apply to the ancient stuff because searching for + ;; "vaticana." (as an example) would miss things like + ;; "dots.dotvaticana" + (define clefs (get-group glyph-list "clefs.")) + (define timesig (get-group glyph-list "timesig.")) + (define accidentals (get-group glyph-list "accidentals.")) + (define rests (get-group glyph-list "rests.")) + (define flags (get-group glyph-list "flags.")) + (define dots (get-group glyph-list "dots.")) + (define scripts (get-group glyph-list "scripts.")) + (define arrowheads (get-group glyph-list "arrowheads.")) + (define brackettips (get-group glyph-list "brackettips.")) + (define pedal (get-group glyph-list "pedal.")) + (define accordion (get-group glyph-list "accordion.")) + + ;; remove them from the glyph-list + (set! glyph-list + (filter-out-groups + glyph-list + "clefs." + "timesig." + "accidentals." + "rests." + "flags." + "dots." + "scripts." + "arrowheads." + "brackettips." + "pedal." + "accordion.")) + + ;;;;;;;;; + + ;; get special noteheads + (define cross (get-group glyph-list "cross")) + (define diamond (get-group glyph-list "diamond")) + (define harmonic (get-group glyph-list "harmonic")) + (define slash (get-group glyph-list "slash")) + (define triangle (get-group glyph-list "triangle")) + (define xcircle (get-group glyph-list "xcircle")) + + (define special-noteheads + (append cross + diamond + harmonic + slash + triangle + xcircle)) + + ;; remove special noteheads from the glyph-list + (set! glyph-list + (filter-out-groups + glyph-list + "cross" + "diamond" + "harmonic" + "slash" + "triangle" + "xcircle")) + + ;; (lazy solution) + ;; any remaining glyphs containing "noteheads." should be shape-notes. + (define shape-note-noteheads (get-group glyph-list "noteheads.")) + + ;; remove shape-note-noteheads from the glyph-list + (set! glyph-list (filter-out-group glyph-list "noteheads.")) + + ;;;;;;;;; + + ;; simple debug test for any glyphs that didn't make it. + (if #f + (if (null? glyph-list) + (format #t "No glyphs are missing from the table.\n") + (format #t "You missed these glyphs: ~a\n" glyph-list))) + +) % end of (begin ...) + \paper { %% ugh. text on toplevel is a bit broken... @@ -54,7 +222,3 @@ (cons (make-line-markup (map make-doc-char-markup head)) acc))))) (interpret-markup-list layout props (doc-chars-aux names (list)))) - -\markuplines \override-lines #'(word-space . 4) - \doc-chars #(delete ".notdef" - (ly:otf-glyph-list (ly:system-font-load "emmentaler-20"))) -- 2.39.2