diff options
author | Han-Wen Nienhuys <hanwen@xs4all.nl> | 1998-08-24 12:55:09 +0200 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@xs4all.nl> | 1998-08-24 12:55:09 +0200 |
commit | a41bc3e06fca46daa875419b5dc00dd958e1fde0 (patch) | |
tree | b3d22bc68eac28a5afc6c25a900c675b3b38d53f /lily | |
parent | e623ae7eca4ae92d78387cddf7327e03148a70bb (diff) |
release: 1.0.4
Diffstat (limited to 'lily')
-rw-r--r-- | lily/GNUmakefile (renamed from lily/Makefile) | 7 | ||||
-rw-r--r-- | lily/VERSION | 4 | ||||
-rw-r--r-- | lily/include/GNUmakefile | 8 | ||||
-rw-r--r-- | lily/include/Makefile | 8 | ||||
-rw-r--r-- | lily/include/text-def.hh | 2 | ||||
-rw-r--r-- | lily/lyric-engraver.cc | 5 | ||||
-rw-r--r-- | lily/parser.yy | 2 | ||||
-rw-r--r-- | lily/script-engraver.cc | 5 | ||||
-rw-r--r-- | lily/text-def.cc | 25 |
9 files changed, 46 insertions, 20 deletions
diff --git a/lily/Makefile b/lily/GNUmakefile index d5464bf147..47338e5c36 100644 --- a/lily/Makefile +++ b/lily/GNUmakefile @@ -9,12 +9,13 @@ SUBDIRS = include EXTRA_DIST_FILES = VERSION MODULE_LIBS=$(depth)/lib $(depth)/flower -MAKEFILES=C++ Executable +STEPMAKE_TEMPLATES= c++ executable -include $(depth)/make/Stepmake.make +include $(depth)/make/stepmake.make # force these: Make can't know these have to be generated in advance -my-lily-lexer.cc: $(outdir)/parser.hh +$(outdir)/my-lily-parser.o: $(outdir)/parser.hh +$(outdir)/my-lily-lexer.o: $(outdir)/parser.hh $(outdir)/lexer.o: $(outdir)/parser.hh diff --git a/lily/VERSION b/lily/VERSION index d019117582..875f4fb000 100644 --- a/lily/VERSION +++ b/lily/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=0 -PATCH_LEVEL=3 -MY_PATCH_LEVEL=jcn1 +PATCH_LEVEL=4 +MY_PATCH_LEVEL= # use the above to send patches, always empty for released version: # please don't move these comments up; the patch should fail if diff --git a/lily/include/GNUmakefile b/lily/include/GNUmakefile new file mode 100644 index 0000000000..ae2bfb62f3 --- /dev/null +++ b/lily/include/GNUmakefile @@ -0,0 +1,8 @@ +# lily/include/Makefile + +depth = ../.. +STEPMAKE_TEMPLATES=c++ + +include $(depth)/make/stepmake.make + + diff --git a/lily/include/Makefile b/lily/include/Makefile deleted file mode 100644 index a9ebc88ea5..0000000000 --- a/lily/include/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -# lily/include/Makefile - -depth = ../.. -MAKEFILES=C++ - -include $(depth)/make/Stepmake.make - - diff --git a/lily/include/text-def.hh b/lily/include/text-def.hh index 296350de45..e4b42d1233 100644 --- a/lily/include/text-def.hh +++ b/lily/include/text-def.hh @@ -36,6 +36,8 @@ public: Text_def(); virtual void print() const; virtual Interval width (Paper_def*) const; +private: + Real guess_width_f(Atom&) const; }; #endif // TEXT_DEF_HH diff --git a/lily/lyric-engraver.cc b/lily/lyric-engraver.cc index 8ed3989043..ceba7c467e 100644 --- a/lily/lyric-engraver.cc +++ b/lily/lyric-engraver.cc @@ -44,6 +44,11 @@ Lyric_engraver::do_process_requests() { td_p->style_str_ = style; } + Scalar alignment = get_property ("textalignment"); + if (alignment.isnum_b()) + { + td_p->align_dir_= (Direction)(int)alignment; + } lyric_item_p_ = new Text_item (td_p); diff --git a/lily/parser.yy b/lily/parser.yy index 4b9ec9fd2f..5df3722a0a 100644 --- a/lily/parser.yy +++ b/lily/parser.yy @@ -1112,7 +1112,7 @@ script_req: gen_script_def: text_def { $$ = $1; - ((Text_def*) $$)->align_dir_ = CENTER; /* UGH */ + ((Text_def*) $$)->align_dir_ = LEFT; /* UGH */ } | mudela_script { $$ = $1; diff --git a/lily/script-engraver.cc b/lily/script-engraver.cc index 435e312729..671ca17e38 100644 --- a/lily/script-engraver.cc +++ b/lily/script-engraver.cc @@ -69,6 +69,11 @@ Script_engraver::do_pre_move_processing() { td_l->style_str_= style; } + Scalar alignment = get_property ("textalignment"); + if (alignment.isnum_b()) + { + td_l->align_dir_= (Direction)(int)alignment; + } } typeset_element (script_p); } diff --git a/lily/text-def.cc b/lily/text-def.cc index b0dbaf5611..6c1664017b 100644 --- a/lily/text-def.cc +++ b/lily/text-def.cc @@ -12,6 +12,7 @@ #include "molecule.hh" #include "text-def.hh" #include "dimension.hh" +#include <ctype.h> Direction Text_def::staff_dir () const @@ -21,16 +22,29 @@ Text_def::staff_dir () const return DOWN; } +Real +Text_def::guess_width_f(Atom& a) const +{ + // Count each TeX command as one character, ugh + int index, length=0; + int total_length=text_str_.length_i(); + const char* str=text_str_.ch_C(); + for (index=0;index<total_length;index++) { + length++; + if (str[index]=='\\') + for (index++;(index < total_length) && isalpha(str[index]);index++) + ; + } + return length * a.dim_.x ().length (); // ugh +} + Interval Text_def::width (Paper_def * p) const { Atom a = get_atom (p,CENTER); - /* TODO: check string for \texcommand - */ - Real guess_width_f = text_str_.length_i() * a.dim_.x ().length (); // ugh - Interval i (0, guess_width_f); + Interval i (0, guess_width_f(a)); i += - (align_dir_ + 1)* i.center(); return i; } @@ -62,8 +76,7 @@ Text_def::get_atom (Paper_def *p, Direction) const { Atom a= p->lookup_l(0)->text (style_str_, text_str_); - Real guess_width_f = text_str_.length_i() * a.dim_.x ().length (); // ugh - a.translate_axis (-(align_dir_ + 1)* guess_width_f/ 2, X_AXIS); + a.translate_axis (-(align_dir_ + 1)* guess_width_f (a) / 2, X_AXIS); return a; } |