From 14439b462ed0de342c2ef41c6b87ecdb27036fe4 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Sun, 9 Jan 2005 11:32:52 +0000 Subject: [PATCH] * scm/output-gnome.scm (utf8-string): New function. (otf-name-mangling): Remove. * lily/pango-font.cc (Pango_font): Use font string iso font filename for utf8-text. * buildscripts/gen-emmentaler-scripts.py: Remove designsize from name. --- ChangeLog | 11 +++++++ buildscripts/gen-emmentaler-scripts.py | 3 +- lily/pango-font.cc | 9 +++--- lily/stencil.cc | 2 +- lily/text-item.cc | 2 +- scm/framework-ps.scm | 5 ++++ scm/output-gnome.scm | 40 +++++++++++++------------- 7 files changed, 44 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fada4cd71..66644ccd61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2005-01-09 Jan Nieuwenhuizen + + * scm/output-gnome.scm (utf8-string): New function. + (otf-name-mangling): Remove. + + * lily/pango-font.cc (Pango_font): Use font string iso font + filename for utf8-text. + + * buildscripts/gen-emmentaler-scripts.py: Remove designsize from + name. + 2005-01-08 Graham Percival * Documentation/user/notation.itely: add info about diff --git a/buildscripts/gen-emmentaler-scripts.py b/buildscripts/gen-emmentaler-scripts.py index 24691b9f35..7e80512d2a 100644 --- a/buildscripts/gen-emmentaler-scripts.py +++ b/buildscripts/gen-emmentaler-scripts.py @@ -28,9 +28,8 @@ for design_size in [11,13,14,16,18,20,23,26]: New(); # Separate Feta versioning? -# Naming: * expose LilyPond20/LilyPond rather than %(name)s # * using 20 as Weight works for gnome-font-select widget: gfs -SetFontNames("%(name)s-%(design_size)d", "%(name)s", "%(name)s %(design_size)d", "%(design_size)d", "GNU GPL", "@TOPLEVEL_VERSION@"); +SetFontNames("%(name)s", "%(name)s", "%(name)s %(design_size)d", "%(design_size)d", "GNU GPL", "@TOPLEVEL_VERSION@"); MergeFonts("feta%(design_size)d.pfa"); MergeFonts("parmesan%(design_size)d.pfa"); diff --git a/lily/pango-font.cc b/lily/pango-font.cc index ac76c10c70..236770910c 100644 --- a/lily/pango-font.cc +++ b/lily/pango-font.cc @@ -168,13 +168,14 @@ Pango_font::text_stencil (String str) const For Pango based backends, we take a shortcut. */ SCM exp - = scm_list_3 (ly_symbol2scm ("utf-8-string"), - scm_makfrom0str (pango_font_description_to_filename (pango_description_)), + = scm_list_3 (ly_symbol2scm ("utf8-string"), + scm_makfrom0str (pango_font_description_to_string (pango_description_)), scm_makfrom0str (str.to_str0 ())); - return Stencil (dest.extent_box (), - exp); + Box b (Interval (0, 0), Interval (0, 0)); + b.unite (dest.extent_box ()); + return Stencil (b, exp); } #if 0 diff --git a/lily/stencil.cc b/lily/stencil.cc index 81cc033296..4f8157bca7 100644 --- a/lily/stencil.cc +++ b/lily/stencil.cc @@ -163,7 +163,7 @@ Stencil::moved_to_edge (Axis a, Direction d, Stencil const &s, { programming_error ("Stencil::moved_to_edge: adding empty stencil."); his_extent = 0.0; - SCM_ASSERT_TYPE(0, SCM_EOL, SCM_ARG1, __FUNCTION__, ""); + SCM_ASSERT_TYPE (0, SCM_EOL, SCM_ARG1, __FUNCTION__, ""); } else his_extent = i[-d]; diff --git a/lily/text-item.cc b/lily/text-item.cc index 2ceb979b74..1a01eced0b 100644 --- a/lily/text-item.cc +++ b/lily/text-item.cc @@ -37,7 +37,7 @@ Text_interface::interpret_string (SCM layout_smob, String str = ly_scm2string (markup); Font_metric *fm = select_encoded_font (layout, props); - return fm->text_stencil (str).smobbed_copy(); + return fm->text_stencil (str).smobbed_copy (); } diff --git a/scm/framework-ps.scm b/scm/framework-ps.scm index 6343e9dba1..247656c215 100644 --- a/scm/framework-ps.scm +++ b/scm/framework-ps.scm @@ -269,6 +269,11 @@ (postprocess-output book framework-ps-module filename (ly:output-formats)) )) +(if (not (defined? 'nan?)) + (define (nan? x) #f)) +(if (not (defined? 'inf?)) + (define (inf? x) #f)) + (define-public (output-preview-framework basename book scopes fields ) (let* ((filename (format "~a.ps" basename)) (outputter (ly:make-paper-outputter filename diff --git a/scm/output-gnome.scm b/scm/output-gnome.scm index 2251f26ca1..18e45bfbf1 100644 --- a/scm/output-gnome.scm +++ b/scm/output-gnome.scm @@ -118,7 +118,7 @@ lilypond -fgnome input/simple-song.ly (list (+ #xe0 x) (+ #x80 (quotient y #x40)) (+ #x80 (modulo y #x40)))))) - (else (begin (stderr "programming-error: utf-8 too big:~x\n" i) + (else (begin (stderr "programming-error: utf8 too big:~x\n" i) (list (integer->char 32)))))) (define (integer->utf8-string integer) @@ -133,26 +133,14 @@ lilypond -fgnome input/simple-song.ly (map (lambda (x) (char->utf8-string x)) (string->list string)))) (define (music-font? font) - (let ((encoding (ly:font-encoding font)) - (family (font-family font))) - (or (memq encoding '(fetaMusic fetaBraces)) - (string=? (substring family 0 (min (string-length family) 10)) - "emmentaler")))) - -;; FIXME -(define-public (otf-name-mangling font family) - ;; Hmm, family is emmentaler20/26? - (if (string=? (substring family 0 (min (string-length family) 10)) - "emmentaler") - (string-append "LilyPond " (substring family 10)) - (if (string=? family "aybabtu") - "LilyPondBraces" - family))) + (let ((family (font-family 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))) - (otf-name-mangling font (font-family font))) + ;;(debugf "FONT-FAMILY:~S:~S\n" (font-family font) (otf-name-mangling font (font-family font))) + (font-family font)) (define (pango-font-size font) (let* ((designsize (ly:font-design-size font)) @@ -169,9 +157,10 @@ lilypond -fgnome input/simple-song.ly ;; ugh, experimental sizing ;; where does factor ops come from? ;; Hmm, design size: 26/20 - (ops 2.60) + ;;(ops 2.60) + (ops output-scale) - (scaling (* ops magnification designsize))) + (scaling (* 1.5 ops magnification designsize))) (debugf "OPS:~S\n" ops) (debugf "scaling:~S\n" scaling) (debugf "magnification:~S\n" magnification) @@ -407,6 +396,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)) (make #:parent (canvas-root) @@ -421,3 +412,12 @@ lilypond -fgnome input/simple-song.ly (integer->utf8-string s) (string->utf8-string s)))) +(define (utf8-string pango-font-description string) + (make + #:parent (canvas-root) + #:x 0.0 #:y 0.0 + #:anchor 'west + #:font pango-font-description + ;;#:size-points + #:size-set #t + #:text string)) -- 2.39.2