]> git.donarmstrong.com Git - lilypond.git/commitdiff
Adjust "font-name-style" procedure for SVG backend
authorPatrick McCarty <pnorcks@gmail.com>
Sun, 26 Jul 2009 03:07:02 +0000 (20:07 -0700)
committerPatrick McCarty <pnorcks@gmail.com>
Sun, 26 Jul 2009 03:35:38 +0000 (20:35 -0700)
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.

scm/lily-library.scm

index 489921abcd3945a065539ceb06977c3b72ef7ee1..d1cce2a84cdede1694b5a215c9b39caa9914c272 100644 (file)
@@ -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))