From: Patrick McCarty Date: Sun, 26 Jul 2009 03:07:02 +0000 (-0700) Subject: Adjust "font-name-style" procedure for SVG backend X-Git-Tag: release/2.13.4-1~293 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=98e98c972212b441b9c09cc5156a95ef6c58977f;p=lilypond.git Adjust "font-name-style" procedure for SVG backend Changes to make this procedure more generic for matching both fonts with string names and font smobs that need their names extracted. In the future, if all fonts are identified with string names, and the "feta-alphabet" PFB fonts are no longer used, this procedure may need to be adjusted. Note that this procedure is only used for the SVG backend. --- diff --git a/scm/lily-library.scm b/scm/lily-library.scm index 489921abcd..d1cce2a84c 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -593,17 +593,19 @@ possibly turned off." ;;; FONT may be font smob, or pango font string... (define-public (font-name-style font) - ;; FIXME: ughr, (ly:font-name) sometimes also has Style appended. + ;; FIXME: ughr, barf: feta-alphabet is actually emmentaler + (if (and (string? font) + (string-prefix? "feta-alphabet" font)) + (string-append "emmentaler" + "-" + (substring font + (string-length "feta-alphabet") + (string-length font))) (let* ((font-name (ly:font-name font)) - (full-name (if font-name font-name (ly:font-file-name font))) - (name-style (string-split full-name #\-))) - ;; FIXME: ughr, barf: feta-alphabet is actually emmentaler - (if (string-prefix? "feta-alphabet" full-name) - (list "emmentaler" - (substring full-name (string-length "feta-alphabet"))) - (if (not (null? (cdr name-style))) - name-style - (append name-style '("Regular")))))) + (full-name (if font-name font-name (ly:font-file-name font)))) + (if (string-prefix? "Aybabtu" full-name) + "aybabtu" + (string-downcase full-name))))) (define-public (modified-font-metric-font-scaling font) (let* ((designsize (ly:font-design-size font))