From: Jan Nieuwenhuizen Date: Sun, 23 Jan 2005 09:46:04 +0000 (+0000) Subject: *** empty log message *** X-Git-Tag: release/2.5.14~226 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=d390bbbe8050d125fc2cb71275a6cc2c7d021a49;p=lilypond.git *** empty log message *** --- diff --git a/ChangeLog b/ChangeLog index d42993dcbc..85bc60dd22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2005-01-22 Jan Nieuwenhuizen + + * 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 * scm/define-markup-commands.scm: Document right-align and diff --git a/scm/lily-library.scm b/scm/lily-library.scm index fc02af4f68..44b2fd3f15 100644 --- a/scm/lily-library.scm +++ b/scm/lily-library.scm @@ -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")))))) diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm index c57dcb3163..171a5eb4bc 100644 --- a/scm/output-gnome.scm +++ b/scm/output-gnome.scm @@ -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 #:parent (canvas-root) diff --git a/scm/output-svg.scm b/scm/output-svg.scm index 25c6f26910..ac853d71fd 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -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 @@ -105,26 +108,18 @@ ;; 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 ;;;