]> git.donarmstrong.com Git - lilypond.git/commitdiff
* lily/font-interface.cc (text_font_alist_chain): rename function,
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 14 Mar 2004 01:23:26 +0000 (01:23 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 14 Mar 2004 01:23:26 +0000 (01:23 +0000)
and use text-font-defaults.

* lily/font-select.cc (properties_to_font_size_family): call SCM code.

* scm/paper.scm (paper-set-staff-size): use new function.

* scm/new-font.scm (make-font-tree): new function.

23 files changed:
ChangeLog
lily/accidental.cc
lily/balloon.cc
lily/beam.cc
lily/font-interface.cc
lily/font-select.cc
lily/grob-scheme.cc
lily/include/font-interface.hh
lily/line-spanner.cc
lily/multi-measure-rest.cc
lily/ottava-bracket.cc
lily/paper-column.cc
lily/system-start-delimiter.cc
lily/text-item.cc
lily/text-spanner.cc
lily/time-signature.cc
lily/tuplet-bracket.cc
ly/declarations-init.ly
scm/lily.scm
scm/new-font.scm
scm/output-lib.scm
scm/page-layout.scm
scm/paper.scm

index 3e11a64b60bcabf69f2d5808b51746be87e364ab..54e4f0e2ded497156c801cb2317b4e13c81403e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2004-03-14  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/font-interface.cc (text_font_alist_chain): rename function,
+       and use text-font-defaults. 
+
+       * lily/font-select.cc (properties_to_font_size_family): call SCM code.
+
+       * scm/paper.scm (paper-set-staff-size): use new function.
+
+       * scm/new-font.scm (make-font-tree): new function.
+
 2004-03-13  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/paper-book.cc (output): Bugfix: no output if no \paper.
index 3d2cdacf96b6431ddd0d9e629399b0154d46a6db..b565881e88c21d7b1293d349dd1b2071518c0f31 100644 (file)
@@ -196,7 +196,7 @@ Accidental_interface::print (SCM smob)
   Font_metric *fm = 0;
   if (smaller)
     {
-      SCM ac = Font_interface::font_alist_chain (me);
+      SCM ac = Font_interface::text_font_alist_chain (me);
       ac = gh_cons (gh_cons (gh_cons
                             (ly_symbol2scm ("font-size"),
                              scm_int2num (-2)), SCM_EOL),
index 04611150085385a6361d123f3c1a3b10fe92a666..07d75803cc4891d68a68fe014d70758de6e8628b 100644 (file)
@@ -59,7 +59,7 @@ Balloon_interface::print (SCM smob)
 
 
   SCM bt = me->get_property ("balloon-text");
-  SCM chain = Font_interface::font_alist_chain (me);
+  SCM chain = Font_interface::text_font_alist_chain (me);
   chain = gh_cons (me->get_property ("balloon-text-props"), chain);
 
 
index 145c4e42897331e691bb20637f54773bd11ecb9a..6f0da9d5a79599b29a18a903b4f6afca566b32b1 100644 (file)
@@ -520,7 +520,7 @@ Beam::print (SCM grob)
        parameters.
       */
       String str;
-      SCM properties = Font_interface::font_alist_chain (me);
+      SCM properties = Font_interface::text_font_alist_chain (me);
 
       Stencil tm = *unsmob_stencil (Text_item::interpret_markup
         (me->get_paper ()->self_scm (), properties, quant_score));
index 587cc9c155748fc91d13f71f17df8d808200a9a5..4923cdeb3eddffb2c88b189a5c2322af7e44bf8a 100644 (file)
@@ -21,9 +21,14 @@ Font_interface::get_default_font (Grob *me)
   Font_metric *fm = unsmob_metrics (me->get_property ("font"));
   if (!fm)
     {
-      fm = select_font (me->get_paper (), font_alist_chain (me));
+
+      SCM defaults = me->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+      SCM chain = me->get_property_alist_chain (defaults);
+      
+      fm = select_font (me->get_paper (), chain);
       me->set_property ("font", fm->self_scm ());
     }
+  
   return fm;
 }
 
@@ -37,10 +42,11 @@ LY_DEFINE (ly_font_interface_get_default_font, "ly:get-default-font",
   return Font_interface::get_default_font (gr)->self_scm ();
 }
 
+
 SCM
-Font_interface::font_alist_chain (Grob *g)
+Font_interface::text_font_alist_chain (Grob *g)
 {
-  SCM defaults = g->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+  SCM defaults = g->get_paper ()->lookup_variable (ly_symbol2scm ("text-font-defaults"));
   return g->get_property_alist_chain (defaults);
 }
 
index 654ad04111f428c21bc3274ea007de13e9568a7a..d4773c853c22b45b267a8626652a6655ede67512 100644 (file)
@@ -41,6 +41,7 @@ wild_compare (SCM field_val, SCM val)
 {
   return (val == SCM_BOOL_F || field_val == ly_symbol2scm ("*") || field_val == val);
 }
+
 Font_metric*
 get_font_by_design_size (Paper_def* paper, Real requested,
                         SCM font_vector)
@@ -87,54 +88,14 @@ get_font_by_mag_step (Paper_def* paper, Real requested_step,
 
 
 
-/*
-  We can probably get more efficiency points if we preprocess FONTS
-  to make lookup easier.
- */
 SCM
 properties_to_font_size_family (SCM fonts, SCM alist_chain)
 {
-  SCM shape = SCM_BOOL_F;
-  SCM family = SCM_BOOL_F;
-  SCM series = SCM_BOOL_F;
-  
-  shape = ly_assoc_chain (ly_symbol2scm ("font-shape"), alist_chain);
-  family = ly_assoc_chain (ly_symbol2scm ("font-family"), alist_chain);
-  series = ly_assoc_chain (ly_symbol2scm ("font-series"), alist_chain);
-
-  if (gh_pair_p (shape))
-    shape = ly_cdr (shape);
-  if (gh_pair_p (family))
-    family = ly_cdr (family);
-  if (gh_pair_p (series))
-    series = ly_cdr (series);
-
+  static SCM proc;
+  if (!proc )
+    proc = scm_c_eval_string ("lookup-font");
 
-  for (SCM s = fonts ; gh_pair_p (s); s = ly_cdr (s))
-    {
-      SCM qlist = ly_caar (s);
-
-      if (!wild_compare (SCM_VECTOR_REF (qlist, 0), series))
-       continue;
-      if (!wild_compare (SCM_VECTOR_REF (qlist, 1), shape))
-       continue;
-      if (!wild_compare (SCM_VECTOR_REF (qlist, 2), family))
-       continue;
-  
-      SCM qname = ly_cdar (s);
-      return qname;
-    }
-
-  warning (_f ("cannot find font for: (%s %s %s)",
-              ly_symbol2string (series).to_str0 (),
-              ly_symbol2string (shape).to_str0 (),
-              ly_symbol2string (family).to_str0 ()));
-  
-  scm_write (scm_list_n (shape, series , family, 
-                        SCM_UNDEFINED), scm_current_error_port ());
-  scm_flush (scm_current_error_port ());
-  return scm_makfrom0str ("cmr10");
+  return scm_call_2 (proc, fonts, alist_chain);
 }
 
 
index f7158e7f4577bc3001031ba65166c07731d0707f..587a692c3835cc44472e3cf848c59fe56c544982 100644 (file)
@@ -70,16 +70,20 @@ LY_DEFINE (ly_grob_paper,"ly:grob-paper", 1, 0, 0,
 
 
 LY_DEFINE(ly_grob_alist_chain, "ly:grob-alist-chain",
-         1, 0, 0,
-         (SCM g),
-         "Get an alist chain for grob @var{g}."
+         1, 1, 0,
+         (SCM g, SCM global),
+         "Get an alist chain for grob @var{g}, with @var{global} as the "
+         "global default. If unspecified, @code{font-defaults} "
+         "from the paper block is taken. "
          )
 {
   Grob * sc = unsmob_grob (g);
   SCM_ASSERT_TYPE (sc, g, SCM_ARG1, __FUNCTION__, "grob");
 
-  SCM defaults = sc->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
-  return sc->get_property_alist_chain (defaults);
+  if (global == SCM_UNDEFINED)
+    global = sc->get_paper ()->lookup_variable (ly_symbol2scm ("font-defaults"));
+
+  return sc->get_property_alist_chain (global);
 }
 
 
index 58e9a986c6a4a62cac17a4b2691286bab52eb721..522ee2c133546a201fc360609ac664eb8d9b3cfd 100644 (file)
@@ -15,6 +15,7 @@
 
 struct Font_interface
 {
+  static SCM text_font_alist_chain (Grob*);
   static SCM font_alist_chain (Grob*);
   static Font_metric * get_default_font (Grob*);
   static bool has_interface (Grob*);
index 6456135af9422bad03a12cd3d3efa2cf7a3450f7..6eb46f8a2321760c97e8706302f4b4b33629f235 100644 (file)
@@ -112,7 +112,7 @@ Line_spanner::line_stencil (Grob *me,
   else if (gh_symbol_p (type)
           && type == ly_symbol2scm ("trill"))
     {
-      SCM alist_chain = Font_interface::font_alist_chain (me);
+      SCM alist_chain = Font_interface::text_font_alist_chain (me);
       SCM style_alist = scm_list_n (gh_cons (ly_symbol2scm ("font-family"),
                                             ly_symbol2scm ("music")),
                                    SCM_UNDEFINED);
index b04768dfea24e089dc307fd95f44f55820d531f8..9436069dd8bdb0746d0d73a0556562c54ed1a209 100644 (file)
@@ -135,7 +135,7 @@ Multi_measure_rest::symbol_stencil (Grob *me, Real space)
       return s;
     }
 
-  SCM alist_chain = Font_interface::font_alist_chain (me);
+  SCM alist_chain = Font_interface::text_font_alist_chain (me);
 
   Real staff_space = Staff_symbol_referencer::staff_space (me);
   Font_metric *musfont
index d77a6b6e2d643d25f02d370dbc8bc07b13b88f6e..ef0f02404cf9ce1011075ae9b8abafe82701576d 100644 (file)
@@ -66,7 +66,7 @@ Ottava_bracket::print (SCM smob)
     }
   while (flip (&d) != LEFT);
 
-  SCM properties = Font_interface::font_alist_chain (me);
+  SCM properties = Font_interface::text_font_alist_chain (me);
   SCM markup = me->get_property ("text");
   Stencil text;
   if (Text_item::markup_p (markup)) 
index 69e49a77d9789556781982ed40261892aa7bde68..21ec714301b4751bfe9cb62db593dc4b5470fc1d 100644 (file)
@@ -115,7 +115,7 @@ Paper_column::print (SCM p)
   Grob *me = unsmob_grob (p);
 
   String r = to_string (Paper_column::get_rank (me));
-  SCM properties = Font_interface::font_alist_chain (me);
+  SCM properties = Font_interface::text_font_alist_chain (me);
 
   SCM scm_mol = Text_item::interpret_markup (me->get_paper ()->self_scm (),
                                             properties,
index b460c4f57f38a47ab8560b23c5cbc32abb4976ad..e61fa4e71829a5179f67ce08e56e1f0643f149c2 100644 (file)
@@ -147,7 +147,7 @@ System_start_delimiter::staff_brace (Grob*me, Real y)
      name.  This is better than using find_font directly,
      esp. because that triggers mktextfm for non-existent
      fonts. */
-  SCM fam = gh_cons (ly_symbol2scm ("font-family"), ly_symbol2scm ("braces"));
+  SCM fam = gh_cons (ly_symbol2scm ("font-encoding"), ly_symbol2scm ("braces"));
   
   SCM alist = scm_list_n (fam, SCM_UNDEFINED);
   fm = select_font (me->get_paper (), scm_list_n (alist, SCM_UNDEFINED));
index 31d34024109c800c968b47582eca660b4270200f..e8e9dcabf783a0fe8e9b32262e295bb25c20bb63 100644 (file)
@@ -64,7 +64,7 @@ Text_item::print (SCM grob)
   Grob * me = unsmob_grob (grob);
   
   SCM t = me->get_property ("text");
-  SCM chain = Font_interface::font_alist_chain (me);
+  SCM chain = Font_interface::text_font_alist_chain (me);
   return interpret_markup (me->get_paper ()->self_scm (), chain, t);
 }
 
index 77321cbf6e44a6ae8835dfd040cbc854da524f44..e7e75c3351c4bf29bbde4469b921046dd0a1eae4 100644 (file)
@@ -77,7 +77,7 @@ Text_spanner::print (SCM smob)
   while (flip (&d) != LEFT);
 
 
-  SCM properties = Font_interface::font_alist_chain (me);
+  SCM properties = Font_interface::text_font_alist_chain (me);
   SCM edge_text = me->get_property ("edge-text");
   Drul_array<Stencil> edge;
   if (gh_pair_p (edge_text))
index b92028b161e018ef3c56f30c110a83b0d08a08cc..7d414ab26841e28afa1e85e0cc07f285d2388bc2 100644 (file)
@@ -100,14 +100,13 @@ Time_signature::special_time_signature (Grob *me, SCM scm_style, int n, int d)
 Stencil
 Time_signature::numbered_time_signature (Grob*me,int num, int den)
 {
-  SCM chain = Font_interface::font_alist_chain (me);
-  me->set_property ("font-family", ly_symbol2scm ("number"));
-
-SCM sn =
-    Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
+  SCM number_def = scm_list_1 (gh_cons (ly_symbol2scm ("font-encoding"),
+                                       ly_symbol2scm ("number")));
+                                       
+  SCM chain = me->get_property_alist_chain (number_def);
+  SCM sn = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
                                 scm_makfrom0str (to_string (num).to_str0 ()));
-SCM sd =
-    Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
+  SCM sd = Text_item::interpret_markup (me->get_paper ()->self_scm (), chain,
                                 scm_makfrom0str (to_string (den).to_str0 ()));
 
   Stencil n = *unsmob_stencil (sn);
index be0e0a2294fcd9bbb2ae4bc6627439c0bba442e2..2ef78c968c35010eeee79ccc30cdca6a2b27e599 100644 (file)
@@ -171,7 +171,7 @@ Tuplet_bracket::print (SCM smob)
   Paper_def *pap = me->get_paper ();
   if (gh_string_p (number) && number_visibility)
     {
-      SCM properties = Font_interface::font_alist_chain (me);
+      SCM properties = Font_interface::text_font_alist_chain (me);
       SCM snum = Text_item::interpret_markup (pap->self_scm (), properties, number);
       Stencil num = *unsmob_stencil (snum);
       num.align_to (X_AXIS, CENTER);
index 0a119daeb7e7ccef6b6f2bc7fb788098e95a3a21..6293006cac111cfa11c09c18782d7ef73ee0bc43 100644 (file)
@@ -45,19 +45,22 @@ melismaEnd = #(make-span-event 'ManualMelismaEvent STOP)
 
 % Do units first; must be done before any units are specified.
 \paper {
-    unit = "mm"  %% ugh: coupled to LilyPond C++ code.
+    unit = #(ly:unit)
     mm = 1.0
     in = 25.4
     pt = #(/  in 72.27)
     cm = #(* 10 mm)
 
     #(define font-defaults
-      '((font-family . music)
-       (font-shape . upright)
+      '((font-encoding . music))
+      )
+
+    #(define text-font-defaults
+      '((font-encoding . text)
        (baseline-skip . 2)
        (word-space . 0.6)
-       (font-series . medium)
-    ))
+       ))
+
     
     \include "engraver-init.ly"
 }
index 9329701c04280c9d2f0d2a60dbf9b9199e0a623f..3b9e77530dd386196861351e4673276861e85917 100644 (file)
@@ -423,7 +423,7 @@ L1 is copied, L2 not.
        "beam.scm"
        "clef.scm"
        "slur.scm"
-       "font.scm"
+;       "font.scm"
        "new-font.scm"
        
        "define-markup-commands.scm"
index e131ea4256c755910992ec6c178285d0d32eaf84..d378c82842ee2d7a26c697d20f125ed427974b97 100644 (file)
@@ -1,5 +1,3 @@
-
-
 ;; As an excercise, do it with records.
 ;; Should use GOOPS, really.
 
       (display node port))))
   )
 
-(define-public (scale-font-node node factor)
-  (cond
-   ((font-tree-node? node)
-    (hash-for-each (lambda (k v)
-                    (scale-font-tree v factor)
-                    (font-tree-children node))))
-   (else
-    (cons (* factor (car node))
-         (cdr node)))))
-
 (define-public (lookup-font node alist-chain)
   (cond
    ((font-tree-node? node)
                   desired-font
                   (lookup-font (hashq-ref (font-tree-children node)
                                           def) alist-chain)))
-        
         )
       
       font))
    (else node))
    )
 
-
-(define-public paper20-font-tree (make-font-tree-node 'font-encoding 'music))
-
-
-
-(add-font
- paper20-font-tree
- '((font-encoding . number))
- '(10 . #((4.0  . "feta-nummer4")
-        (6.0  . "feta-nummer6")
-        (8.0  . "feta-nummer8")
-        (10.0  . "feta-nummer10")
-        (12.0  . "feta-nummer12")
-        (16.0  . "feta-nummer16"))))
-
-(add-font
- paper20-font-tree
- '((font-encoding . dynamic))
- '(14.0 .  #((6.0 . "feta-din6")
-           (8.0 . "feta-din8")
-           (10.0 . "feta-din10")
-           (12.0 . "feta-din12")
-           (14.0 . "feta-din14")
-           (17.0 . "feta-din17")
-           )))
-
-    (use-modules (ice-9 readline))
-
-
-
-(for-each
- (lambda (x)
-   (add-font
-    paper20-font-tree
-    `((font-encoding . text)
-      (font-series . ,(vector-ref (car x) 0))
-      (font-shape . ,(vector-ref (car x) 1))
-      (font-family . ,(vector-ref (car x) 2)))
-    (cdr x))
-   )
- '(
-   (#(roman upright medium) .
-    (10.0 . #((6.0 . "cmr6")
-             (8.0 . "cmr8") 
-             (10.0 . "cmr10")
-             (17.0 . "cmr17")
-             )))
-   
-  
-
-   (#(roman upright bold) .
-    (10.0 . #((6.0 . "cmbx6")
-             (8.0 . "cmbx8")
-             (10.0 . "cmbx10")
-             (12.0 . "cmbx12")
-             )))
-  
-   (#(roman italic medium) .
-    (10.0 . #((7.0 . "cmti7")
-             (10.0 . "cmti10")
-             (12.0 . "cmti12")
-             )))
-   (#(roman italic bold) .
-    (10.0 . #((8.0 . "cmbxti8")
-             (10.0 . "cmbxti10")
-             (14.0 . "cmbxti14")
-             )))
+(define-public (make-font-tree factor)
+  (let*
+      ((n (make-font-tree-node 'font-encoding 'music))
+       )
     
-   (#(roman caps medium) .
-    (10.0 . #((10.0 . "cmcsc10"))))
-
-   (#(roman upright bold-narrow ) .
-    (10.0 . #((10.0 . "cmb10")
-             )))
-   
-   (#(sans upright medium) .
-    (10.0  . #((8.0 . "cmss8")
-              (10.0 . "cmss10")
-              (12.0 . "cmss12")
-              (17.0 . "cmss17")
-              )))
-   (#(typewriter upright medium) .
-    (10.0 . #((8.0 .  "cmtt8")
-             (10.0 . "cmtt10")
-             (12.0 . "cmtt12")
-             )))
-   ))
-
-
-
-(add-font
- paper20-font-tree
- '((font-encoding . math))
- '(10.0 . #((10.0 . "msam10"))))
-
-(add-font
- paper20-font-tree
- '((font-encoding . music))
- '(20.0 . #((11.22 . ("feta11" "parmesan11"))
-           (12.60 . ("feta13" "parmesan13"))
-           (14.14 . ("feta14" "parmesan14"))
-           (15.87 . ("feta16" "parmesan16"))
-           (17.82 . ("feta18" "parmesan18"))
-           (20.0 . ("feta20" "parmesan20"))
-           (22.45 . ("feta23" "parmesan23"))
-           (25.20 . ("feta26" "parmesan26"))
-           )))
-
-(add-font
- paper20-font-tree
- '((font-encoding . braces))
- '(10 . #((10.0 . ("feta-braces00"
-                 "feta-braces10"
-                 "feta-braces20"
-                 "feta-braces30"
-                 "feta-braces40"
-                 "feta-braces50"
-                 "feta-braces60"
-                 "feta-braces70"
-                 "feta-braces80"))
-        )))
-
-
-(display-font-node paper20-font-tree )
-
-(if #f
-    (begin
-      (newline)
-      (display
-       (lookup-font
-       paper20-font-tree
-       '(((font-encoding . text)
-          (font-shape . italic)
-          ))))
-      (newline)
-      ))
-
-
-
-
-
-(define (scale-font-tree root factor)
-  "Scale ROOT with FACTOR."
-  (cond
-   ((and (font-tree-node? node)
-        (equal? (font-tree-qualifier node) 'font-encoding))
-    (hash-for-each (lambda (k v)
-                    (if (not (equal? k 'braces))
-                        (scale-font-node v factor))
-                    (font-tree-children node))))
-   (else
-    (scale-font-node node))))
+    (for-each
+     (lambda (x)
+       (add-font n
+                (list (cons 'font-encoding (car x)))
+                (cons (* factor (cadr x))
+                      (caddr x))))
+     '((number 10 #((4.0  . "feta-nummer4")
+                   (6.0  . "feta-nummer6")
+                   (8.0  . "feta-nummer8")
+                   (10.0  . "feta-nummer10")
+                   (12.0  . "feta-nummer12")
+                   (16.0  . "feta-nummer16")))
+       (dynamic 14.0  #((6.0 . "feta-din6")
+                       (8.0 . "feta-din8")
+                       (10.0 . "feta-din10")
+                       (12.0 . "feta-din12")
+                       (14.0 . "feta-din14")
+                       (17.0 . "feta-din17")
+                       ))
+       (math 10 #((10.0 . "msam10")))
+       (music 20.0
+             #((11.22 . ("feta11" "parmesan11"))
+               (12.60 . ("feta13" "parmesan13"))
+               (14.14 . ("feta14" "parmesan14"))
+               (15.87 . ("feta16" "parmesan16"))
+               (17.82 . ("feta18" "parmesan18"))
+               (20.0 . ("feta20" "parmesan20"))
+               (22.45 . ("feta23" "parmesan23"))
+               (25.20 . ("feta26" "parmesan26"))
+               ))
+       (braces 10 #((10.0 . ("feta-braces00"
+                             "feta-braces10"
+                             "feta-braces20"
+                             "feta-braces30"
+                             "feta-braces40"
+                             "feta-braces50"
+                             "feta-braces60"
+                             "feta-braces70"
+                             "feta-braces80"))
+                    ))))
+
+    (for-each
+     (lambda (x)
+       (add-font
+       n
+       `((font-encoding . text)
+         (font-series . ,(vector-ref (car x) 0))
+         (font-shape . ,(vector-ref (car x) 1))
+         (font-family . ,(vector-ref (car x) 2)))
+       (cons (* factor (cadr x))
+             (cddr x))
+       ))
+     '((#(roman upright medium) .
+       (10.0 . #((6.0 . "cmr6")
+                 (8.0 . "cmr8") 
+                 (10.0 . "cmr10")
+                 (17.0 . "cmr17")
+                 )))
+
+       (#(roman upright bold) .
+       (10.0 . #((6.0 . "cmbx6")
+                 (8.0 . "cmbx8")
+                 (10.0 . "cmbx10")
+                 (12.0 . "cmbx12")
+                 )))
+       
+       (#(roman italic medium) .
+       (10.0 . #((7.0 . "cmti7")
+                 (10.0 . "cmti10")
+                 (12.0 . "cmti12")
+                 )))
+       (#(roman italic bold) .
+       (10.0 . #((8.0 . "cmbxti8")
+                 (10.0 . "cmbxti10")
+                 (14.0 . "cmbxti14")
+                 )))
+       
+       (#(roman caps medium) .
+       (10.0 . #((10.0 . "cmcsc10"))))
 
-    
+       (#(roman upright bold-narrow ) .
+       (10.0 . #((10.0 . "cmb10")
+                 )))
+       
+       (#(sans upright medium) .
+       (10.0  . #((8.0 . "cmss8")
+                  (10.0 . "cmss10")
+                  (12.0 . "cmss12")
+                  (17.0 . "cmss17")
+                  )))
+       (#(typewriter upright medium) .
+       (10.0 . #((8.0 .  "cmtt8")
+                 (10.0 . "cmtt10")
+                 (12.0 . "cmtt12")
+                 )))
+       ))
+    n))
 
index 1f70e44e62d469df4f8cb891faaa317cf23b6498..805e5711242aa9560e556c3ad4f898cd4803bbca 100644 (file)
 (define (tablature-stem-attachment-function style duration)
   (cons 0.0 0.5))
 
-; The TabNoteHead stencil callback.
-; Create a text stencil
-(define-public (tablature-print-function grob)
-  (let ((stencil (fontify-text
-                   (ly:get-default-font grob)
-                   (ly:grob-property grob 'text)
-                   )))
-    stencil ; return the stencil.
-    ))
 
 ; The TabNoteHead tablatureFormat callback.
 ; Compute the text grob-property
                        (else "")))
                                    
          )
-    (let ((slur (Slur::print grob))
-          (text (fontify-text (ly:get-default-font grob) letter)))
+    (let* ((slur (Slur::print grob))
+          (paper (ly:grob-paper grob))
+          (text (interpret-markup
+                 paper
+                 (ly:grob-alist-chain grob (ly:paper-lookup paper 'text-font-defaults))
+                 letter)))
     
       (let ((x (/ (- (cdr (ly:stencil-extent slur 0)) 
                      (/ (cdr (ly:stencil-extent text 0)) 2.0)
index 3cbed697c54277add11e2e21d7082e2a08af6b52..83e0bdb1660d0f68394a6945488867e9d1150739 100644 (file)
@@ -21,8 +21,8 @@
   
   (let ((props (list (append `((linewidth . ,(ly:paper-get-number
                                              paper 'linewidth))
-                              (font-family . roman))
-                            (ly:paper-lookup paper 'font-defaults)))))
+                              )
+                            (ly:paper-lookup paper 'text-font-defaults)))))
     (interpret-markup
      paper props
      (markup
index 3cbc1417843b08de766ce3f3c6f14d439a96c682..a52b24d67257f099cd388f05b5a9a06f52e12fc6 100644 (file)
@@ -12,7 +12,8 @@
         (pt (eval 'pt m)) 
         (mm (eval 'mm m)))
    
-    (module-define! m 'fonts (scale-font-list (/  sz (* 20 pt))))
+    (module-define! m 'fonts (make-font-tree (/  sz (* 20 pt))))
+    
     (module-define! m 'staffheight sz)
     (module-define! m 'staff-space ss)
     (module-define! m 'staffspace ss)