]> git.donarmstrong.com Git - lilypond.git/commitdiff
*** empty log message ***
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 23 Jan 2005 09:46:04 +0000 (09:46 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 23 Jan 2005 09:46:04 +0000 (09:46 +0000)
ChangeLog
scm/lily-library.scm
scm/output-gnome.scm
scm/output-svg.scm

index d42993dcbc52cd5909a8be257f10c21f0cbe8419..85bc60dd2204c54a7713d2bc8a23b4640bf05b8a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2005-01-22  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * scm/output-gnome.scm: 
+       * scm/output-svg.scm:
+       * scm/lily-library.scm (font-name-style): Update font name
+       kludging for fontconfig use.
+
 2005-01-20  Erlend Aasland  <erlenda@gmail.com>
 
        * scm/define-markup-commands.scm: Document right-align and
index fc02af4f6862452314cf1f6800b10be4e6207c4d..44b2fd3f15344194f37607f3da4d7ad407183186 100644 (file)
@@ -300,11 +300,15 @@ possibly turned off."
    (else (error "unknown unit" (ly:unit)))))
 
 ;;; font
-(define-public (font-family font)
-  (let ((name (ly:font-name font)))
-    (if name
-       (regexp-substitute/global #f "^GNU-(.*)-[.0-9]*$" name 'pre 1 'post)
-       (begin
-         ;;(stderr "font-name: ~S\n" (ly:font-name font))
-         ;;(stderr "font-file-name: ~S\n" (ly:font-file-name font))
-         (ly:font-file-name font)))))
+(define-public (font-name-style font)
+  ;; FIXME: ughr, (ly:font-name) sometimes also has Style appended.
+  (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"))))))
index c57dcb3163c4bef37ffbc385281973d3d84c9aa7..171a5eb4bcf8662907dcef68b51ac4c0017c8681 100644 (file)
@@ -8,7 +8,10 @@
 ;;;
 ;;;  * font selection: name, size, design size
 ;;;  * font scaling
-;;;  * .cff MUST NOT be in fc's fontpath?
+;;;;  * .cff MUST NOT be in fc's fontpath.
+;;;;    - workaround: remove mf/out from ~/.fonts.conf,
+;;;;      instead add ~/.fonts and symlink all /mf/out/*otf there.
+;;;;    - bug in fontconfig/freetype/pango?
 
 ;;;  * check: blot+scaling
 ;;;  * Figure out and fix font scaling and character placement
@@ -137,14 +140,13 @@ lilypond -fgnome input/simple-song.ly
    (map (lambda (x) (char->utf8-string x)) (string->list string))))
 
 (define (music-font? font)
-  (let ((family (font-family font)))
+  (let ((family (car (font-name-style font))))
     (string=? (substring family 0 (min (string-length family) 10))
              "emmentaler")))
 
 (define (pango-font-name font)
   (debugf "FONT-NAME:~S:~S\n" (ly:font-name font) (ly:font-design-size font))
-  ;;(debugf "FONT-FAMILY:~S:~S\n" (font-family font) (otf-name-mangling font (font-family font)))
-  (font-family font))
+  (apply format (append '(#f "~a, ~a") (font-name-style font))))
 
 (define (pango-font-size font)
   (let* ((designsize (ly:font-design-size font))
@@ -328,7 +330,6 @@ lilypond -fgnome input/simple-song.ly
                 #:parent (canvas-root)
                 #:x 0.0 #:y 0.0
                 #:anchor 'west
-                ;;#:font postscript-font-name
                 #:font (pango-font-name font)
                 #:size-points 12
                 #:size-set #t
@@ -387,8 +388,8 @@ lilypond -fgnome input/simple-song.ly
       #:join-style 'round)))
 
 (define (text font s)
-  (stderr "FONT:~S\n" font)
-  (stderr "FONT:~S\n" (pango-font-name font))
+  (debugf "FONT:~S\n" font)
+  (debugf "FONT:~S\n" (pango-font-name font))
 
   (make <gnome-canvas-text>
     #:parent (canvas-root)
index 25c6f269100e3234704da29fccdb6d3f47da4fd9..ac853d71fd181b7f186edb9dd3fe194c8835bfff 100644 (file)
@@ -9,7 +9,10 @@
 
 ;;;; TODO:
 ;;;;  * font selection: name, size, design size
-;;;;  * .cff MUST NOT be in fc's fontpath?
+;;;;  * .cff MUST NOT be in fc's fontpath.
+;;;;    - workaround: remove mf/out from ~/.fonts.conf,
+;;;;      instead add ~/.fonts and symlink all /mf/out/*otf there.
+;;;;    - bug in fontconfig/freetype/pango?
 
 ;;;;  * inkscape page/pageSet support
 ;;;;  * inkscape SVG-font support
 ;; FIXME: font can be pango font-name or smob
 ;;        determine size and style properly.
 (define (svg-font font)
-  (let ((family (if (string? font) font (font-family font)))
+  (let ((name-style (if (string? font) (list font "Regular")
+                       (font-name-style font)))
        (size (if (string? font) 12 (font-size font)))
        (anchor "west"))
     (format #f "font-family:~a;font-style:~a;font-size:~a;text-anchor:~a;"
-           family
-           (otf-style-mangling font family)
+           (car name-style)
+           (cadr name-style)
            size anchor)))
 
 (define (fontify font expr)
    (entity 'text expr (cons 'style (svg-font font))))
 
-(define-public (otf-style-mangling font family)
-  ;; Hmm, family is emmentaler20/26?
-  (if (string=? (substring family 0 (min (string-length family) 10))
-               "emmentaler")
-      ;; urg; currently empty
-      ;;(substring family 10)
-      "20"
-      "Regular"))
-
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 ;;; stencil outputters
 ;;;