From 84a060da34d365db97ceade2d87f7bc961b9b7b7 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Fri, 5 Mar 2010 02:36:32 -0300 Subject: [PATCH] * Unify fetaDynamic and fetaNumber into one fetaText encoding * Load fetaText through the emmentaler OTF font. * Put Emmentaler design size into the font name. * Stop installing PFB files. --- Documentation/notation/text.itely | 6 ++---- lily/font-config.cc | 1 - lily/time-signature.cc | 2 +- mf/GNUmakefile | 5 ----- python/convertrules.py | 5 +++++ scm/define-grob-properties.scm | 2 +- scm/define-grobs.scm | 14 +++++++------- scm/define-markup-commands.scm | 8 ++++---- scm/font.scm | 23 +++++++++++++---------- 9 files changed, 33 insertions(+), 33 deletions(-) diff --git a/Documentation/notation/text.itely b/Documentation/notation/text.itely index c523f37596..d108520536 100644 --- a/Documentation/notation/text.itely +++ b/Documentation/notation/text.itely @@ -1359,10 +1359,8 @@ a1^\markup { \vcenter { \override #'(font-encoding . fetaBraces) \lookup #"brace120" - \override #'(font-encoding . fetaNumber) - \column { 1 3 } - \override #'(font-encoding . fetaDynamic) - sf + \override #'(font-encoding . fetaText) + \column { 1 3 sf } \override #'(font-encoding . fetaMusic) \lookup #"noteheads.s0petrucci" } diff --git a/lily/font-config.cc b/lily/font-config.cc index a7acda7cba..cffe4d9d69 100644 --- a/lily/font-config.cc +++ b/lily/font-config.cc @@ -60,7 +60,6 @@ init_fontconfig () /* Extra trailing slash suddenly breaks fontconfig (fc-cache 2.5.0) on windows. */ dirs.push_back (lilypond_datadir + "/fonts/otf"); - dirs.push_back (lilypond_datadir + "/fonts/type1"); for (vsize i = 0; i < dirs.size (); i++) { diff --git a/lily/time-signature.cc b/lily/time-signature.cc index 768b2782eb..1beda1696c 100644 --- a/lily/time-signature.cc +++ b/lily/time-signature.cc @@ -101,7 +101,7 @@ Time_signature::numbered_time_signature (Grob *me, int num, int den) { SCM chain = me->get_property_alist_chain (Font_interface::text_font_alist_chain (me)); chain = scm_cons (scm_list_1 (scm_cons (ly_symbol2scm ("font-encoding"), - ly_symbol2scm ("fetaNumber"))), + ly_symbol2scm ("fetaText"))), chain); SCM sn = Text_interface::interpret_markup (me->layout ()->self_scm (), chain, diff --git a/mf/GNUmakefile b/mf/GNUmakefile index 16bf2123df..85001b5b89 100644 --- a/mf/GNUmakefile +++ b/mf/GNUmakefile @@ -124,7 +124,6 @@ $(PE_SCRIPTS): $(buildscript-dir)/gen-emmentaler-scripts $< --dir=$(outdir) ALL_FONTS = $(FETA_FONTS) -PFB_FILES = $(ALL_FONTS:%=$(outdir)/%.pfb) # Make tfm files first, log files last, # so that normally log files aren't made twice @@ -133,7 +132,6 @@ ALL_GEN_FILES = $(LOG_FILES) \ $(LISP_FILES) \ $(OTF_TABLES) \ $(NCSB_OTFS) \ - $(PFB_FILES) \ $(OTF_FILES) \ $(SVG_FILES) @@ -151,9 +149,6 @@ INSTALLATION_OUT_FILES1 = $(OTF_FILES) \ INSTALLATION_OUT_DIR2 = $(local_lilypond_datadir)/fonts/svg INSTALLATION_OUT_FILES2 = $(SVG_FILES) -INSTALLATION_OUT_DIR3 = $(local_lilypond_datadir)/fonts/type1 -INSTALLATION_OUT_FILES3 = $(PFB_FILES) - export MFINPUTS := .:$(MFINPUTS) diff --git a/python/convertrules.py b/python/convertrules.py index 7111657ca1..2f0409eb3c 100644 --- a/python/convertrules.py +++ b/python/convertrules.py @@ -2983,6 +2983,11 @@ def conv(str): return str +@rule ((2, 13, 16), + _ ("Unify fetaNumber and fetaDynamic encodings")) +def conv(str): + return re.sub(r'\bfeta(Number|Dynamic)', 'fetaText', str) + # Guidelines to write rules (please keep this at the end of this file) # # - keep at most one rule per version; if several conversions should be done, diff --git a/scm/define-grob-properties.scm b/scm/define-grob-properties.scm index ea8424dbe4..72f6894703 100644 --- a/scm/define-grob-properties.scm +++ b/scm/define-grob-properties.scm @@ -287,7 +287,7 @@ switches off the flag.") category for selecting a font. Currently, only lilypond's system fonts (Emmentaler) are using this property. Available values are @code{fetaMusic} (Emmentaler), @code{fetaBraces}, -@code{fetaNumber} (Emmentaler), and @code{fetaDynamic} (Emmentaler).") +@code{fetaText} (Emmentaler).") (font-family ,symbol? "The font family is the broadest category for selecting text fonts. Options include: @code{sans}, @code{roman}.") diff --git a/scm/define-grobs.scm b/scm/define-grobs.scm index efd310c1da..8251fec819 100644 --- a/scm/define-grobs.scm +++ b/scm/define-grobs.scm @@ -607,7 +607,7 @@ (DoublePercentRepeatCounter . ( (direction . ,UP) - (font-encoding . fetaNumber) + (font-encoding . fetaText) (font-size . -2) (padding . 0.2) (self-alignment-X . ,CENTER) @@ -656,7 +656,7 @@ (direction . ,ly:script-interface::calc-direction) (extra-spacing-width . (+inf.0 . -inf.0)) - (font-encoding . fetaDynamic) + (font-encoding . fetaText) (font-series . bold) (font-shape . italic) (outside-staff-priority . 250) @@ -757,7 +757,7 @@ (avoid-slur . around) (cross-staff . ,ly:side-position-interface::calc-cross-staff) (direction . ,ly:script-interface::calc-direction) - (font-encoding . fetaNumber) + (font-encoding . fetaText) (font-size . -5) ; don't overlap when next to heads. (padding . 0.5) (positioning-done . ,ly:script-interface::calc-positioning-done) @@ -1167,7 +1167,7 @@ . ( (bound-padding . 2.0) (direction . ,UP) - (font-encoding . fetaNumber) + (font-encoding . fetaText) (padding . 0.4) (self-alignment-X . ,CENTER) (side-axis . ,Y) @@ -1385,7 +1385,7 @@ (PercentRepeatCounter . ( (direction . ,UP) - (font-encoding . fetaNumber) + (font-encoding . fetaText) (font-size . -2) (padding . 0.2) (self-alignment-X . ,CENTER) @@ -1768,7 +1768,7 @@ (StringNumber . ( (avoid-slur . around) - (font-encoding . fetaNumber) + (font-encoding . fetaText) (font-size . -5) ; don't overlap when next to heads. (padding . 0.5) (script-priority . 100) @@ -2264,7 +2264,7 @@ . ( (direction . ,UP) (edge-height . (2.0 . 2.0)) ;; staff-space; - (font-encoding . fetaNumber) + (font-encoding . fetaText) (font-size . -4) (stencil . ,ly:volta-bracket-interface::print) (thickness . 1.6) ;; line-thickness diff --git a/scm/define-markup-commands.scm b/scm/define-markup-commands.scm index 9240681dad..8d4d749770 100644 --- a/scm/define-markup-commands.scm +++ b/scm/define-markup-commands.scm @@ -1784,7 +1784,7 @@ may be any property supported by @rinternals{font-interface}, } @end lilypond" (interpret-markup layout - (cons '((font-size . -5) (font-encoding . fetaNumber)) props) + (cons '((font-size . -5) (font-encoding . fetaText)) props) arg)) (define-markup-command (abs-fontsize layout props size arg) @@ -1912,7 +1912,7 @@ some punctuation; it has no letters. } } @end lilypond" - (interpret-markup layout (prepend-alist-chain 'font-encoding 'fetaNumber props) arg)) + (interpret-markup layout (prepend-alist-chain 'font-encoding 'fetaText props) arg)) (define-markup-command (roman layout props arg) (markup?) @@ -2117,7 +2117,7 @@ done in a different font. The recommended font for this is bold and italic. } @end lilypond" (interpret-markup - layout (prepend-alist-chain 'font-encoding 'fetaDynamic props) arg)) + layout (prepend-alist-chain 'font-encoding 'fetaText props) arg)) (define-markup-command (text layout props arg) (markup?) @@ -2560,7 +2560,7 @@ and continue with double letters. ; backward slashes might use slope and point in the other direction! (dy (* mag (if forward 0.4 -0.4))) (number-stencil (interpret-markup layout - (prepend-alist-chain 'font-encoding 'fetaNumber props) + (prepend-alist-chain 'font-encoding 'fetaText props) (number->string num))) (num-x (horizontal-slash-interval num forward (ly:stencil-extent number-stencil X) mag)) (center (interval-center (ly:stencil-extent number-stencil Y))) diff --git a/scm/font.scm b/scm/font.scm index ee5b08a4a2..92f08f8bde 100644 --- a/scm/font.scm +++ b/scm/font.scm @@ -20,6 +20,13 @@ ;; lookup-font should be written in C. ;; +;; We have a tree, where each level of the tree is a qualifier +;; (eg. encoding, family, shape, series etc.) this defines the levels +;; in the tree. The first one is encoding, so we can directly select +;; between text or music in the first step of the selection. +(define default-qualifier-order + '(font-encoding font-family font-shape font-series)) + (define-class ()) @@ -70,8 +77,6 @@ (hash-table->alist (font-children node))) (display "} }\n")) -(define default-qualifier-order - '(font-encoding font-family font-shape font-series)) (define-method (add-font (node ) fprops size-family) (define (assoc-delete key alist) @@ -129,7 +134,7 @@ (g-lookup-font node alist-chain)) -;; Ugh. Currently, we load the PFB Feta fonts for `fetaDynamic' with +;; Ugh. Currently, we load the PFB Feta fonts for `fetaText' with ;; Pango. This should be changed to load the Emmentaler fonts instead ;; (with Pango too), but then we need support for a `font-style' ;; property which isn't implemented yet. @@ -137,7 +142,7 @@ (list->vector (map (lambda (tup) (cons (ly:pt (cdr tup)) - (format "feta-alphabet~a ~a" + (format "emmentaler~a ~a" (car tup) (ly:pt (cdr tup))))) '((11 . 11.22) @@ -159,8 +164,8 @@ Arguments: NAME is the basename for the music font. NAME-DESIGNSIZE.otf should be the music font, NAME-brace.otf should have piano braces. DESIGN-SIZE-LIST is a list of numbers, used as suffix for font filenames - FACTOR is size factor relative to default size that is being used. This is used - to select the proper design size for text fonts. + FACTOR is size factor relative to default size that is being used. + This is used to select the proper design size for the text fonts. " (for-each (lambda (x) @@ -169,8 +174,7 @@ Arguments: (cons 'font-family family)) (cons (* factor (cadr x)) (caddr x)))) - `((fetaDynamic ,(ly:pt 20.0) ,feta-alphabet-size-vector) - (fetaNumber ,(ly:pt 20.0) ,feta-alphabet-size-vector) + `((fetaText ,(ly:pt 20.0) ,feta-alphabet-size-vector) (fetaMusic ,(ly:pt 20.0) ,(list->vector (map (lambda (size) @@ -227,9 +231,8 @@ Arguments: (define-public all-music-font-encodings '(fetaBraces - fetaDynamic fetaMusic - fetaNumber)) + fetaText)) (define-public (magstep s) (exp (* (/ s 6) (log 2)))) -- 2.39.2