]> git.donarmstrong.com Git - lilypond.git/commitdiff
* Documentation/user/changing-defaults.itely (Text encoding): node
authorhanwen <hanwen>
Thu, 29 Jul 2004 22:53:52 +0000 (22:53 +0000)
committerhanwen <hanwen>
Thu, 29 Jul 2004 22:53:52 +0000 (22:53 +0000)
on encoding.

* lily/lyric-engraver.cc (try_music): remove superfluous check.

* lily/book-paper-def.cc (find_scaled_font): remove default
encoding. This messes up font loading for feta and
parmesan. Encoding should only be specified for running texts.

* lily/modified-font-metric.cc (text_dimension): support coding
scheme ""

13 files changed:
ChangeLog
Documentation/topdocs/INSTALL.texi
Documentation/user/changing-defaults.itely
input/mutopia/F.Schubert/morgenlied.ly
lily/book-paper-def.cc
lily/lyric-engraver.cc
lily/modified-font-metric.cc
lily/stem.cc
lily/text-item.cc
ly/engraver-init.ly
scm/define-grobs.scm
scm/framework-ps.scm
scm/output-ps.scm

index 991b89c24e45f5331e91d29e5fdff4041f628c5b..9431b4a280c541c5f897ee8a9f23da197330edba 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,17 @@
+2004-07-30  Han-Wen Nienhuys   <hanwen@xs4all.nl>
+
+       * Documentation/user/changing-defaults.itely (Text encoding): node
+       on encoding.
+
+       * lily/lyric-engraver.cc (try_music): remove superfluous check.
+
+       * lily/book-paper-def.cc (find_scaled_font): remove default
+       encoding. This messes up font loading for feta and
+       parmesan. Encoding should only be specified for running texts.
+
+       * lily/modified-font-metric.cc (text_dimension): support coding
+       scheme ""
+       
 2004-07-28  Han-Wen Nienhuys   <hanwen@xs4all.nl>
 
        * lily/tie-engraver.cc (stop_translation_timestep): remember tie
index 9257dd8fecf818492fb58c799b9786078b8c34eb..2191ac4fcae778906ead92ac499f126f56c64d73 100644 (file)
@@ -113,6 +113,9 @@ newer).  EGCS and 2.x are known to cause crashes.
 
 @item @uref{http://www.gnu.org/software/bison/,Bison} (version 1.25 or
 newer, but not 1.50 or 1.75).
+
+@item gettext
+
 @end itemize
 
 @subsection Running requirements
index e3880d7d6281c97d9eb1997edf5d0ae6d0731dce..4668b12057766cd065d6ce4991460ede33e540bc 100644 (file)
@@ -1512,11 +1512,11 @@ all three mechanisms work for every object that supports
 
 @itemize @bullet
 @item @code{font-encoding}
-is a symbol that sets layout of the glyphs. Choices include
-@code{text} for normal text, @code{braces} (for piano staff braces),
-@code{music} (the standard music font, including ancient glyphs),
-@code{dynamic} (for dynamic signs) and @code{number} for the number
-font.
+is a symbol that sets layout of the glyphs. Choices include @code{ec}
+for @TeX{} EC font encoding, @code{fetaBraces} (for piano staff
+braces), @code{fetaMusic} (the standard music font, including ancient
+glyphs), @code{fetaDynamic} (for dynamic signs) and @code{fetaNumber}
+for the number font.
 
 
 @item @code{font-family}
@@ -1673,12 +1673,50 @@ for formatting.
 
 
 @menu
+* Text encoding::               
 * Overview of text markup commands::  
 @end menu
 
+@node Text encoding
+@subsection Text encoding
+
+Texts can be entered in different encodings.  The encoding of the
+file can be set with @code{\encoding}.
+
+@example
+  \encoding "latin1"
+@end example
+
+This command may be placed anywhere in the input file. The current
+encoding is passed as an extra argument to @code{\markup} commands.
+
+If no @code{\encoding} has been specified, then the encoding is taken
+from the @code{\paper} block (or @code{\bookpaper}, if @code{\paper}
+does not specify encoding). The variable @code{inputencoding} may be
+set to a string or symbol specifying  the encoding, eg.
+
+@example
+  \paper {
+    inputencoding = "latin1"
+  } 
+@end example
+
+There is a special encoding, called @code{TeX}. This encoding does not
+reencode text for the font used. Rather, it tries to guess the width
+of @TeX{} commands, such as @code{\"}. Strings encoded with @code{TeX}
+are passed to the output back-end verbatim.
+
+@cindex encoding
+@cindex @code{\encoding}
+@cindex inputencoding
+@cindex @TeX{} commands in strings
+
+
+
+
 @node  Overview of text markup commands
 @subsection Overview of text markup commands
-
+}
 @include markup-commands.tely
 
 
index 99e423580574e0cb34db45d25552c0e9265f65f6..0d6fbd24c8b2e4ad69d79d38882e521dc6d309b9 100644 (file)
@@ -149,8 +149,7 @@ pianoLH =  \relative c'' \repeat volta 2 {
     <c e g> r r <c, c,>8 r r\fermata \clef treble
     }
 \book {
-\score {
-
+  \score {
     << \time 6/8
      \new Staff <<
         \context Staff #(set-accidental-style 'modern)
@@ -185,7 +184,6 @@ pianoLH =  \relative c'' \repeat volta 2 {
            \Staff
            minimumVerticalExtent = #'(-3. . 6)
        }
-       inputencoding = #"latin1"
     }
     \midi {
        \tempo 4 = 70
index 95d7114dc25757884f1b7fd52b5523e3268289ee..0dfe5fb1514b75a78427a57bcad4cefb0aea15e4 100644 (file)
@@ -78,16 +78,6 @@ find_scaled_font (Output_def *mod,
     }
   else
     {
-      if (!ly_c_symbol_p (input_enc_name))
-       {
-         SCM var = ly_module_lookup (mod->scope_,
-                                     ly_symbol2scm ("inputencoding"));
-         if (var != SCM_BOOL_F) 
-           input_enc_name = scm_variable_ref (var);
-         if (!ly_c_symbol_p (input_enc_name))
-           input_enc_name = ly_symbol2scm ("latin1"); 
-       }
-
       val = Modified_font_metric::make_scaled_font_metric (input_enc_name,
                                                           f, lookup_mag);
     }
index d7f0c3b350dad5ec207dfaae872ec4781b68cde9..6b4ac2309a92729cd65315a5abc14bd13e9ba2d1 100644 (file)
@@ -36,8 +36,8 @@ private:
 
 Lyric_engraver::Lyric_engraver ()
 {
-  text_ =0;
-  event_ =0;
+  text_ = 0;
+  event_ = 0;
 }
 
 bool
index 016887b9dfa223b5397a74312066ba2859094885..547756b1f464044d2ba695a18f12a2acc1133b75 100644 (file)
@@ -31,8 +31,9 @@ Modified_font_metric::Modified_font_metric (String coding, Font_metric* m, Real
   
   description_ = scm_cons (ly_car (desc), scm_make_real (total_mag));
   orig_ = m;
-
-  if (coding_scheme_ != "TeX"
+  
+  if (coding_scheme_ != "" 
+      && coding_scheme_ != "TeX"
       && coding_scheme_ != "ASCII"
       && coding_scheme_ !=  orig_->coding_scheme ())
     {
@@ -54,11 +55,9 @@ Modified_font_metric::Modified_font_metric (String coding, Font_metric* m, Real
                                         coding_table_);
 
       coding_description_= SCM_EOL;
-
       coding_description_ = scm_acons (ly_symbol2scm ("input-name"),
                                       scm_makfrom0str (coding_scheme_.to_str0 ()),
                                       coding_description_);
-
       coding_description_ = scm_acons (ly_symbol2scm ("input-vector"),
                                       coding_vector_, coding_description_);
       coding_description_ = scm_acons (ly_symbol2scm ("output-name"),
@@ -67,7 +66,6 @@ Modified_font_metric::Modified_font_metric (String coding, Font_metric* m, Real
       coding_description_ = scm_acons (ly_symbol2scm ("output-table"),
                                       coding_table_,
                                       coding_description_);
-      
       coding_description_ = scm_acons (ly_symbol2scm ("char-mapping"),
                                       coding_mapping_,
                                       coding_description_);
@@ -94,12 +92,12 @@ SCM
 Modified_font_metric::make_scaled_font_metric (SCM coding, Font_metric *m, Real s)
 {
   /*
-    UGOHR.
+    UGH.
    */
   if (ly_c_symbol_p (coding))
     coding = scm_symbol_to_string (coding);
   
-  String scheme = ly_scm2string (coding);
+  String scheme = ly_c_string_p (coding) ? ly_scm2string (coding) : ""; 
   
   Modified_font_metric *sfm = new Modified_font_metric (scheme, m, s);
   
@@ -238,6 +236,7 @@ Modified_font_metric::text_dimension (String text)
       b = tex_kludge (text);
     }
   else if (coding_scheme_ == "ASCII"
+          || coding_scheme_ == "" 
           || coding_scheme_ ==  orig_->coding_scheme ())
     {
       Interval ydims;
index c15682728ee13dc3a4957fdcbf59249f94b528e4..5aa88448492b8452b70544c76ba732ed0bc14708 100644 (file)
@@ -787,8 +787,10 @@ Stem::calc_stem_info (Grob *me)
     ly_scm2double (robust_list_ref (beam_count - 1,lengths))
                
     * staff_space
-    /* stem only extends to center of beam */
-    - 0.5 * beam_thickness;
+    /* stem only extends to center of beam
+    */
+    - 0.5 * beam_thickness
+    ;
 
   /* Condition: sane minimum free stem length (chord to beams) */
   lengths = me->get_property ("beamed-minimum-free-lengths");
index d472c1798066ea84cfffde4a42f126bf40384235..bdeb54c017b9b6c52104d419c9bea740209fa76d 100644 (file)
@@ -28,6 +28,14 @@ Text_item::interpret_string (SCM paper, SCM props, SCM encoding, SCM markup)
                  || ly_c_symbol_p (encoding), encoding, SCM_ARG2, __FUNCTION__, "symbol");
   
   String str = ly_scm2string (markup);
+  if (!ly_c_symbol_p (encoding))
+    {
+      SCM var = ly_module_lookup (pap->scope_,
+                                 ly_symbol2scm ("inputencoding"));
+      if (var != SCM_BOOL_F) 
+       input_enc_name = scm_variable_ref (var);
+    }
+  
   Font_metric *fm = select_encoded_font (pap, props, encoding);
 
   SCM lst = SCM_EOL;      
index d86a92ee18262755fa5d1e2aa110f8518fd64849..1c9ddec64269e9af47368209defce70e0a4e2233 100644 (file)
@@ -313,7 +313,6 @@ connected vertically.  "
 
 \context{
     \type "Engraver_group_engraver"
-    \consists "Hara_kiri_engraver"
     minimumVerticalExtent = #'(-1.2 . 2.4)
     extraVerticalExtent = ##f
     verticalExtent = ##f
@@ -330,6 +329,7 @@ printing of a single line of lyrics.  "
     \consists "Vocal_name_engraver"
     \consists "Skip_event_swallow_translator"
     \consists "Font_size_engraver"
+    \consists "Hara_kiri_engraver"
     \override SeparationItem #'padding = #0.2
 }
 
index 890b0b30122e83e9a868643773f3db057586fc3a..26590d342281a03a7175d320f773cb4ccb4d9ef6 100644 (file)
        ;; FIXME this should come from 'lengths
 
        (beamed-lengths . (3.26 3.26 1.5))
-;      (beamed-lengths . (3.5 3.5 3.5 4.5 5.0))
        
        ;; We use the normal minima as minimum for the ideal lengths,
        ;; and the extreme minima as abolute minimum length.
index 0dd4ba0c447306c45f6a99ae9503d027d759893c..0c96ee1cdd958df7859b58d02002e0c2c58adb50 100644 (file)
                                 #f font-encoding)
                             (car override-coding))))
 
-    ;; FIXME:  now feta stuff has feta* input-encoding (again?)
-    ;;(format (current-error-port) "FONT: ~S, ~S\n" name font-encoding)
-    ;;(format (current-error-port) "INPUT: ~S\n" input-encoding)
-    (if (and coding-command
-            (or
-             (equal? (substring coding-command 0 4) "feta")
-             (equal? (substring coding-command 0 8) "parmesan")
-
-            ))
-       (set! coding-command #f))
-
     (string-append
      "magfont" (string-encode-integer (hashq  name 1000000))
      "m" (string-encode-integer (inexact->exact (round (* 1000 magnify))))
index b5a5446a32e687a74fd99792cd7e4a26f0568f1f..35d850a3440312d3db16ab222bcd96b1686c8b0e 100644 (file)
 (define (text font s)
   (let*
       
-      (
-       ;; ugh, we should find a better way to
-       ;; extract the hsbw for /space from the font.
-       
-       (space-length (cdar (ly:text-dimension font "t"))) 
+      ;; ugh, we should find a better way to
+      ;; extract the hsbw for /space from the font.
+      
+      ((space-length (cdar (ly:text-dimension font "t"))) 
        (commands '())
        (add-command (lambda (x) (set! commands (cons x commands)))) )
 
           (add-command 
            (string-append "(" (ps-encoding word) ") show\n")))
 
-       (if (equal? #\space  chr)
+       (if (equal? #\space chr)
           (add-command  (string-append (number->string space-length) " 0.0 rmoveto ")) )
        
-       (if (equal? #\space  chr)
+       (if (equal? #\space chr)
           ""
           (string-append word (make-string 1 chr))))
      ""
-     (string-append  s " "))
+     (string-append s " "))
 
     (string-append
      (ps-font-command font) " setfont "
      (string-join (reverse commands)))
     ))
-  
+
 
 (define (white-text scale s)
    (let ((mystring (string-append "(" s  ") " (number->string scale)   " /Helvetica-bold "