for now.
* lily/include/performer.hh (class Performer): strip get_tempo() method.
* lily/midi-def.cc: strip file.
* lily/lexer.ll (Lily_lexer): don't protect hash key separately.
* lily/include/context-def.hh (struct Context_def): use
VIRTUAL_COPY_CONSTRUCTOR().
* lily/source-file.cc: smobification.
* lily/include/source-file.hh (class Source_file): smobify
Source_file. Trim redundant members.
* lily/parser.yy (Lily_lexer::try_special_identifiers): unprotect
clones after creation. This plugs a huge memory leak.
* python/convertrules.py (FatalConversionError.sub_tempo):
complete rule for \midi{ \tempo }
* input/mutopia/J.S.Bach/wtk1-fugue2.ly (bassdux): idem.
* input/mutopia/F.Schubert/morgenlied.ly (pianoLH): update tempo.
+2006-08-23 Han-Wen Nienhuys <hanwen@lilypond.org>
+
+ * lily/smobs.cc (protect_smob): switch off fancy smob protection
+ for now.
+
+ * lily/include/performer.hh (class Performer): strip get_tempo() method.
+
+ * lily/midi-def.cc: strip file.
+
+ * lily/lexer.ll (Lily_lexer): don't protect hash key separately.
+
+ * lily/include/context-def.hh (struct Context_def): use
+ VIRTUAL_COPY_CONSTRUCTOR().
+
+ * lily/source-file.cc: smobification.
+
+ * lily/include/source-file.hh (class Source_file): smobify
+ Source_file. Trim redundant members.
+
+ * lily/parser.yy (Lily_lexer::try_special_identifiers): unprotect
+ clones after creation. This plugs a huge memory leak.
+
+ * python/convertrules.py (FatalConversionError.sub_tempo):
+ complete rule for \midi{ \tempo }
+
+ * input/mutopia/J.S.Bach/wtk1-fugue2.ly (bassdux): idem.
+
+ * input/mutopia/F.Schubert/morgenlied.ly (pianoLH): update tempo.
+
2006-08-22 Han-Wen Nienhuys <hanwen@lilypond.org>
* python/convertrules.py (conv): warning on \tempo{}
* lily/parser.yy (output_def_body): disallow \tempo in \midi{}
- * lily/duration-scheme.cc (LY_DEFINE): ly:duration-length: new function.
+ * lily/duration-scheme.cc (LY_DEFINE): ly:duration-length: new
+ function.
* scm/lily.scm (define-scheme-options): alphabetize, add eps-pad-boxes.
Release 2.9
***********
+
DEVELOPMENT TEAM
Han-Wen Nienhuys - Core development
Graham Percival - Documentation Editor
Mats Bengtsson - Support Guru
+
CONTRIBUTORS
Angelo Contardi
Heikki Junes
Joe Neeman
+
SPONSORS
Andrew Sidwell
\lyricsto "singer" \new Lyrics \firstVerse
\lyricsto "singer" \new Lyrics \secondVerse
\new PianoStaff <<
- \set PianoStaff.instrument = \markup {
+ \set PianoStaff.instrumentName = \markup {
\bold
\bigger\bigger\bigger\bigger \huge "2. " }
\new Staff \pianoRH
}
}
\midi {
- \tempo 4 = 70
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 70 4)
+ }
}
}
}
}
\layout {}
\midi {
- \tempo 4 =84
+ \context {
+ \Score
+ tempoWholesPerMinute = #(ly:make-moment 84 4)
+ }
}
}
\paper {
U8
Binary_source_file::get_U8 ()
{
+#if 0 // FIXME
return *(U8 *)forward_str0 (1);
+#endif
+ assert (false);
+ return 0;
}
U16
return context;
}
-SCM
-Context_def::clone_scm () const
-{
- Context_def *t = new Context_def (*this);
- return t->unprotect ();
-}
-
SCM
Context_def::make_scm ()
{
SCM get_translator_group_type () const { return translator_group_type_; }
void set_acceptor (SCM accepts, bool add);
+ VIRTUAL_COPY_CONSTRUCTOR(Context_def, Context_def);
+
vector<Context_def*> path_to_acceptable_context (SCM type_string,
Output_def *) const;
Context *instantiate (SCM extra_ops, Object_key const *);
SCM to_alist () const;
static SCM make_scm ();
- SCM clone_scm () const;
void apply_default_property_operations (Context *);
private:
char const *start_;
char const *end_;
Source_file *source_file_;
-
public:
Source_file *get_source_file () const;
char const *start () const;
void \
CL::smobify_self () \
{ \
- self_scm_ = unprotected_smobify_self (); \
protection_cons_ = SCM_EOL; \
+ self_scm_ = unprotected_smobify_self (); \
protect (); \
} \
void \
SCM \
CL::unprotect () \
{ \
- unprotect_smob (&protection_cons_); \
+ unprotect_smob (self_scm_, &protection_cons_); \
return self_scm_; \
} \
SCM \
void assign_context_def (Output_def *m, SCM transdef);
SCM find_context_def (Output_def const *m, SCM name);
-int get_tempo (Output_def*def, Moment moment);
-void set_tempo (Output_def*def, Moment moment, int count_per_minute_i);
-
Interval line_dimensions_int (Output_def*def, int);
void do_announces ();
virtual void announce_element (Audio_element_info);
virtual void play_element (Audio_element *p);
- virtual int get_tempo () const;
protected:
vector<Audio_element_info> announce_infos_;
virtual void announce_element (Audio_element_info);
virtual void acknowledge_audio_element (Audio_element_info);
virtual void create_audio_elements ();
- virtual int get_tempo () const;
virtual void play_element (Audio_element *elem);
};
virtual void disconnect_from_context ();
virtual void initialize ();
virtual void announce_element (Audio_element_info);
- virtual int get_tempo () const;
virtual void play_element (Audio_element *p);
virtual void derived_mark () const;
private:
#define DECLARE_TYPE_P(CL) extern SCM CL ## _type_p_proc
void protect_smob (SCM smob, SCM *prot_cons);
-void unprotect_smob (SCM *prot_cons);
+void unprotect_smob (SCM smob, SCM *prot_cons);
#endif /* SMOBS_HH */
#include "flower-proto.hh"
#include "std-vector.hh"
#include "lily-proto.hh"
-#include "protected-scm.hh"
+#include "smobs.hh"
#include <iostream>
using namespace std;
class Source_file
{
+ vector<char*> newline_locations_;
+ istream *istream_;
+ vector<char> characters_;
+ SCM str_port_;
+
+ char const *contents_str0 () const;
+ void load_stdin ();
+ void init_port ();
+ void init ();
+
+ DECLARE_SMOBS(Source_file, bla);
public:
Source_file (string fn);
Source_file (string, string);
- virtual ~Source_file ();
-
char const *c_str () const;
virtual string quote_input (char const *pos_str0) const;
istream *get_istream ();
string name_string () const;
string file_line_column_string (char const *str0) const;
- // return start + n
- char const *seek_str0 (int n);
-
- int tell () const;
- // return here + n bytes
- char const *forward_str0 (int n);
- char const *pos_str0 () { return pos_str0_; }
- string get_string (int n);
- void set_pos (char const *pos_str0);
public:
Slice line_slice (char const *pos_str0) const;
string line_string (char const *pos_str0) const;
void get_counts (char const *pos_str0, int *, int *, int *) const;
-
- /*
- JUNKME.
-
- This thing doubles as a file-storage/file-iterator object.
- */
- char const *pos_str0_;
-
+
SCM get_port () const;
string name_;
protected:
int line_offset_;
-
-private:
- vector<char*> newline_locations_;
- istream *istream_;
- char *contents_str0_;
- vector<char> chs_;
- int length_;
- void load_stdin ();
- void init_port ();
-
- Protected_scm str_port_;
};
-char *gulp_file (string fn, int *len);
+vector<char> gulp_file (string fn, int desired);
#endif /* SOURCE_FILE_HH */
*/
#include "input-smob.hh"
-
+#include "source-file.hh"
#include "std-string.hh"
#include "ly-smobs.icc"
static long input_tag;
static
-SCM mark_smob (SCM)
+SCM mark_smob (SCM s)
{
+ Input *sc = (Input *) SCM_CELL_WORD_1 (s);
+
+ if (Source_file *sf = sc->get_source_file ())
+ return sf->self_scm ();
+
return SCM_EOL;
}
}
yylval.scm = sval;
- return SCM_T;
+ return SCM_TOKEN;
}
<INITIAL,notes,lyrics>{
\<\< {
};
for (int i = 0; sigs[i].symbol; i++)
- scm_hashq_set_x (signature_hash_table, scm_gc_protect_object (ly_symbol2scm (sigs[i].symbol)),
+ scm_hashq_set_x (signature_hash_table, ly_symbol2scm (sigs[i].symbol),
scm_from_int (sigs[i].token_type));
}
if (be_verbose_global)
progress_indication ("[" + s);
- int n = size;
- char *str = gulp_file (s, &n);
- string result (str, n);
- delete[] str;
+ vector<char> chars = gulp_file (s, size);
+ string result (&chars[0], chars.size ());
if (be_verbose_global)
progress_indication ("]");
context ()->self_scm ());
text_->set_property ("text", result);
-
- last_duration_ = duration;
- last_count_ = count;
}
+
+ last_duration_ = duration;
+ last_count_ = count;
}
#include "translator.icc"
-/*
- midi-def.cc -- implement midi output def functions
-
- source file of the GNU LilyPond music typesetter
-
- (c) 1997--2006 Jan Nieuwenhuizen <janneke@gnu.org>
-*/
-
-
-#include "misc.hh"
-#include "output-def.hh"
-#include "moment.hh"
-#include "warn.hh"
-#include "scm-hash.hh"
-
-int
-get_tempo (Output_def *def,
- Moment one_beat_mom)
-{
- SCM wis = ly_symbol2scm ("whole-in-seconds");
- Moment *w = unsmob_moment (def->lookup_variable (wis));
-
- Moment wholes_per_min = Moment (60);
- if (!w)
- {
- programming_error ("wholes-in-seconds not set.");
- wholes_per_min /= 4;
- }
- else
- wholes_per_min /= *w;
-
- Rational beats_per_min = (wholes_per_min / one_beat_mom).main_part_;
- return beats_per_min.to_int ();
-}
-
-void
-set_tempo (Output_def *def,
- Moment one_beat_mom,
- int beats_per_minute_i)
-{
- Moment beats_per_second = Moment (beats_per_minute_i) / Moment (60);
-
- Moment m = Moment (1) / Moment (beats_per_second * one_beat_mom);
- def->set_variable (ly_symbol2scm ("whole-in-seconds"), m.smobbed_copy ());
-}
-
%token CHORDMODIFIERS
%token LYRIC_MARKUP
%token MULTI_MEASURE_REST
-%token SCM_T
%token <i> DIGIT
%token <scm> REAL
%token <scm> RESTNAME
%token <scm> SCM_IDENTIFIER
-%token <scm> SCM_T
+%token <scm> SCM_TOKEN
%token <scm> SCORE_IDENTIFIER
%token <scm> STRING
%token <scm> STRING_IDENTIFIER
;
embedded_scm:
- SCM_T
+ SCM_TOKEN
| SCM_IDENTIFIER
;
assignment:
assignment_id '=' identifier_init {
- if (! is_regular_identifier ($1))
- {
-#if 0
- /* no longer valid with dashes in \paper{} block. */
- @1.warning (_ ("identifier should have alphabetic characters only"));
-#endif
- }
-
-
PARSER->lexer_->set_identifier ($1, $3);
/*
*destination = sid;
return STRING_IDENTIFIER;
} else if (unsmob_book (sid)) {
- *destination = unsmob_book (sid)->clone ()->self_scm ();
+ Book *book = unsmob_book (sid)->clone ();
+ *destination = book->self_scm ();
+ book->unprotect ();
+
return BOOK_IDENTIFIER;
} else if (scm_is_number (sid)) {
*destination = sid;
return NUMBER_IDENTIFIER;
} else if (unsmob_context_def (sid)) {
- *destination = unsmob_context_def (sid)->clone_scm ();
+ Context_def *def= unsmob_context_def (sid)->clone ();
+
+ *destination = def->self_scm ();
+ def->unprotect ();
+
return CONTEXT_DEF_IDENTIFIER;
} else if (unsmob_score (sid)) {
Score *score = new Score (*unsmob_score (sid));
*destination = score->self_scm ();
+
+ score->unprotect ();
return SCORE_IDENTIFIER;
} else if (Music *mus = unsmob_music (sid)) {
mus = mus->clone ();
bool is_event = scm_memq (ly_symbol2scm ("event"), mus->get_property ("types"))
!= SCM_BOOL_F;
+ mus->unprotect ();
return is_event ? EVENT_IDENTIFIER : MUSIC_IDENTIFIER;
} else if (unsmob_duration (sid)) {
*destination = unsmob_duration (sid)->smobbed_copy ();
} else if (unsmob_output_def (sid)) {
Output_def *p = unsmob_output_def (sid);
p = p->clone ();
-
+
*destination = p->self_scm ();
+ p->unprotect ();
return OUTPUT_DEF_IDENTIFIER;
} else if (Text_interface::is_markup (sid)) {
*destination = sid;
Midi_text track_name (&track_name_a);
midi_track.add (Moment (0), &track_name);
-
- // Some sequencers read track 0 last.
- // Audio_tempo tempo_a (midi_->get_tempo (Moment (Rational (1, 4))));
- // Midi_tempo tempo (&tempo_a);
- // midi_track.add (Moment (0), &tempo);
-
midi_stream << midi_track;
}
}
}
-int
-Performer_group::get_tempo () const
-{
- Context *c = context_->get_parent_context ();
- if (c)
- {
- Performer_group *pgp = dynamic_cast<Performer_group *> (c->implementation ());
- return pgp->get_tempo ();
- }
- return 60;
-}
-
get_daddy_performer ()->play_element (p);
}
-int
-Performer::get_tempo () const
-{
- return get_daddy_performer ()->get_tempo ();
-}
-
Performer_group *
Performer::get_daddy_performer () const
{
SCM_ARG1, __FUNCTION__, "string");
string file_name = ly_scm2string (pfb_file_name);
- int len = -1;
if (be_verbose_global)
progress_indication ("[" + file_name);
- char *str = gulp_file (file_name, &len);
- char *pfa = pfb2pfa ((Byte *)str, len);
-
+ vector<char> pfb_string = gulp_file (file_name, 0);
+ char *pfa = pfb2pfa ((Byte *) &pfb_string[0], pfb_string.size ());
+
SCM pfa_scm = scm_makfrom0str (pfa);
free (pfa);
- delete str;
+
if (be_verbose_global)
progress_indication ("]");
smobify_self ();
}
+
Prob::~Prob ()
{
}
precomputed_recurse_over_translators (context (), STOP_TRANSLATION_TIMESTEP, UP);
}
-int
-Score_performer::get_tempo () const
-{
- return ::get_tempo (performance_->midi_, Moment (Rational (1, 4)));
-}
-
void
Score_performer::derived_mark () const
{
/*
The CDR contains the actual protected list.
*/
-static SCM smob_protection_list;
+static SCM smob_protection_list = SCM_EOL;
void
init_smob_protection ()
{
- smob_protection_list = scm_cons (SCM_UNDEFINED, SCM_EOL);
- scm_permanent_object (smob_protection_list);
+ smob_protection_list = scm_cons (SCM_BOOL_F, SCM_EOL);
+ scm_gc_protect_object (smob_protection_list);
}
ADD_SCM_INIT_FUNC (init_smob_protection, init_smob_protection);
LY_DEFINE(ly_smob_protects, "ly:smob-protects",
- 0,0,0, (),
+ 0, 0, 0, (),
"Return lily's internal smob protection list")
{
- return scm_cdr (smob_protection_list);
+ return scm_is_pair (smob_protection_list)
+ ? scm_cdr (smob_protection_list)
+ : SCM_EOL;
}
-
-
-
void
protect_smob (SCM smob, SCM *prot_cons)
{
+#if 0
SCM s = scm_cdr (smob_protection_list);
- while (scm_is_pair (s) && scm_car (s) == SCM_UNDEFINED)
- s = scm_cdr (s);
-
+ while (scm_is_pair (s) && scm_car (s) == SCM_BOOL_F)
+ {
+ s = scm_cdr (s);
+ }
SCM prot = scm_cons (smob, s);
scm_set_cdr_x (smob_protection_list,
prot);
*prot_cons = prot;
+#else
+ scm_gc_protect_object (smob);
+#endif
}
void
-unprotect_smob (SCM *prot_cons)
+unprotect_smob (SCM smob, SCM *prot_cons)
{
+#if 1
+ scm_gc_unprotect_object (smob);
+#else
SCM next = scm_cdr (*prot_cons);
if (next == SCM_EOL)
- scm_set_car_x (*prot_cons, SCM_UNDEFINED);
+ scm_set_car_x (*prot_cons, SCM_BOOL_F);
else
{
- scm_set_car_x (*prot_cons, SCM_UNDEFINED);
+ scm_set_car_x (*prot_cons, SCM_BOOL_F);
while (scm_is_pair (next)
- && scm_car (next) == SCM_UNDEFINED)
+ && scm_car (next) == SCM_BOOL_F)
next = scm_cdr (next);
}
*prot_cons = SCM_EOL;
+#endif
}
void
Source_file::load_stdin ()
{
- length_ = 0;
- chs_.clear ();
+ characters_.clear ();
int c;
while ((c = fgetc (stdin)) != EOF)
- chs_.push_back (c);
+ characters_.push_back (c);
- chs_.push_back (0);
- length_ = chs_.size ();
- contents_str0_ = &chs_[0];
+ characters_.push_back (0);
}
-char *
-gulp_file (string filename, int *filesize)
+vector<char>
+gulp_file (string filename, int desired_size)
{
/* "b" must ensure to open literally, avoiding text (CR/LF)
conversions. */
if (!f)
{
warning (_f ("can't open file: `%s'", filename.c_str ()));
- return 0;
+
+ vector<char> cxx_arr;
+ return cxx_arr;
}
fseek (f, 0, SEEK_END);
int real_size = ftell (f);
int read_count = real_size;
- if (*filesize >= 0)
- read_count = min (read_count, *filesize);
+ if (desired_size > 0)
+ read_count = min (read_count, desired_size);
rewind (f);
warning (_f ("expected to read %d characters, got %d", bytes_read,
read_count));
fclose (f);
- *filesize = bytes_read;
- return str;
+ int filesize = bytes_read;
+
+ vector<char> cxx_arr;
+ cxx_arr.resize (filesize);
+
+ /* ugh, how to do neatly in STL? */
+ memcpy (&cxx_arr[0], str, filesize);
+
+ free (str);
+ return cxx_arr;
}
-Source_file::Source_file (string filename, string data)
+char const *
+Source_file::contents_str0 () const
+{
+ return &characters_[0];
+}
+
+void
+Source_file::init ()
{
- name_ = filename;
istream_ = 0;
line_offset_ = 0;
- length_ = data.length ();
- contents_str0_ = string_copy (data);
- pos_str0_ = c_str ();
+ str_port_ = SCM_EOL;
+ self_scm_ = SCM_EOL;
+ smobify_self ();
+}
+
+Source_file::Source_file (string filename, string data)
+{
+ init ();
+
+ name_ = filename;
+
+ characters_.resize (data.length ());
+
+ /* ugh, how to do neatly in STL? */
+ memcpy ((&characters_[0]), data.c_str (), data.length ());
+
init_port ();
- for (int i = 0; i < length_; i++)
- if (contents_str0_[i] == '\n')
- newline_locations_.push_back (contents_str0_ + i);
+ for (vsize i = 0; i < characters_.size (); i++)
+ if (characters_[i] == '\n')
+ newline_locations_.push_back (&characters_[0] + i);
}
Source_file::Source_file (string filename_string)
{
+ init ();
+
name_ = filename_string;
- istream_ = 0;
- line_offset_ = 0;
- contents_str0_ = 0;
if (filename_string == "-")
load_stdin ();
else
{
- length_ = -1;
- contents_str0_ = gulp_file (filename_string, &length_);
+ characters_ = gulp_file (filename_string, -1);
+ characters_.push_back (0);
}
-
- pos_str0_ = c_str ();
init_port ();
- for (int i = 0; i < length_; i++)
- if (contents_str0_[i] == '\n')
- newline_locations_.push_back (contents_str0_ + i);
+ for (vsize i = 0; i < characters_.size (); i++)
+ if (characters_[i] == '\n')
+ newline_locations_.push_back (&characters_[0] + i);
}
void
Source_file::init_port ()
{
- SCM str = scm_makfrom0str (contents_str0_);
+ SCM str = scm_makfrom0str (contents_str0 ());
str_port_ = scm_mkstrport (SCM_INUM0, str, SCM_OPN | SCM_RDNG, __FUNCTION__);
scm_set_port_filename_x (str_port_, scm_makfrom0str (name_.c_str ()));
}
-int
-Source_file::tell () const
-{
- return pos_str0_ - contents_str0_;
-}
istream *
Source_file::get_istream ()
{
delete istream_;
istream_ = 0;
- delete[] contents_str0_;
}
Slice
int
Source_file::length () const
{
- return length_;
+ return characters_.size ();
}
char const *
Source_file::c_str () const
{
- return contents_str0_;
+ return &characters_[0];
}
-void
-Source_file::set_pos (char const *pos_str0)
+SCM
+Source_file::get_port () const
{
- if (contains (pos_str0))
- pos_str0_ = pos_str0;
- else
- error (quote_input (pos_str0) + "invalid pos");
+ return str_port_;
}
-char const *
-Source_file::seek_str0 (int n)
-{
- char const *new_str0 = c_str () + n;
- if (n < 0)
- new_str0 += length ();
- if (contains (new_str0))
- pos_str0_ = new_str0;
- else
- error (quote_input (new_str0) + "seek past eof");
+/****************************************************************/
- return pos_str0_;
-}
+#include "ly-smobs.icc"
-char const *
-Source_file::forward_str0 (int n)
+IMPLEMENT_SMOBS(Source_file);
+IMPLEMENT_DEFAULT_EQUAL_P(Source_file);
+IMPLEMENT_TYPE_P(Source_file, "ly:source-file?");
+
+SCM
+Source_file::mark_smob (SCM smob)
{
- char const *old_pos = pos_str0_;
- char const *new_str0 = pos_str0_ + n;
- if (contains (new_str0))
- pos_str0_ = new_str0;
- else
- error (quote_input (new_str0) + "forward past eof");
+ Source_file *sc = (Source_file *) SCM_CELL_WORD_1 (smob);
- return old_pos;
+ return sc->str_port_;
}
-string
-Source_file::get_string (int n)
-{
- string str = string ((char const *)forward_str0 (n), n);
- return str;
-}
-SCM
-Source_file::get_port () const
+int
+Source_file::print_smob (SCM smob, SCM port, scm_print_state *)
{
- return str_port_;
+ Source_file *sc = (Source_file *) SCM_CELL_WORD_1 (smob);
+
+ scm_puts ("#<Source_file ", port);
+ scm_puts (sc->name_.c_str (), port);
+
+ /* Do not print properties, that is too much hassle. */
+ scm_puts (" >", port);
+ return 1;
}
+
Sources::~Sources ()
{
- junk_pointers (sourcefiles_);
+ for (vsize i = 0; i < sourcefiles_.size (); i++)
+ {
+ sourcefiles_[i]->unprotect ();
+ }
}
Source_file *
{
audio_staff_ = new Audio_staff;
name_ = new Audio_text (Audio_text::TRACK_NAME, context ()->id_string ());
- tempo_ = new Audio_tempo (get_tempo ());
+
+ Rational r = robust_scm2moment (get_property ("tempoWholesPerMinute"),
+ Moment (15,1)).main_part_;
+
+ r *= Rational (4,1);
+
+ tempo_ = new Audio_tempo (r.to_int ());
audio_staff_->add_audio_item (name_);
audio_staff_->add_audio_item (tempo_);
string
Tex_font_metric_reader::get_bcpl_string ()
{
- U8 length_u8 = input_.get_U8 ();
+ string str;
+
+#if 0 // FIXME.
+ U8 length_u8 = input_.get_U8 ();
string str = input_.get_string (length_u8);
+#endif
return str;
}
//brrr
/* Move to the beginning of the parameter table in the file. */
- input_.seek_str0 (-4 * header_.param_word_count);
+#if 0
+ // FIXME.
+ input_.seek_str0 (-4 * header_.param_word_count);
+#endif
+
/* It's unlikely but possible that this TFM file has more fontdimens
than we can deal with. */
if (header_.param_word_count > TFM_MAX_FONTDIMENS)
if (code < info_.first_charcode || code > info_.last_charcode)
return tfm_char;
+#if 0 // FIXME.
//brr
/* Move to the appropriate place in the `char_info' array. */
input_.seek_str0 (header_.char_info_pos + (code - info_.first_charcode) * 4);
-
+#endif
+
/* Read the character. */
tfm_char = read_char ();
Tex_font_char_metric tfm_char;
+ // FIXME.
#define GET_CHAR_DIMEN(d) \
if (d##_index != 0) \
{ \
- input_.seek_str0 (header_.d##_pos + d##_index * 4); \
+ /* input_.seek_str0 (header_.d##_pos + d##_index * 4);*/ \
tfm_char.d##_fix_ = input_.get_U32 (); \
tfm_char.d##_ = fix_to_real (tfm_char.d##_fix_) \
* info_.design_size; \
if (tag == 1)
{
+#if 0 // FIXME.
input_.seek_str0 (header_.lig_kern_pos + remainder * 4);
+#endif
read_lig_kern_program (&tfm_char.ligatures_, &tfm_char.kerns_);
}
Tfm_kern kern_element;
kern_element.character = next_char;
+#if 0
char const *old_pos = input_.pos_str0 ();
input_.seek_str0 (header_.kern_pos + remainder * 4);
+#endif
+
kern_element.kern = get_U32_fix_scaled ();
- input_.set_pos (old_pos);
+
+ // FIXME
+ /// input_.set_pos (old_pos);
kerns->push_back (kern_element);
}
def conv (str):
- m = re.search (r'\\tempo ([0-9]+)\s*([.]*)\s*=\s*([0-9]+)', str)
- if m and re.search (r'\\midi', str):
+
+ def sub_tempo (m):
dur = int (m.group (1))
dots = len (m.group (2))
count = int (m.group (3))
den = (1 << dots) * (1 << log2)
num = ((1 << (dots+1)) - 1)
- error_file.write (r"""
-
-\tempo in \midi is no longer supported. Use
-
+ return """
\midi {
\context {
\Score
}
}
-""" % (num*count, den))
-
+""" % (num*count, den)
+
+ str = re.sub (r'\\midi\s*{\s*\\tempo ([0-9]+)\s*([.]*)\s*=\s*([0-9]+)\s*}', sub_tempo, str)
return str
conversions.append (((2, 9, 16), conv, """deprecate \\tempo in \\midi"""))