]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/font-metric.cc (LY_DEFINE): new function, return fontName.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 8 Apr 2004 23:59:13 +0000 (23:59 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Thu, 8 Apr 2004 23:59:13 +0000 (23:59 +0000)
* scm/output-ps.scm (define-fonts): remove hack for feta/parmesan.

* lily/font-metric.cc (LY_DEFINE): change to ly:font-filename

ChangeLog
input/test/title-markup.ly
lily/font-metric.cc
lily/include/scaled-font-metric.hh
lily/scaled-font-metric.cc
scm/output-ps.scm

index 98006e10de6fd713a06fbdabc080b833eebcd983..a21f2925d79361c547c3f665e050ffe248bb4bc0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2004-04-09  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/font-metric.cc (LY_DEFINE): new function, return fontName.
+
+       * scm/output-ps.scm (define-fonts): remove hack for feta/parmesan.
+
        * lily/font-metric.cc (LY_DEFINE): change to ly:font-filename
 
        * scm/encoding.scm (coding-alist): add AdobeStandardEncoding
index e2727161fbb61c8dad50f81e757e27c50db8a642..3088008dd1bf6b84e3cdb020c99675de74997eb2 100644 (file)
@@ -5,6 +5,14 @@
    export GS_LIB=$(pwd)/mf/out:/usr/share/texmf/fonts/type1/bluesky/cm
    lilypond-bin -fps input/title/title-markup.ly
 
+
+for utopia font,
+
+   cp /usr/share/fonts/afms/adobe/putb8a.afm  -> mf/out/
+   cp /usr/share/fonts/afms/adobe/put8a.afm  -> mf/out/
+   cp /usr/share/fonts/default/ghostscript/put.pfa mf/out/put8a.pfa
+   cp /usr/share/fonts/default/ghostscript/putb.pfa mf/out/putb8a.pfa
+
 %}
 
 \paper{
index 97c42102fb518b5a98489841693ad430560514f4..07afa3076bc76d44d1105ae0c033eedd13942895 100644 (file)
@@ -178,7 +178,7 @@ LY_DEFINE (ly_text_dimension,"ly:text-dimension",
   return scm_cons (ly_interval2scm (b[X_AXIS]), ly_interval2scm (b[Y_AXIS]));
 }
 
-LY_DEFINE (ly_font_name,"ly:font-filename",
+LY_DEFINE (ly_font_filename,"ly:font-filename",
           1, 0, 0,
           (SCM font),
           "Given the font metric @var{font}, "
@@ -189,6 +189,32 @@ LY_DEFINE (ly_font_name,"ly:font-filename",
   return ly_car (fm->description_);
 }
 
+
+#include "afm.hh"
+
+LY_DEFINE (ly_font_name,"ly:font-name",
+          1, 0, 0,
+          (SCM font),
+          "Given the font metric @var{font}, "
+          "return the corresponding file name.")
+{
+  Font_metric *fm = unsmob_metrics (font);
+      
+  SCM_ASSERT_TYPE (fm, font, SCM_ARG1, __FUNCTION__, "font-metric");
+
+
+  if (Modified_font_metric* mfm = dynamic_cast<Modified_font_metric*> (fm))
+    return ly_font_name (mfm->original_font ()->self_scm ());
+  else if (Adobe_font_metric* afm = dynamic_cast<Adobe_font_metric*> (fm))
+    {
+      return scm_makfrom0str (afm->font_info_->gfi->fontName);
+    }
+  else
+    return SCM_BOOL_F;
+}
+
+
+
 LY_DEFINE (ly_font_magnification,"ly:font-magnification", 1 , 0, 0,
          (SCM font),
           "Given the font metric @var{font}, return the "
index 4a37f4152ceb90538ebd7bd38aa1db89e0edf521..5c9a04818b6f2d066eb0f69ac8281a6bd53ce9e0 100644 (file)
@@ -25,6 +25,7 @@ public:
   virtual int name_to_index (String) const;
   virtual String coding_scheme () const;
 
+  virtual Font_metric * original_font () const;  
 
 protected:
   
@@ -32,7 +33,7 @@ protected:
   SCM coding_table_;
   SCM coding_mapping_;
   SCM coding_description_;
-  friend SCM ly_font_encoding(SCM);
+  friend SCM ly_font_encoding_alist (SCM);
     
   virtual Real design_size () const;
   virtual void derived_mark () const; 
index 90257a3d739d88c865c2236bb7f4584c75ebcf44..6c0d5ba353712f0e6780b70ba4a46fe36ff544b1 100644 (file)
@@ -76,7 +76,7 @@ Modified_font_metric::Modified_font_metric (String coding, Font_metric* m, Real
 
 
 
-LY_DEFINE (ly_font_encoding, "ly:font-encoding-alist",
+LY_DEFINE (ly_font_encoding_alist, "ly:font-encoding-alist",
           1, 0, 0,
           (SCM font),
           "Given the Modified_font_metric @var{font}, return an "
@@ -289,3 +289,9 @@ Modified_font_metric::text_dimension (String text)
   
   return b;
 }
+
+Font_metric*
+Modified_font_metric::original_font () const
+{
+  return orig_;
+}
index c475c591734fc7e7c6d653fdd9b4824cd0bd7833..bf8056091038d8b8bcac0b7f204b6b791e51c18f 100644 (file)
       ;; FIXME: we need proper Fontmap for the bluesky CM*, EC* fonts.
       ;; Only the fonts that we trace in mf/ are in our own FontMap.
       (string-append basename ".pfb"))
-     ((or (equal? (substring basename 0 4) "feta")
-         (equal? (substring basename 0 4) "parm"))
-      (regexp-substitute/global
-       #f "(feta|parmesan)([a-z-]*)([0-9]+)"
-       basename 'pre "GNU-LilyPond-" 1 2 "-" 3 'post))
-     (else basename)))
+     (else (string-append basename ".pfa"))
+     ))
 
   (define (font-load-command paper font)
-    (let* ((basename (ly:font-filename font))
-          (fontname (guess-ps-fontname basename))
+    (let* ((specced-font-name (ly:font-name font))
+          (fontname (if specced-font-name
+                        specced-font-name
+                        (guess-ps-fontname (ly:font-filename font))))
+          
           (coding-alist (ly:font-encoding-alist font))
           (input-encoding (assoc-get 'input-name coding-alist))
           (font-encoding (assoc-get 'output-name coding-alist))