From ddba9c87c58eb40ed7b92ea7864dc2ab17dfa7df Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 9 Jan 2005 17:23:29 +0000 Subject: [PATCH] *** empty log message *** --- ChangeLog | 5 +++++ config.make.in | 2 +- scm/output-gnome.scm | 30 ++++++++++++------------------ scm/output-svg.scm | 39 +++++++++++++++++++-------------------- 4 files changed, 37 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 612547f735..1091714c84 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,11 @@ 2005-01-09 Jan Nieuwenhuizen + * config.make.in (METAFONT): Append -progname=mf, fixes use with + mf-nowin for teTeX-3.0. Backportme. + + * scm/output-svg.scm (utf8-string): New function. + * scm/output-gnome.scm (utf8-string): New function. (otf-name-mangling): Remove. diff --git a/config.make.in b/config.make.in index 4464eb224f..095b32e240 100644 --- a/config.make.in +++ b/config.make.in @@ -93,7 +93,7 @@ GUILE_LDFLAGS = @GUILE_LDFLAGS@ INIMETAFONT = @INIMETAFONT@ LN = @LN@ LN_S = @LN_S@ -METAFONT = @METAFONT@ +METAFONT = @METAFONT@ -progname=mf MFMODE = @MFMODE@ MSGFMT = @MSGFMT@ ROOTSEP = @ROOTSEP@ diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm index 18e45bfbf1..c57dcb3163 100644 --- a/scm/output-gnome.scm +++ b/scm/output-gnome.scm @@ -6,6 +6,10 @@ ;;; TODO: ;;; +;;; * font selection: name, size, design size +;;; * font scaling +;;; * .cff MUST NOT be in fc's fontpath? + ;;; * check: blot+scaling ;;; * Figure out and fix font scaling and character placement ;;; * EC font package: add missing X font directories and AFMs @@ -145,23 +149,10 @@ lilypond -fgnome input/simple-song.ly (define (pango-font-size font) (let* ((designsize (ly:font-design-size font)) (magnification (* (ly:font-magnification font))) - - ;;font-name: "GNU-LilyPond-feta-20" - ;;font-file-name: "feta20" - ;;pango-font-name: "lilypond-feta, regular 32" - ;;OPS:2.61 - ;;scaling:29.7046771653543 - ;;magnification:0.569055118110236 - ;;design:20.0 - - ;; ugh, experimental sizing - ;; where does factor ops come from? - ;; Hmm, design size: 26/20 - ;;(ops 2.60) - (ops output-scale) - - (scaling (* 1.5 ops magnification designsize))) - (debugf "OPS:~S\n" ops) + ;; FIXME + ;;(scaling (* output-scale magnification designsize))) + (scaling (* 1.4 output-scale magnification designsize))) + ;;(debugf "OPS:~S\n" ops) (debugf "scaling:~S\n" scaling) (debugf "magnification:~S\n" magnification) (debugf "design:~S\n" designsize) @@ -406,7 +397,10 @@ lilypond -fgnome input/simple-song.ly #:x 0.0 #:y (if (music-font? font) 0.15 0.69) #:anchor (if (music-font? font) 'west 'south-west) #:font (pango-font-name font) + ;; FIXME: points #:size-points (pango-font-size font) + ;; or pixels? +;; #:size (inexact->exact (round (pango-font-size font))) #:size-set #t #:text (if (integer? s) (integer->utf8-string s) @@ -418,6 +412,6 @@ lilypond -fgnome input/simple-song.ly #:x 0.0 #:y 0.0 #:anchor 'west #:font pango-font-description - ;;#:size-points + #:size-points 12 #:size-set #t #:text string)) diff --git a/scm/output-svg.scm b/scm/output-svg.scm index 1f47b74264..25c6f26910 100644 --- a/scm/output-svg.scm +++ b/scm/output-svg.scm @@ -8,6 +8,9 @@ ;;;; http://www.w3.org/TR/SVG12/ -- page, pageSet in draft ;;;; TODO: +;;;; * font selection: name, size, design size +;;;; * .cff MUST NOT be in fc's fontpath? + ;;;; * inkscape page/pageSet support ;;;; * inkscape SVG-font support ;;;; - use fontconfig/fc-cache for now, see output-gnome.scm @@ -83,8 +86,7 @@ (define (font-size font) (let* ((designsize (ly:font-design-size font)) (magnification (* (ly:font-magnification font))) - (ops 2) - (scaling (* ops magnification designsize))) + (scaling (* output-scale magnification designsize))) (debugf "scaling:~S\n" scaling) (debugf "magnification:~S\n" magnification) (debugf "design:~S\n" designsize) @@ -100,33 +102,27 @@ (apply string-append (map (lambda (x) (char->entity x)) (string->list string)))) +;; FIXME: font can be pango font-name or smob +;; determine size and style properly. (define (svg-font font) - (let* ((encoding (ly:font-encoding font)) - (anchor (if (memq encoding '(fetaMusic fetaBraces)) 'start 'start)) - (family (font-family font))) - (format #f "font-family:~a;font-style:~a;font-size:~a;text-anchor:~S;" - (otf-name-mangling font family) - (otf-style-mangling font family) - (font-size font) anchor))) + (let ((family (if (string? font) font (font-family 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) + size anchor))) (define (fontify font expr) (entity 'text expr (cons 'style (svg-font font)))) -;; FIXME -(define-public (otf-name-mangling font family) - ;; Hmm, family is emmentaler20/26? - (if (string=? (substring family 0 (min (string-length family) 10)) - "emmentaler") - "LilyPond" - (if (string=? family "aybabtu") - "LilyPondBraces" - family))) - (define-public (otf-style-mangling font family) ;; Hmm, family is emmentaler20/26? (if (string=? (substring family 0 (min (string-length family) 10)) "emmentaler") - (substring family 10) + ;; urg; currently empty + ;;(substring family 10) + "20" "Regular")) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; @@ -297,3 +293,6 @@ (define (text font string) (dispatch `(fontify ,font ,(entity 'tspan (string->entities string))))) + +(define (utf8-string pango-font-description string) + (dispatch `(fontify ,pango-font-description ,(entity 'tspan string)))) -- 2.39.2