]> git.donarmstrong.com Git - lilypond.git/commitdiff
* mf/GNUmakefile: generate .commonff to not confuse fontconfig.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 6 Mar 2005 14:46:28 +0000 (14:46 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 6 Mar 2005 14:46:28 +0000 (14:46 +0000)
* ly/generate-embedded-cff.ly: capitalize.

* lily/pango-select.cc (select_pango_font): use ::find_pango_font,
so as to register the pango font.

* lily/main.cc: only look at one prefix directory, LILYPONDPREFIX
overrides all.

* scm/framework-ps.scm (dump-page): use output-units for landscape.

ChangeLog
lily/main.cc
lily/pango-font.cc
lily/pango-select.cc
ly/generate-embedded-cff.ly
mf/GNUmakefile
scm/framework-ps.scm

index 5ce25a2d5d3a29b17cd043c9b905cb161ffb993e..e5283499d3b3917df22874fd8a51c441a4a078fd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2005-03-06  Han-Wen Nienhuys  <hanwen@xs4all.nl>
 
+       * mf/GNUmakefile: generate .commonff to not confuse fontconfig.
+
+       * ly/generate-embedded-cff.ly: capitalize.
+
        * lily/pango-select.cc (select_pango_font): use ::find_pango_font,
        so as to register the pango font.
 
index a843ca4f2442eb9bc7050f78856ebf29f8e4a111..3ad0b6645e3da777a9316c2732466d76efe5ecd4 100644 (file)
@@ -337,7 +337,9 @@ do_chroot_jail ()
       exit (3);
     }
 }
+
 void test_pango();
+
 static void
 main_with_guile (void *, int, char **)
 {
@@ -394,7 +396,6 @@ main_with_guile (void *, int, char **)
   SCM result = scm_call_1 (ly_lily_module_constant ("lilypond-main"), files);
   (void) result;
 
-
   /* Unreachable.  */
   exit (0);
 }
@@ -425,7 +426,6 @@ add_output_format (String format)
   output_format_global += format;
 }
 
-
 static void
 parse_argv (int argc, char **argv)
 {
index f314c23e5e448ddf2e06366f7dc4e3dbde030439..92fe8aea50c2d3399a689ac1d098f1a2a7c802f9 100644 (file)
@@ -128,15 +128,40 @@ Pango_font::pango_item_string_stencil (PangoItem *item, String str, Real dx) con
   FcPattern *fcpat = fcfont->font_pattern;
   char *filename = 0;
   FcPatternGetString(fcpat, FC_FILE, 0, (FcChar8 **) &filename);
-  char const *ps_name = FT_Get_Postscript_Name (ftface);
+  char const *ps_name_str0 = FT_Get_Postscript_Name (ftface);
+  
 
-  if (ps_name)
+  /*
+    UGH: kludge a PS name for OTF fonts.
+   */
+  String ps_name;
+  if (!ps_name_str0
+      && filename
+      && String (filename).index (".otf") >= 0)
+    {
+      String name = filename;
+      name = name.left_string (name.length () - name.index (".otf"));
+
+      int slash_idx = name.index_last ('/');   // UGh. What's happens on windows?  
+      if (slash_idx >=  0)
+       name = name.right_string (name.length() - slash_idx);
+
+      String initial = name.cut_string (0,1);
+      initial.to_upper();
+      name = name.nomid_string (0,1);
+      name.to_lower();
+      ps_name = initial + name;
+    }
+  else if (ps_name_str0)
+    ps_name = ps_name_str0;
+  
+  if (ps_name.length ())
     {
       ((Pango_font *) this)->register_font_file (filename, ps_name);
       pango_fc_font_unlock_face (fcfont);
       
       SCM expr = scm_list_4 (ly_symbol2scm ("glyph-string"),
-                            scm_makfrom0str (ps_name),
+                            scm_makfrom0str (ps_name.to_str0 ()),
                             scm_from_double (size),
                             ly_quote_scm (glyph_exprs));
 
@@ -189,11 +214,13 @@ Pango_font::text_stencil (String str) const
       /*
        For Pango based backends, we take a shortcut.
        */
+      char *descr_string = pango_font_description_to_string (pango_description_);
       SCM exp
        = scm_list_3 (ly_symbol2scm ("utf8-string"),
-                     scm_makfrom0str (pango_font_description_to_string (pango_description_)),
+                     scm_makfrom0str (descr_string),
                      scm_makfrom0str (str.to_str0 ()));
 
+      g_free (descr_string);
 
       Box b (Interval (0, 0), Interval (0, 0));
       b.unite (dest.extent_box ());
@@ -224,7 +251,7 @@ Pango_font::font_file_name () const
 
 
 
-
+#if 0
 void test_pango()
 {
   int dpi = 1200;
@@ -309,3 +336,4 @@ void test_pango()
     }
 
 }
+#endif
index ae3e86cdb58431d18a5a6e88bd39bac8fad1aca9..2d7538306d7d9fdee1371e82c1f0e4581a888ea2 100644 (file)
@@ -58,7 +58,7 @@ select_pango_font (Output_def *layout, SCM chain)
 
   char * str = pango_font_description_to_string (pfd);
   SCM scm_str = scm_makfrom0str (str);
-  gfree (str);
+  g_free (str);
     
   return find_pango_font (layout, scm_str, 1.0);
 }
index b0f1cf1d32d0441abbd755d0d03174a9fddc7950..1d7882ad5f96027d6566fe635e61c49b5b1d0a84 100644 (file)
             out-port)
   ))
 
-#(write-cff "emmentaler-26" "emmentaler-26.cff")
-#(write-cff "emmentaler-23" "emmentaler-23.cff")
-#(write-cff "emmentaler-20" "emmentaler-20.cff")
-#(write-cff "emmentaler-18" "emmentaler-18.cff")
-#(write-cff "emmentaler-16" "emmentaler-16.cff")
-#(write-cff "emmentaler-14" "emmentaler-14.cff")
-#(write-cff "emmentaler-13" "emmentaler-13.cff")
-#(write-cff "emmentaler-11" "emmentaler-11.cff")
-#(write-cff "aybabtu" "aybabtu.cff")
+#(write-cff "Emmentaler-26" "emmentaler-26.commonff")
+#(write-cff "Emmentaler-23" "emmentaler-23.commonff")
+#(write-cff "Emmentaler-20" "emmentaler-20.commonff")
+#(write-cff "Emmentaler-18" "emmentaler-18.commonff")
+#(write-cff "Emmentaler-16" "emmentaler-16.commonff")
+#(write-cff "Emmentaler-14" "emmentaler-14.commonff")
+#(write-cff "Emmentaler-13" "emmentaler-13.commonff")
+#(write-cff "Emmentaler-11" "emmentaler-11.commonff")
+#(write-cff "aybabtu" "aybabtu.commonff")
index 988d61a402be18c2bdb4430614166d0c6be45c95..8082c40058a6b264b456425ed685ec8a1fc4b5ac 100644 (file)
@@ -26,7 +26,7 @@ OTF_TABLES = $(addsuffix .otf-table, $(addprefix $(outdir)/feta, $(STAFF_SIZES))
  $(BRACES:%=$(outdir)/feta-braces-%.otf-table)
 FETA_FONTS = $(FETA_MF_FILES:.mf=)
 SVG_FILES = $(OTF_FILES:%.otf=%.svg) $(ALL_FONTS:%=$(outdir)/%.svg)
-CFF_FILES = $(OTF_FILES:%.otf=%.cff)
+COMMONFF_FILES = $(OTF_FILES:%.otf=%.commonff)
 CFF_PS_FILES = $(OTF_FILES:%.otf=%.cff.ps)
 
 
@@ -59,10 +59,11 @@ foe:
        echo $(TEXMF)
        kpsewhich exbase.mf
 
-$(outdir)/%.cff $(outdir)/%.otf $(outdir)/%.svg: $(outdir)/%.pe
-       (cd $(outdir) && fontforge -script $(notdir $<)) 
+$(outdir)/%.commonff $(outdir)/%.otf $(outdir)/%.svg: $(outdir)/%.pe
+       (cd $(outdir) && fontforge -script $(notdir $<) \
+        && mv $(notdir $(basename $<)).cff $(notdir $(basename $<)).commonff)
 
-$(CFF_PS_FILES): $(CFF_FILES)
+$(CFF_PS_FILES): $(COMMONFF_FILES)
        cd $(outdir) && $(builddir)/lily/$(outconfbase)/lilypond --verbose $(abs-srcdir)/ly/generate-embedded-cff
 
 $(outdir)/%.otf-table: $(outdir)/%.lisp $(if $(findstring brace,$<),,$(subst feta,parmesan,$<)) 
@@ -90,7 +91,7 @@ ALL_GEN_FILES= $(TFM_FILES) $(TEXTABLES) $(TFM_FILES) $(LOG_FILES) $(ENC_FILES)
 INSTALLATION_DIR=$(local_lilypond_datadir)/fonts/source
 INSTALLATION_FILES=$(MF_FILES) $(AF_FILES)
 
-INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6 7 9
+INSTALLATION_OUT_SUFFIXES=1 2 3 4 5 6 7 9
 
 INSTALLATION_OUT_DIR1=$(local_lilypond_datadir)/tex
 INSTALLATION_OUT_FILES1=$(TEXTABLES)
@@ -105,7 +106,6 @@ INSTALLATION_OUT_FILES3=$(TFM_FILES)
 INSTALLATION_OUT_DIR4=$(local_lilypond_datadir)/ps
 INSTALLATION_OUT_FILES4=$(CFF_PS_FILES)
 
-
 INSTALLATION_OUT_DIR5=$(local_lilypond_datadir)/fonts/type1
 INSTALLATION_OUT_FILES5=$(PFA_FILES)
 
@@ -115,10 +115,6 @@ INSTALLATION_OUT_FILES6=$(outdir)/lilypond.map
 INSTALLATION_OUT_DIR7=$(local_lilypond_datadir)/ps/
 INSTALLATION_OUT_FILES7=$(ENC_FILES)
 
-# install in fonts/cff or ps/ directory?
-INSTALLATION_OUT_DIR8=$(local_lilypond_datadir)/cff
-INSTALLATION_OUT_FILES8=$(CFF_FILES)
-
 INSTALLATION_OUT_DIR9=$(local_lilypond_datadir)/svg
 INSTALLATION_OUT_FILES9=$(SVG_FILES)
 
index 4019a3469d473e29a3c2913159479401794fe4c0..63d63488b26a62b503a2485405faf3cd6fc519b2 100644 (file)
                       ((and bare-file-name
                             (string-match "\\.otf" bare-file-name))
 
-                       (display "HOI\n")
                        (cached-file-contents (string-regexp-substitute "otf" "cff.ps" bare-file-name)))
                       ((and bare-file-name (string-match "\\.ttf" bare-file-name))
                        (ly:ttf->pfa bare-file-name))