+2004-08-13 Jan Nieuwenhuizen <janneke@gnu.org>
+
+ * lily.scm: Mark un-internationlised user messages (with FIXME).
+
+ * lily/include/modified-font-metric.hh (struct
+ Modified_font_metric): New file. (WAS: incorrectly named
+ scaled-font-metric.hh ?)
+
+ * lily/include/scaled-font-metric.hh: Remove.
+
+ * lily/text-item.cc (interpret_string): Identify and document
+ input-encoding problem.
+
+ * lily/paper-book.cc (pages): Do not use `paper' as variable name
+ for a Bookpaper.
+
+ * tex/latin1.enc: Replace /minus with /hyphen. WL says that's the
+ latin1 name.
+
+ * scm/encoding.scm: For latin1 (input-)encoding, use
+ latin1. (Cork.enc is NOT latin1 -- see man latin1).
+
+ * ly/book-paper-defaults.ly: Add a comment about suspicious TeX
+ inputencoding.
+
2004-08-12 Heikki Junes <hjunes@cc.hut.fi>
* Documentation/topdocs/INSTALL.html: fixes.
#include "font-metric.hh"
#include "ly-module.hh"
#include "output-def.hh"
-#include "scaled-font-metric.hh"
+#include "modified-font-metric.hh"
#include "virtual-font-metric.hh"
Real
void
Dynamic_engraver::typeset_all ()
{
+ /* Simplistic slur collision handling. This fixes simple collisions
+ like
+
+ a\p( b)
+
+ which are unacceptable, but it most probably breaks for more
+ interesting cases. Maybe make a new colission engraver. */
if (finished_line_spanner_ && slur_
&& get_slur_dir (slur_) == get_grob_direction (finished_line_spanner_))
{
(c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Mats Bengtsson <matsb@s3.kth.se> (the ugly TeX parsing in text_dimension)
- */
+*/
#include <math.h>
#include <ctype.h>
-#include "scaled-font-metric.hh"
+#include "modified-font-metric.hh"
#include "virtual-methods.hh"
#include "warn.hh"
#include "stencil.hh"
#include "warn.hh"
LY_DEFINE (ly_paper_get_font, "ly:paper-get-font", 2, 0, 0,
- (SCM paper, SCM chain),
+ (SCM paper_smob, SCM chain),
"Return a font metric satisfying the font-qualifiers "
"in the alist chain @var{chain}.\n"
- "(An alist chain is a list of alists, containing grob properties).\n")
+ "(An alist chain is a list of alists, "
+ "containing grob properties).\n")
{
- Output_def *pap = unsmob_output_def (paper);
- SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
+ Output_def *paper = unsmob_output_def (paper_smob);
+ SCM_ASSERT_TYPE (paper, paper_smob, SCM_ARG1,
+ __FUNCTION__, "paper definition");
- Font_metric *fm = select_font (pap, chain);
+ Font_metric *fm = select_font (paper, chain);
return fm->self_scm ();
}
LY_DEFINE (ly_paper_get_number, "ly:paper-get-number", 2, 0, 0,
- (SCM paper, SCM name),
+ (SCM paper_smob, SCM name),
"Return the paper variable @var{name}.")
{
- Output_def *pap = unsmob_output_def (paper);
- SCM_ASSERT_TYPE (pap, paper, SCM_ARG1, __FUNCTION__, "paper definition");
- return scm_make_real (pap->get_dimension (name));
+ Output_def *paper = unsmob_output_def (paper_smob);
+ SCM_ASSERT_TYPE (paper, paper_smob, SCM_ARG1,
+ __FUNCTION__, "paper definition");
+ return scm_make_real (paper->get_dimension (name));
}
bool
wild_compare (SCM field_val, SCM val)
{
- return (val == SCM_BOOL_F || field_val == ly_symbol2scm ("*") || field_val == val);
+ return (val == SCM_BOOL_F
+ || field_val == ly_symbol2scm ("*")
+ || field_val == val);
}
-
/*
TODO: this triggers a great number of font-loads (feta11 upto
parmesan23). We could make a Delayed_load_font_metric for which the
design size is specced in advance.
*/
-Font_metric*
-get_font_by_design_size (Output_def* paper, Real requested,
- SCM font_vector, SCM input_encoding_name)
+Font_metric *
+get_font_by_design_size (Output_def *paper, Real requested,
+ SCM font_vector, SCM input_encoding)
{
int n = SCM_VECTOR_LENGTH (font_vector);
Real size = 1e6;
size = fm->design_size ();
if (size > requested)
- break ;
+ break;
last_size = size;
}
if (i == n)
- {
- i = n-1;
- }
+ i = n - 1;
else if (i > 0)
{
if ((requested / last_size) < (size / requested))
{
- i -- ;
+ i--;
size = last_size;
}
}
- Font_metric *fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector, i)));
- return
- find_scaled_font (paper, fm, requested / size, input_encoding_name);
+ Font_metric *fm = unsmob_metrics (scm_force (SCM_VECTOR_REF (font_vector,
+ i)));
+ return find_scaled_font (paper, fm, requested / size, input_encoding);
}
-
Font_metric*
-get_font_by_mag_step (Output_def* paper, Real requested_step,
- SCM font_vector, Real default_size, SCM input_encoding_name)
+get_font_by_mag_step (Output_def *paper, Real requested_step,
+ SCM font_vector, Real default_size,
+ SCM input_encoding)
{
- return get_font_by_design_size (paper,
- default_size * pow (2.0, requested_step / 6.0),
- font_vector, input_encoding_name);
+ return get_font_by_design_size (paper, default_size
+ * pow (2.0, requested_step / 6.0),
+ font_vector, input_encoding);
}
-
-
SCM
properties_to_font_size_family (SCM fonts, SCM alist_chain)
{
return scm_call_2 (ly_scheme_function ("lookup-font"), fonts, alist_chain);
}
-
Font_metric *
-select_encoded_font (Output_def *paper, SCM chain, SCM encoding_name)
+select_encoded_font (Output_def *paper, SCM chain, SCM input_encoding)
{
SCM name = ly_assoc_chain (ly_symbol2scm ("font-name"), chain);
name = properties_to_font_size_family (fonts, chain);
}
else
- name = ly_cdr (name);
+ name = ly_cdr (name);
if (ly_c_string_p (name))
{
SCM mag = ly_assoc_chain (ly_symbol2scm ("font-magnification"), chain);
-
- Real rmag = ly_c_pair_p (mag) ? robust_scm2double (ly_cdr (mag), 1.0) : 1;
-
- Font_metric * fm = all_fonts_global->find_font (ly_scm2string (name));
-
-
- return find_scaled_font (paper, fm, rmag, encoding_name);
+ Real rmag = (ly_c_pair_p (mag)
+ ? robust_scm2double (ly_cdr (mag), 1.0)
+ : 1);
+ Font_metric *fm = all_fonts_global->find_font (ly_scm2string (name));
+
+ return find_scaled_font (paper, fm, rmag, input_encoding);
}
else if (scm_instance_p (name))
{
SCM vec = scm_slot_ref (name, ly_symbol2scm ("size-vector"));
SCM font_size = ly_assoc_chain (ly_symbol2scm ("font-size"), chain);
- Real req = 0.0;
+ Real req = 0;
if (ly_c_pair_p (font_size))
req = ly_scm2double (ly_cdr (font_size));
- return get_font_by_mag_step (paper, req,
- vec, ly_scm2double (base_size), encoding_name);
+ return get_font_by_mag_step (paper, req, vec, ly_scm2double (base_size),
+ input_encoding);
}
assert (0);
-
return 0;
}
--- /dev/null
+/*
+ modified-font-metric.hh -- declare Font_metric
+
+ source file of the GNU LilyPond music typesetter
+
+ (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
+*/
+
+#ifndef MODIFIED_FONT_METRIC_HH
+#define MODIFIED_FONT_METRIC_HH
+
+#include "font-metric.hh"
+
+/* Perhaps junk this, and move this to paper_def as interface? */
+struct Modified_font_metric : public Font_metric
+{
+public:
+ Box text_dimension (String);
+
+
+ static SCM make_scaled_font_metric (SCM, Font_metric*, Real);
+ virtual int count () const;
+ virtual Offset get_indexed_wxwy (int) const;
+ virtual int name_to_index (String) const;
+ virtual String coding_scheme () const;
+
+ virtual Font_metric * original_font () const;
+
+protected:
+
+ SCM coding_vector_;
+ SCM coding_table_;
+ SCM coding_mapping_;
+ SCM coding_description_;
+ friend SCM ly_font_encoding_alist (SCM);
+
+ virtual Real design_size () const;
+ virtual void derived_mark () const;
+ virtual Box get_indexed_char (int) const;
+ virtual int index_to_ascii (int) const;
+ virtual Box get_ascii_char (int) const;
+ Font_metric *orig_;
+ Real magnification_;
+ String coding_scheme_;
+
+
+ Modified_font_metric (String, Font_metric*, Real);
+ Box tex_kludge (String) const;
+};
+
+#endif /* MODIFIED_FONT_METRIC_HH */
+++ /dev/null
-/*
- scaled-font-metric.hh -- declare Font_metric
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
-
-#ifndef SCALED_FONT_METRIC_HH
-#define SCALED_FONT_METRIC_HH
-
-#include "font-metric.hh"
-
-/* Perhaps junk this, and move this to paper_def as interface? */
-struct Modified_font_metric : public Font_metric
-{
-public:
- Box text_dimension (String);
-
-
- static SCM make_scaled_font_metric (SCM, Font_metric*, Real);
- virtual int count () const;
- virtual Offset get_indexed_wxwy (int) const;
- virtual int name_to_index (String) const;
- virtual String coding_scheme () const;
-
- virtual Font_metric * original_font () const;
-
-protected:
-
- SCM coding_vector_;
- SCM coding_table_;
- SCM coding_mapping_;
- SCM coding_description_;
- friend SCM ly_font_encoding_alist (SCM);
-
- virtual Real design_size () const;
- virtual void derived_mark () const;
- virtual Box get_indexed_char (int) const;
- virtual int index_to_ascii (int) const;
- virtual Box get_ascii_char (int) const;
- Font_metric *orig_;
- Real magnification_;
- String coding_scheme_;
-
-
- Modified_font_metric (String, Font_metric*, Real);
- Box tex_kludge (String) const;
-};
-
-#endif /* SCALED_FONT_METRIC_HH */
score_count_ = 0;
lexer_ = 0;
sources_ = sources;
- default_duration_ = Duration (2,0);
+ default_duration_ = Duration (2, 0);
error_level_ = 0;
last_beam_start_ = SCM_EOL;
void
Lily_parser::parse_string (String ly_code)
{
+#if 0
SCM parent_prot = lexer_ ? lexer_->self_scm () : SCM_EOL;
+#endif
+
Lily_lexer * parent = lexer_;
lexer_ = (parent == 0 ? new Lily_lexer (sources_)
: new Lily_lexer (*parent));
/*
- scaled-font-metric.cc -- declare Modified_font_metric
+ modified-font-metric.cc -- declare Modified_font_metric
source file of the GNU LilyPond music typesetter
(c) 1999--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
-
- */
+*/
#include <ctype.h>
#include "warn.hh"
-#include "scaled-font-metric.hh"
+#include "modified-font-metric.hh"
#include "string.hh"
#include "stencil.hh"
-Modified_font_metric::Modified_font_metric (String coding, Font_metric* m, Real magn)
+Modified_font_metric::Modified_font_metric (String input_encoding,
+ Font_metric *m, Real magn)
{
+ /* UGR, FIXME:
+
+ THIS.coding_scheme == input encoding.
+ ORIG.coding_scheme () == font_encoding.
+
+ encoding is hairy enough by itself, should fix treacherous naming. */
+
+ coding_scheme_ = input_encoding;
+
coding_vector_ = SCM_EOL;
coding_mapping_ = SCM_EOL;
coding_table_ = SCM_EOL;
coding_description_ = SCM_EOL;
- coding_scheme_ = coding;
magnification_ = magn;
SCM desc = m->description_;
&& coding_scheme_ != "ASCII"
&& coding_scheme_ != orig_->coding_scheme ())
{
- coding_vector_ = scm_call_1 (ly_scheme_function ("get-coding-vector"),
- scm_makfrom0str (coding_scheme_.to_str0 ()));
+ coding_vector_
+ = scm_call_1 (ly_scheme_function ("get-coding-vector"),
+ scm_makfrom0str (coding_scheme_.to_str0 ()));
if (!ly_c_vector_p (coding_vector_))
{
coding_vector_ = scm_c_make_vector (256, ly_symbol2scm (".notdef"));
}
-
- coding_table_ = scm_call_1 (ly_scheme_function ("get-coding-table"),
- scm_makfrom0str (orig_->coding_scheme ().to_str0 ()));
-
- coding_mapping_ = scm_call_2 (ly_scheme_function ("make-encoding-mapping"),
- coding_vector_,
- 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"),
- scm_makfrom0str (orig_->coding_scheme ().to_str0 ()),
- coding_description_);
- coding_description_ = scm_acons (ly_symbol2scm ("output-table"),
- coding_table_,
- coding_description_);
- coding_description_ = scm_acons (ly_symbol2scm ("char-mapping"),
- coding_mapping_,
- coding_description_);
+ coding_table_
+ = scm_call_1 (ly_scheme_function ("get-coding-table"),
+ scm_makfrom0str (orig_->coding_scheme ().to_str0 ()));
+
+ coding_mapping_
+ = scm_call_2 (ly_scheme_function ("make-encoding-mapping"),
+ coding_vector_,
+ 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"),
+ scm_makfrom0str (orig_->coding_scheme ().to_str0 ()),
+ coding_description_);
+ coding_description_
+ = scm_acons (ly_symbol2scm ("output-table"),
+ coding_table_,
+ coding_description_);
+ coding_description_
+ = scm_acons (ly_symbol2scm ("char-mapping"),
+ coding_mapping_,
+ coding_description_);
}
}
}
SCM
-Modified_font_metric::make_scaled_font_metric (SCM coding, Font_metric *m, Real s)
+Modified_font_metric::make_scaled_font_metric (SCM coding,
+ Font_metric *m, Real s)
{
/*
UGH.
scm_gc_mark (coding_mapping_);
}
+/* TODO: put this klutchness behind ly:option switch. */
Box
Modified_font_metric::tex_kludge (String text) const
{
Interval ydims;
- Real w=0.0;
-
- /*
- TODO: put this klutchness behind ly:option switch.
- */
+ Real w = 0;
for (int i = 0; i < text.length (); i++)
{
switch (text[i])
{
case '\\':
- // accent marks use width of base letter
+ /* Accent marks use width of base letter */
if (i +1 < text.length ())
{
- if (text[i+1]=='\'' || text[i+1]=='`' || text[i+1]=='"' ||
- text[i+1]=='^')
+ if (text[i+1]=='\'' || text[i+1]=='`' || text[i+1]=='"'
+ || text[i+1]=='^')
{
i++;
break;
}
- // for string width \\ is a \ and \_ is a _.
+ /* For string width \\ is a \ and \_ is a _. */
if (text[i+1]=='\\' || text[i+1]=='_')
- {
break;
- }
}
for (i++; (i < text.length ()) && !isspace (text[i])
&& text[i]!='{' && text[i]!='}'; i++)
;
- // ugh.
- i--; // Compensate for the increment in the outer loop!
+ /* Compensate for the auto-increment in the outer loop. */
+ i--;
break;
+
case '{': // Skip '{' and '}'
case '}':
break;
default:
Box b = get_ascii_char ((unsigned char)text[i]);
- // Ugh, use the width of 'x' for unknown characters
+ /* Use the width of 'x' for unknown characters */
if (b[X_AXIS].length () == 0)
b = get_ascii_char ((unsigned char)'x');
{
Box b;
if (coding_scheme_ == "TeX")
- {
- b = tex_kludge (text);
- }
+ b = tex_kludge (text);
else if (coding_scheme_ == "ASCII"
|| coding_scheme_ == ""
|| coding_scheme_ == orig_->coding_scheme ())
int idx = orig_->name_to_index (chars);
if (idx >= 0)
- {
- char_box = orig_->get_indexed_char (idx);
- }
+ char_box = orig_->get_indexed_char (idx);
char_box.scale (magnification_);
if (!char_box[X_AXIS].is_empty ())
- w += char_box[X_AXIS][RIGHT]; // length ?
+ /* length ? */
+ w += char_box[X_AXIS][RIGHT];
ydims.unite (char_box[Y_AXIS]);
}
if (ydims.is_empty ())
ydims = Interval (0, 0);
-
b = Box (Interval (0, w), ydims);
}
return pages_;
pages_ = SCM_EOL;
- Output_def *paper = bookpaper_;
- SCM proc = paper->c_variable ("page-breaking");
+ SCM proc = bookpaper_->c_variable ("page-breaking");
pages_ = scm_apply_0 (proc, scm_list_2 (lines (), self_scm ()));
return pages_;
}
THIS->lexer_->add_scope (p->scope_);
}
| PAPER {
- Output_def* p = get_paper (THIS);
+ Output_def *p = get_paper (THIS);
if (p->parent_)
THIS->lexer_->add_scope (p->parent_->scope_);
::quantised_position_proc, Y_AXIS);
sc->set_property ("staff-padding", SCM_EOL);
}
+
+ /* Simplistic slur collision handling. This fixes simple collisions
+ like
+
+ a_\upbow( b)
+
+ but it most probably breaks for more interesting cases.
+ Maybe make a new colission engraver.
+
+
+ Assume that a SCRIPT that should collide with SLUR does not
+ have a negative priority. */
SCM priority = sc->get_property ("script-priority");
if (robust_scm2int (priority, 0) >= 0
&& slur_
source file of the GNU LilyPond music typesetter
(c) 1998--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
- Jan Nieuwenhuizen <janneke@gnu.org>
- */
+ Jan Nieuwenhuizen <janneke@gnu.org>
+*/
+
#include <math.h>
#include "warn.hh"
#include "font-interface.hh"
#include "virtual-font-metric.hh"
#include "output-def.hh"
-#include "scaled-font-metric.hh"
+#include "modified-font-metric.hh"
#include "ly-module.hh"
MAKE_SCHEME_CALLBACK (Text_item, interpret_string, 4)
SCM
-Text_item::interpret_string (SCM paper, SCM props, SCM encoding, SCM markup)
+Text_item::interpret_string (SCM paper_smob,
+ SCM props, SCM input_encoding, SCM markup)
{
- Output_def *pap = unsmob_output_def (paper);
+ Output_def *paper = unsmob_output_def (paper_smob);
- SCM_ASSERT_TYPE(pap, paper, SCM_ARG1, __FUNCTION__, "Paper definition");
- SCM_ASSERT_TYPE(ly_c_string_p (markup), markup, SCM_ARG3, __FUNCTION__, "string");
- SCM_ASSERT_TYPE(encoding == SCM_EOL
- || ly_c_symbol_p (encoding), encoding, SCM_ARG2, __FUNCTION__, "symbol");
+ SCM_ASSERT_TYPE (paper, paper_smob, SCM_ARG1,
+ __FUNCTION__, "Paper definition");
+ SCM_ASSERT_TYPE (ly_c_string_p (markup), markup, SCM_ARG3,
+ __FUNCTION__, "string");
+ SCM_ASSERT_TYPE (input_encoding == SCM_EOL || ly_c_symbol_p (input_encoding),
+ input_encoding, SCM_ARG2, __FUNCTION__, "symbol");
String str = ly_scm2string (markup);
- if (!ly_c_symbol_p (encoding))
+ if (!ly_c_symbol_p (input_encoding))
{
- SCM var = ly_module_lookup (pap->scope_,
+ /* FIXME: input_encoding is set in *book*_paper
+
+ Options include:
+
+ 1. produce a bookpaper from a paper.
+ 2. add BOOKPAPER parameter to all callers, ie, all MARKUPs. */
+
+ programming_error ("FIXME: looking up input_encoding in paper");
+ programming_error ("as a workaround, set inputencoding in your \\paper block");
+ SCM var = ly_module_lookup (paper->scope_,
ly_symbol2scm ("inputencoding"));
if (var != SCM_BOOL_F)
- encoding = scm_variable_ref (var);
+ input_encoding = scm_variable_ref (var);
}
- Font_metric *fm = select_encoded_font (pap, props, encoding);
+ Font_metric *fm = select_encoded_font (paper, props, input_encoding);
SCM lst = SCM_EOL;
Box b;
MAKE_SCHEME_CALLBACK (Text_item, interpret_markup, 3)
SCM
-Text_item::interpret_markup (SCM paper, SCM props, SCM markup)
+Text_item::interpret_markup (SCM paper_smob, SCM props, SCM markup)
{
if (ly_c_string_p (markup))
- return interpret_string (paper, props, SCM_EOL, markup);
+ return interpret_string (paper_smob, props, SCM_EOL, markup);
else if (ly_c_pair_p (markup))
{
SCM func = ly_car (markup);
if (!markup_p (markup))
programming_error ("Markup head has no markup signature.");
- return scm_apply_2 (func, paper, props, args);
+ return scm_apply_2 (func, paper_smob, props, args);
}
return SCM_EOL;
}
return interpret_markup (me->get_paper ()->self_scm (), chain, t);
}
-
-/*
- Ugh. Duplicated from Scheme.
- */
+/* Ugh. Duplicated from Scheme. */
bool
Text_item::markup_p (SCM x)
{
- return
- ly_c_string_p (x) ||
- (ly_c_pair_p (x)
- && SCM_BOOL_F != scm_object_property (ly_car (x), ly_symbol2scm ("markup-signature")));
+ return (ly_c_string_p (x)
+ || (ly_c_pair_p (x)
+ && SCM_BOOL_F
+ != scm_object_property (ly_car (x),
+ ly_symbol2scm ("markup-signature"))));
}
ADD_INTERFACE (Text_item,"text-interface",
- "A scheme markup text, see @usermanref{Text-markup}.",
- "text baseline-skip word-space");
+ "A scheme markup text, see @usermanref{Text-markup}.",
+ "text baseline-skip word-space");
pt = #(/ in 72.27)
cm = #(* 10 mm)
- inputencoding = #"TeX"
+ %% This is weird; `everyone' uses LATIN1? How does I select TeX
+ %% input encoding in EMACS? -- jcn
+ %%%%inputencoding = #"TeX"
+ inputencoding = #"latin1"
+
printpagenumber = ##t
- %
- % 20pt staff, 5 pt = 1.75 mm
- %
+
+ %%
+ %% 20pt staff, 5 pt = 1.75 mm
+ %%
outputscale = #1.7573
+\version "2.3.8"
+
+%% < 1.8 compatibility switch
#(ly:set-option 'old-relative)
-\version "2.3.8"
+%% named durations
breve = #(ly:make-duration -1 0)
longa = #(ly:make-duration -2 0 )
maxima = #(ly:make-duration -3 0)
\include "music-functions-init.ly"
-\include "nederlands.ly" % dutch
+
+%% default note names are dutch
+\include "nederlands.ly"
+
\include "drumpitch-init.ly"
\include "chord-modifiers-init.ly"
\include "script-init.ly"
stop = 1
smaller = -1
bigger = 1
-center=0
-
-%{
-
-should also set allowBeamBreak, but how to do it "portably"? (ie. also
-working with lyric sections)
+center = 0
-try \once \set Score.allowBeamBreak = ##t
-
-%}
+%% FIXME
+%% should also set allowBeamBreak, but how to do it "portably"? (ie. also
+%% working with lyric sections)
+%%
+%% try \once \set Score.allowBeamBreak = ##t
%% rather name \newline, \newpage ?
break = #(make-event-chord (list (make-penalty-music -10001 0)))
noBreak = #(make-event-chord (list (make-penalty-music 10001 0)))
pageBreak = #(make-event-chord (list (make-penalty-music -10001 -10001)))
-pagebreak = \pageBreak % ugh.
noPageBreak = #(make-event-chord (list (make-penalty-music 0 10001)))
-noPagebreak = \noPageBreak % ugh
+
+%% why these defines?
+pagebreak = \pageBreak
+noPagebreak = \noPageBreak
noBeam = #(make-music 'BeamForbidEvent)
pipeSymbol = #(make-music 'BarCheck)
-foo = { \pageBreak }
+foo = { \pageBreak }
\include "scale-definitions-init.ly"
-
melisma = #(make-span-event 'ManualMelismaEvent START)
melismaEnd = #(make-span-event 'ManualMelismaEvent STOP)
\include "grace-init.ly"
-
-% ugh
\include "midi-init.ly"
-
\include "book-paper-defaults.ly"
\paper {
- mm = #(ly:output-def-lookup $defaultbookpaper 'mm)
- unit = #(ly:output-def-lookup $defaultbookpaper 'unit)
+ mm = #(ly:output-def-lookup $defaultbookpaper 'mm)
+ unit = #(ly:output-def-lookup $defaultbookpaper 'unit)
in = #(* 25.4 mm)
pt = #(/ in 72.27)
partCombineListener = \paper {
- \context {
- \Voice
- \consists Note_heads_engraver
- \consists Rest_engraver
- \type "Recording_group_engraver"
- recordEventSequence = #notice-the-events-for-pc
- }
- \context { \Score skipTypesetting = ##t }
+ \context {
+ \Voice
+ \consists Note_heads_engraver
+ \consists Rest_engraver
+ \type "Recording_group_engraver"
+ recordEventSequence = #notice-the-events-for-pc
+ }
+ \context { \Score skipTypesetting = ##t }
}
#(set-part-combine-listener partCombineListener)
\include "dynamic-scripts-init.ly"
\include "spanners-init.ly"
-
\include "property-init.ly"
-%% reset default duration
-unusedEntry = { c4 }
+setDefaultDurationToQuarter = { c4 }
-%% must have size argument for GUILE 1.6 compat.
+%% MAKE-HASH-TABLE in GUILE 1.6 takes mandatory size parameter.
#(define musicQuotes (make-hash-table 29))
#(define toplevel-book-handler ly:parser-print-book)
(cons (cdr x) (delay (get-coding-from-file (cdr x))))))
'(
- ;; teTeX
+ ;; teTeX font (output) encodings
("TeX-typewriter-text" . "09fbbfac.enc") ;; cmtt10
("TeX-math-symbols" . "10037936.enc") ;; cmbsy
("ASCII-caps-and-digits" . "1b6d048e.enc") ;; cminch
("TeX-text-without-f-ligatures" . "0ef0afca.enc")
("Extended-TeX-Font-Encoding---Latin" . "tex256.enc")
("AdobeStandardEncoding" . "8a.enc")
-
- ;; aliases
("T1" . "tex256.enc")
("adobe" . "8a.enc")
- ;;("latin1" . "latin1.enc")
- ("latin1" . "cork.enc")
("ec" . "EC.enc")
- ;; LilyPond.
+ ;; input encodings
+ ("latin1" . "latin1.enc")
+ ("cork" . "cork.enc")
+
+ ;; LilyPond FETA music font
("fetaBraces" . "feta-braces-a.enc")
("fetaNumber" . "feta-nummer10.enc")
("fetaMusic" . "feta20.enc")
(srfi srfi-13)
(lily))
+(define (stderr string . rest)
+ (apply format (cons (current-error-port) (cons string rest)))
+ (force-output (current-error-port)))
+
+;;(define pdebug stderr)
+(define (pdebug . rest) #f)
+
(define mm-to-bigpoint
(/ 72 25.4))
(pfas (map
(lambda (x)
- (let*
- ((aname (string-append x ".pfa"))
- (apath (ly:kpathsea-expand-path aname))
-
- (bpath (if (not apath)
- (ly:kpathsea-expand-path (string-append x ".pfb"))
- #f)))
-
-
- (cond
- (apath (ly:gulp-file apath))
- (bpath (ly:pfb->pfa bpath))
- (else
- (ly:warn "Can't find PFA font ~S" x)
- ""))))
+ (let* ((aname (string-append x ".pfa"))
+ (apath (ly:kpathsea-expand-path aname))
+
+ (bpath (if (not apath)
+ (ly:kpathsea-expand-path
+ (string-append x ".pfb"))
+ #f)))
+ (cond
+ (apath (ly:gulp-file apath))
+ (bpath (ly:pfb->pfa bpath))
+ (else
+ (ly:warn "Can't find PFA font ~S" x)
+ ""))))
(filter string? font-names))))
(string-join pfas "\n")))
(ops (ly:output-def-lookup bookpaper 'outputscale))
(scaling (* ops magnification designsize)))
+ ;; debugging: [output]encoding is broken
+ ;; found so far: coding-alist is empty!
+ (pdebug "font: ~S\n" font)
+ (pdebug "fontname: ~S\n" fontname)
+ (pdebug "input-encoding:~S\n" input-encoding)
+ (pdebug "font-encoding:~S\n" font-encoding)
+
+ (pdebug "coding-alist:~S\n" coding-alist)
+
(string-append
(define-font plain fontname scaling)
(if (equal? input-encoding font-encoding)
(encodings (uniq-list (sort-list (filter string? encoding-list)
string<?))))
+ (pdebug "encodings:~S\n" encodings)
(string-append
(apply string-append (map font-load-encoding encodings))
(apply string-append
(value->string (ly:output-def-lookup paper ly-key)) " def \n"))
(string-append
- "/lily-output-units " (number->string mm-to-bigpoint) " def %% milimeter \n"
+ "/lily-output-units " (number->string mm-to-bigpoint) " def %% milimeter \n"
(output-entry "staff-line-thickness" 'linethickness)
(output-entry "line-width" 'linewidth)
(output-entry "paper-size" 'papersize)
(define (eps-header bookpaper bbox)
(string-append "%!PS-Adobe-2.0 EPSF-2.0\n"
"%%Creator: creator time-stamp\n"
- "%%BoundingBox: " (string-join (map number->string bbox) " ") "\n"
+ "%%BoundingBox: "
+ (string-join (map number->string bbox) " ") "\n"
"%%EndComments\n"))
(define (page-header bookpaper page-count)
"%%Creator: creator time-stamp\n"
"%%Pages: " (number->string page-count) "\n"
"%%PageOrder: Ascend\n"
- "%%DocumentPaperSizes: " (ly:output-def-lookup bookpaper 'papersize) "\n"))
+ "%%DocumentPaperSizes: "
+ (ly:output-def-lookup bookpaper 'papersize) "\n"))
(define (preamble bookpaper)
(list
(systems (ly:paper-book-lines book))
(scale (ly:output-def-lookup bookpaper 'outputscale ))
(titles (take-while ly:paper-system-title? systems))
- (non-title (find (lambda (x) (not (ly:paper-system-title? x))) systems))
+ (non-title (find (lambda (x)
+ (not (ly:paper-system-title? x))) systems))
(dump-me
(stack-stencils Y DOWN 0.0
(map ly:paper-system-stencil
(string-append "0 0 start-system { "
"set-ps-scale-to-lily-scale "
"\n"))
+
(ly:outputter-dump-stencil outputter dump-me)
(ly:outputter-dump-string outputter "} stop-system\n%%Trailer\n%%EOF\n")))
(define-public (convert-to-ps book name)
#t)
-
(define-public (write-me message x)
- "Return X. Display MESSAGE and write X. Handy for debugging, possibly turned off."
+ "Return X. Display MESSAGE and write X. Handy for debugging,
+possibly turned off."
(display message) (write x) (newline) x)
;; x)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define-public (postscript->pdf papersize name)
- (let*
- ((cmd (string-append "ps2pdf -sPAPERSIZE=" papersize
- " "
- name))
- (output-name (regexp-substitute/global #f "\\.ps" name 'pre ".pdf" 'post)))
+ (let* ((cmd (string-append "ps2pdf -sPAPERSIZE=" papersize " " name))
+ (output-name
+ (regexp-substitute/global #f "\\.ps" name 'pre ".pdf" 'post)))
+
+ (newline)
+ ;; FIXME: user message: should be translated
+ (display (format "Converting to ~s..." output-name))
+ (newline)
+ (if (ly:get-option 'verbose)
+ ;; FIXME: user message: should be translated
+ (display (format "Invoking ~s..." cmd)))
- (display
- (string-append
- "Converting to " output-name "\n"))
-
- (if (ly:get-option 'verbose)
- (display (format "Invoking ~S" cmd)))
-
(system cmd)))
-
-
(define-public (postscript->png resolution name)
(let
((cmd (string-append
" ")
name)))
(if (ly:get-option 'verbose)
- (display (format "Invoking `~S'\n" cmd)))
+ ;; FIXME: user message: should be translated
+ (begin
+ (display (format "Invoking ~s..." cmd))
+ (newline)))
(system cmd)))
(define-public (lilypond-main files)
(if (pair? failed)
(begin
(display
+ ;; FIXME: user message: should be translated
(string-append "\n *** Failed files: " (string-join failed) "\n"))
(exit 1))
(exit 0))))
verbose_p = 1
for f in files:
- out = ly.make_ps_images (f,
- resolution = preview_resolution)
- sys.stderr.write (_("Written `%s'\n" % out ))
+ out = ly.make_ps_images (f, resolution = preview_resolution)
+ ## FIXME: silly message containing %d
+ sys.stderr.write (_ ("Wrote `%s'" % out))
+ sys.stderr.write ('\n')
%!
% Automatically generated by the Ogonkify package
-% Do not modify
+% apt-cache says that software does not exist.
+%
+% WL says: 055 45 2D - ==> /hyphen (NOT: /minus)
+%
+% Changed /minus to /hyphen, but I'm afraid that this will break
+% everything except for the EC* fonts --jcn
+%
% -- code follows this line --
%%BeginResource: encoding ISOLatin1Encoding
/ISOLatin1Encoding [
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef /.notdef
/space /exclam /quotedbl /numbersign /dollar /percent /ampersand /quoteright
-/parenleft /parenright /asterisk /plus /comma /minus /period /slash
+/parenleft /parenright /asterisk /plus /comma /hyphen /period /slash
/zero /one /two /three /four /five /six /seven
/eight /nine /colon /semicolon /less /equal /greater /question
% 100