]> git.donarmstrong.com Git - lilypond.git/commitdiff
* scm/output-gnome.scm (utf8-string): New function.
authorJan Nieuwenhuizen <janneke@gnu.org>
Sun, 9 Jan 2005 11:32:52 +0000 (11:32 +0000)
committerJan Nieuwenhuizen <janneke@gnu.org>
Sun, 9 Jan 2005 11:32:52 +0000 (11:32 +0000)
(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
buildscripts/gen-emmentaler-scripts.py
lily/pango-font.cc
lily/stencil.cc
lily/text-item.cc
scm/framework-ps.scm
scm/output-gnome.scm

index 6fada4cd71ce82363fe5a3808fe5943d027fab61..66644ccd619a5faa274fe2786e5ab643f39b3ad1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2005-01-09  Jan Nieuwenhuizen  <janneke@gnu.org>
+
+       * 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  <gperlist@shaw.ca>
 
        * Documentation/user/notation.itely: add info about
index 24691b9f3538aca9434182046c194ba74e1a1c63..7e80512d2a5dad4b1da0c81c7ecde03f76f36fad 100644 (file)
@@ -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");
index ac76c10c705db9d0d54875ef64a0c3313682e3d9..236770910c9cbc60839adfa910a0d25ca1a343eb 100644 (file)
@@ -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
index 81cc03329613d2f587b92de76cf85201f5c0a2f2..4f8157bca73dc4defb7563b9540991f9f95b73ae 100644 (file)
@@ -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];
index 2ceb979b74546c07af70742a0efcbc53340954ac..1a01eced0b90a62c1e442c40f36c35249a0c1439 100644 (file)
@@ -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 ();
 }
 
 
index 6343e9dba158e4542c843b169617515ff7b0d158..247656c215cd41a89b185e4558da23aebef39971 100644 (file)
     (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
index 2251f26ca13b5eed29c1789dfea3c52e67c9777b..18e45bfbf196bd6e47688639da5b88981f703df7 100644 (file)
@@ -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 <gnome-canvas-text>
     #: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 <gnome-canvas-text>
+    #:parent (canvas-root)
+    #:x 0.0 #:y 0.0
+    #:anchor 'west
+    #:font pango-font-description
+    ;;#:size-points 
+    #:size-set #t
+    #:text string))