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-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
@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
@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}
@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
<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)
\Staff
minimumVerticalExtent = #'(-3. . 6)
}
- inputencoding = #"latin1"
}
\midi {
\tempo 4 = 70
}
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);
}
Lyric_engraver::Lyric_engraver ()
{
- text_ =0;
- event_ =0;
+ text_ = 0;
+ event_ = 0;
}
bool
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 ())
{
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"),
coding_description_ = scm_acons (ly_symbol2scm ("output-table"),
coding_table_,
coding_description_);
-
coding_description_ = scm_acons (ly_symbol2scm ("char-mapping"),
coding_mapping_,
coding_description_);
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);
b = tex_kludge (text);
}
else if (coding_scheme_ == "ASCII"
+ || coding_scheme_ == ""
|| coding_scheme_ == orig_->coding_scheme ())
{
Interval ydims;
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");
|| 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;
\context{
\type "Engraver_group_engraver"
- \consists "Hara_kiri_engraver"
minimumVerticalExtent = #'(-1.2 . 2.4)
extraVerticalExtent = ##f
verticalExtent = ##f
\consists "Vocal_name_engraver"
\consists "Skip_event_swallow_translator"
\consists "Font_size_engraver"
+ \consists "Hara_kiri_engraver"
\override SeparationItem #'padding = #0.2
}
;; 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.
#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))))
(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 "