]> git.donarmstrong.com Git - lilypond.git/commitdiff
(markup): take encoding from lexer.
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 9 Apr 2004 22:35:54 +0000 (22:35 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Fri, 9 Apr 2004 22:35:54 +0000 (22:35 +0000)
ChangeLog
input/test/title-markup.ly
lily/include/my-lily-lexer.hh
lily/my-lily-lexer.cc
lily/parser.yy

index d072246ac0e2e6021683da8860ce32f81e2765af..3eac569face82eb5df28b4cc201322b999d9c5c5 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2004-04-10  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * lily/parser.yy (markup): take encoding from lexer.
+
 2004-04-09  Jan Nieuwenhuizen  <janneke@gnu.org>
 
        * lily/kpath.cc (kpathsea_find_tfm): Do not trigger TMF generation.
@@ -6,6 +10,8 @@
 
 2004-04-09  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
+       * lily/kpath.cc (kpathsea_find_tfm): don't make unfound TFMs/AFMs.
+
        * Documentation/user/lilypond.tely (Top): manual for v2.3 (backportme)
 
 2004-04-09  Jan Nieuwenhuizen  <janneke@gnu.org>
@@ -20,8 +26,6 @@
        * scripts/convert-ly.py: limited old-style markup convert. (Thanks
        to Erik Sandberg) 
 
-       * Documentation/user/lilypond.tely (Top): update,  
-
        * lily/font-metric.cc (LY_DEFINE): new function, return fontName.
 
        * scm/output-ps.scm (define-fonts): remove hack for feta/parmesan.
index 8382a9b2c6d21d872a0555aa9c72aa57335cccb1..6cc1f21b3d847c32c6bd4d8120cede08852c7c77 100644 (file)
@@ -1,4 +1,5 @@
 \version "2.2.0"
+
 %{
    Experimental markup titles are available in direct PostScript output:
 
@@ -11,14 +12,17 @@ PostScript fonts: WIP.
   * Nonstandardised install directory / how to locate a ps font?
   * Nonstandardised filenames?
 
+
 For century schoolbook font:
 
   Debian:
     cp -pv /usr/share/fonts/type1/gsfonts/c*.{afm,pfb} mf/out
 
   Red Hat (untested):
-    cp -pv /usr/share/fonts/afms/adobe/c*.afm mf/out/
-    cp -pv /usr/share/fonts/default/ghostscript/c*.pfb mf/out
+
+    cp -pv /usr/share/fonts/afms/adobe/c*.{afm,pfb} mf/out/
+
+    cp -pv /usr/share/fonts/default/Type1/c*.{pfb,afm} mf/out
 
 %}
 
index e8aa8c10b87f903e34326b720d1cbe26bf7bd25a..600e3dec3fcaf961a0c26ccd2aa329a4060d499d 100644 (file)
@@ -28,9 +28,9 @@ void set_lexer ();
 class My_lily_lexer : public Includable_lexer 
 {
   Protected_scm scopes_;
+  Protected_scm encoding_;
 public:
   String main_input_name_;
-  String encoding_;
   void *lexval;
   bool main_input_b_;
 
@@ -65,6 +65,7 @@ public:
   void pop_state ();
   void LexerError (char const *);
   void set_encoding (String);
+  SCM encoding () const;
   void set_identifier (SCM name_string, SCM);
   bool is_note_state () const;
   bool is_chord_state () const;
index d957e4b3defdf291f19b763fcd1c4c3dcfa22e94..242167bf5f26766f26fddcfae89a47c567d22a6b 100644 (file)
@@ -95,7 +95,7 @@ static Keyword_ent the_key_tab[] = {
 My_lily_lexer::My_lily_lexer ()
 {
   keytable_ = new Keyword_table (the_key_tab);
-
+  encoding_ = SCM_EOL;
   chordmodifier_tab_ = scm_make_vector (scm_int2num (1), SCM_EOL);
   pitchname_tab_stack_ = SCM_EOL; 
   
@@ -107,6 +107,12 @@ My_lily_lexer::My_lily_lexer ()
   main_input_b_ = false;
 }
 
+SCM
+My_lily_lexer::encoding () const
+{
+  return encoding_ ;
+}
+
 void
 My_lily_lexer::add_scope (SCM module)
 {
@@ -240,5 +246,5 @@ My_lily_lexer::prepare_for_next_token ()
 void
 My_lily_lexer::set_encoding (String s)
 {
-  encoding_ = s;
+  encoding_ = ly_symbol2scm (s.to_str0 ());
 }
index 0a32cc0322576676dcd14fd039514bd6c3fbf8a9..347c3445c0e32c027a7aa0612bc938bb81cc8445 100644 (file)
@@ -103,18 +103,18 @@ is_regular_identifier (SCM id)
 }
 
 SCM
-make_simple_markup (SCM a)
+make_simple_markup (SCM encoding, SCM a)
 {
        SCM simple = ly_scheme_function ("simple-markup");
-       SCM markup = scm_list_2 (simple, a);
-#if 0
-       if (THIS->lexer_->encoding_ != "")
-               return scm_list_2
-                       (scm_cons (ly_scheme_function ("encoding"),
-                        scm_makfrom0str (THIS->lexer_->encoding_.to_str0 ())),
-                       markup);
-#endif
-return markup;
+       SCM markup = 
+       if (gh_symbol_p (encoding))
+       {
+               return scm_list_3 (ly_scheme_function ("encoded-simple-markup"),
+                          encoding, a);
+       } else
+               return scm_list_2 (simple, a);
+
+       return markup;
 }
 
 
@@ -1756,7 +1756,7 @@ gen_text_def:
        }
        | string {
                Music *t = MY_MAKE_MUSIC ("TextScriptEvent");
-               t->set_property ("text", make_simple_markup ($1));
+               t->set_property ("text", make_simple_markup (THIS->lexer_->encoding (), $1));
                t->set_spot (THIS->here_input ());
                $$ = t;
        
@@ -2286,7 +2286,7 @@ This should be done more dynamically if possible.
 */
 markup:
        STRING {
-               $$ = make_simple_markup ($1);
+               $$ = make_simple_markup (THIS->lexer_->encoding (), $1);
        }
        | MARKUP_HEAD_EMPTY {
                $$ = scm_list_1 ($1);