+2004-12-10 Han-Wen Nienhuys <hanwen@xs4all.nl>
+
+ * buildscripts/mf-to-table.py (write_ps_encoding): write real
+ names in .enc
+
+ * lily/*.cc: use '.' iso. '-' for separating glyph name elements.
+
2004-12-09 Graham Percival <gperlist@shaw.ca>
* Documentation/user/changing-defaults.itely: add info about
2004-12-09 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * buildscripts/mf-to-table.py (parse_logfile): use . for
+ concatting name and group.
+ (parse_logfile): use M for Minus (negative.)
+
* lily/include/type-swallow-translator.hh
(DECLARE_EVENT_SWALLOWER): ENTER_DESCRIPTION -> ADD_TRANSLATOR
group = ''
elif tags[0] == 'char':
name = tags[9]
+
+ name = re.sub ('-', 'M', name)
if group:
- name = group + '-' + name
+ name = group + '.' + name
m = {
'description': tags[1],
'name': name,
file.write ('\\endinput\n')
+def write_otf_lisp_table (file, global_info, charmetrics):
+
+ def conv_char_metric (charmetric):
+ f = 1.0
+ s = """((%s .
+(bbox . (%f %f %f %f))
+(attachment . (%f %f))))
+""" %(charmetric['name'],
+ -charmetric['breapth'] * f,
+ -charmetric['depth'] * f,
+ charmetric['width'] * f,
+ charmetric['height'] * f,
+ charmetric['wx'],
+ charmetric['wy'])
+
+ return s
+
+ for c in charmetrics:
+ file.write (conv_char_metric (c))
+
def write_ps_encoding (name, file, global_info, charmetrics):
encs = ['.notdef'] * 256
for m in charmetrics:
- encs[m['code']] = m['tex']
+ encs[m['code']] = m['name']
file.write ('/%s [\n' % name)
for m in range (0, 256):
(options, files) = \
getopt.getopt (sys.argv[1:],
'a:d:hl:o:p:t:',
- ['enc=', 'afm=', 'outdir=', 'dep=',
+ ['enc=', 'afm=', 'outdir=', 'dep=', 'lisp=',
'tex=', 'ly=', 'debug', 'help', 'package='])
+
+lisp_nm = ''
enc_nm = ''
texfile_nm = ''
depfile_nm = ''
outdir_prefix = a
elif o == '--tex' or o == '-t':
texfile_nm = a
+ elif o == '--lisp':
+ lisp_nm = a
elif o == '--enc':
enc_nm = a
elif o == '--ly' or o == '-l':
afmfile_nm = a
elif o == '--debug':
debug_b = 1
- elif o == '-p' or o == '--package':
- topdir = a
else:
print o
raise getopt.error
enc_name = 'FetaBraceEncoding'
write_ps_encoding (enc_name, open (enc_nm, 'w'), g, m)
-
+ write_otf_lisp_table (open (lisp_nm, 'w'), g, m)
if depfile_nm:
write_deps (open (depfile_nm, 'wb'), deps,
[base + '.dvi', base + '.pfa', base + '.pfb',
PKG_CONFIG_PATH=$HOME/usr/pkg/gnome/lib/pkgconfig:$PKG_CONFIG_PATH
PKG_CONFIG_PATH=$HOME/usr/pkg/pango/lib/pkgconfig:$PKG_CONFIG_PATH
-#STEPMAKE_FREETYPE2
+STEPMAKE_FREETYPE2
+STEPMAKE_PANGO
+
if test "$gui_b" = "yes"; then
STEPMAKE_GTK2
- STEPMAKE_PANGO
fi
## Optional tools for building documentation, website, extra fonts.
char const* to_str0 () const;
Byte const* to_bytes () const;
- char* get_str0 ();
- Byte* get_bytes ();
+ char *get_str0 ();
+ Byte *get_bytes ();
String &operator = (String const & source);
/// return uppercase of *this
String upper_string () const;
-
/// return lowercase of *this
String lower_string () const;
/// convert to a double
double to_double () const;
+
+ String substituted (char text, String sub) const;
};
/*
os << (Byte) (*this)[ i ];
}
#endif
+
+
+String
+String::substituted (char chr, String sub) const
+{
+ Byte const* t = this->to_bytes ();
+
+ String accumulator;
+ int n = length();
+ for (int i = 0; i < n; i++)
+ {
+ if (t[i] == chr)
+ accumulator += sub;
+ else
+ accumulator += String_convert::char_string (t[i], 1);
+ }
+
+ return accumulator;
+}
Stencil
parenthesize (Grob*me, Stencil m)
{
- Stencil open = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-leftparen"));
- Stencil close = Font_interface::get_default_font (me)->find_by_name (String ("accidentals-rightparen"));
+ Stencil open = Font_interface::get_default_font (me)->find_by_name ("accidentals.leftparen");
+ Stencil close = Font_interface::get_default_font (me)->find_by_name ("accidentals.rightparen");
m.add_at_edge (X_AXIS, LEFT, Stencil (open), 0,0);
m.add_at_edge (X_AXIS, RIGHT, Stencil (close), 0,0);
{
int alteration = scm_to_int (scm_car (s));
String font_char = get_fontcharname (style, alteration);
- Stencil acc (fm->find_by_name ("accidentals-" + font_char));
+ Stencil acc (fm->find_by_name ("accidentals." + font_char));
if (acc.is_empty ())
{
Stencil mol;
Font_metric *fm = Font_interface::get_default_font (me);
- Stencil squiggle = fm->find_by_name ("scripts-arpeggio");
+ Stencil squiggle = fm->find_by_name ("scripts.arpeggio");
Stencil arrow ;
if (dir)
{
- arrow = fm->find_by_name ("scripts-arpeggio-arrow-" + to_string (dir));
+ arrow = fm->find_by_name ("scripts.arpeggio.arrow." + to_string (dir));
heads[dir] -= dir * arrow.extent (Y_AXIS).length ();
}
Grob * me = unsmob_grob (smob);
Axis a = (Axis)scm_to_int (axis);
assert (a == X_AXIS);
- Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts-arpeggio");
+ Stencil arpeggio = Font_interface::get_default_font (me)->find_by_name ("scripts.arpeggio");
return ly_interval2scm (arpeggio.extent (X_AXIS));
}
class Auto_beam_engraver : public Engraver
{
TRANSLATOR_DECLARATIONS (Auto_beam_engraver);
+
protected:
virtual void stop_translation_timestep ();
virtual void start_translation_timestep ();
Stencil thin = simple_barline (me, hair, h);
Stencil thick = simple_barline (me, fatline, h);
- Stencil dot = Font_interface::get_default_font (me)->find_by_name ("dots-dot");
+ Stencil dot = Font_interface::get_default_font (me)->find_by_name ("dots.dot");
int lines = Staff_symbol_referencer::line_count (me);
Real dist
(c) 1997--2004 Han-Wen Nienhuys <hanwen@cs.uu.nl>
Jan Nieuwenhuizen <janneke@gnu.org>
-
-
*/
-
-
#include <math.h>
#include "warn.hh"
(c) 1998--2004 Jan Nieuwenhuizen <janneke@gnu.org>
*/
-
#include <math.h>
#include "bezier.hh"
virtual bool try_music (Music *ev) ;
virtual void stop_translation_timestep ();
virtual void create_audio_elements ();
+
private:
Link_array<Music> note_evs_;
Link_array<Audio_note> notes_;
Stencil
Font_metric::find_by_name (String s) const
{
+ s = s.substituted ('-', "M");
int idx = name_to_index (s);
Box b;
int alteration = scm_to_int (scm_cdar (s));
String font_char =
Accidental_interface::get_fontcharname (style, alteration);
- Stencil acc (fm->find_by_name ("accidentals-" + font_char));
+ Stencil acc (fm->find_by_name ("accidentals." + font_char));
if (acc.is_empty ())
{
Font_metric *fm = select_font (me->get_layout (),
scm_cons (style_alist,
alist_chain));
- Stencil m = fm->find_by_name ("scripts-trill-element");
+ Stencil m = fm->find_by_name ("scripts.trill.element");
Stencil mol;
do
if (sym == "Discant")
{
- Stencil r = fm->find_by_name ("accordion-accDiscant");
+ Stencil r = fm->find_by_name ("accordion.accDiscant");
m.add_stencil (r);
if (reg.left_string (1) == "F")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
}
if (eflag & 0x02)
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
m.add_stencil (d);
}
if (eflag & 0x04)
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
d.translate_axis (0.8 * staff_space PT, X_AXIS);
m.add_stencil (d);
}
if (eflag & 0x01)
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
d.translate_axis (-0.8 * staff_space PT, X_AXIS);
m.add_stencil (d);
}
if (reg.left_string (2) == "SS")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (0.5 * staff_space PT, Y_AXIS);
d.translate_axis (0.4 * staff_space PT, X_AXIS);
m.add_stencil (d);
}
if (reg.left_string (1) == "S")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (0.5 * staff_space PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
}
else if (sym == "Freebase")
{
- Stencil r = fm->find_by_name ("accordion-accFreebase");
+ Stencil r = fm->find_by_name ("accordion.accFreebase");
m.add_stencil (r);
if (reg.left_string (1) == "F")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
}
if (reg == "E")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
m.add_stencil (d);
}
}
else if (sym == "Bayanbase")
{
- Stencil r = fm->find_by_name ("accordion-accBayanbase");
+ Stencil r = fm->find_by_name ("accordion.accBayanbase");
m.add_stencil (r);
if (reg.left_string (1) == "T")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
/* include 4' reed just for completeness. You don't want to use this. */
if (reg.left_string (1) == "F")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
}
if (reg.left_string (2) == "EE")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
d.translate_axis (0.4 * staff_space PT, X_AXIS);
m.add_stencil (d);
}
if (reg.left_string (1) == "E")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
}
else if (sym == "Stdbase")
{
- Stencil r = fm->find_by_name ("accordion-accStdbase");
+ Stencil r = fm->find_by_name ("accordion.accStdbase");
m.add_stencil (r);
if (reg.left_string (1) == "T")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 3.5 PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
}
if (reg.left_string (1) == "F")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 2.5 PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
}
if (reg.left_string (1) == "M")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 2 PT, Y_AXIS);
d.translate_axis (staff_space PT, X_AXIS);
m.add_stencil (d);
}
if (reg.left_string (1) == "E")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 1.5 PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
}
if (reg.left_string (1) == "S")
{
- Stencil d = fm->find_by_name ("accordion-accDot");
+ Stencil d = fm->find_by_name ("accordion.accDot");
d.translate_axis (staff_space * 0.5 PT, Y_AXIS);
m.add_stencil (d);
reg = reg.right_string (reg.length ()-1);
for the rectangle */
else if (sym == "SB")
{
- Stencil r = fm->find_by_name ("accordion-accSB");
+ Stencil r = fm->find_by_name ("accordion.accSB");
m.add_stencil (r);
}
else if (sym == "BB")
{
- Stencil r = fm->find_by_name ("accordion-accBB");
+ Stencil r = fm->find_by_name ("accordion.accBB");
m.add_stencil (r);
}
else if (sym == "OldEE")
{
- Stencil r = fm->find_by_name ("accordion-accOldEE");
+ Stencil r = fm->find_by_name ("accordion.accOldEE");
m.add_stencil (r);
}
else if (sym == "OldEES")
{
- Stencil r = fm->find_by_name ("accordion-accOldEES");
+ Stencil r = fm->find_by_name ("accordion.accOldEES");
m.add_stencil (r);
}
return m;
Real head_width =
Font_interface::get_default_font (ligature)->
- find_by_name ("noteheads--1mensural").extent (X_AXIS).length ();
+ find_by_name ("noteheads.-1mensural").extent (X_AXIS).length ();
Real flexa_width = robust_scm2double (ligature->get_property ("flexa-width"), 2);
flexa_width *= Staff_symbol_referencer::staff_space (ligature);
flexa_width, thickness, true, DOWN);
break;
case MLP_sc: // mensural brevis head with right cauda
- out = Font_interface::get_default_font (me)->find_by_name ("noteheads--2mensural");
+ out = Font_interface::get_default_font (me)->find_by_name ("noteheads.-2mensural");
break;
case MLP_ss: // mensural brevis head
- out = Font_interface::get_default_font (me)->find_by_name ("noteheads--1mensural");
+ out = Font_interface::get_default_font (me)->find_by_name ("noteheads.-1mensural");
break;
case MLP_cs: // mensural brevis head with left cauda
- out = Font_interface::get_default_font (me)->find_by_name ("noteheads-lmensural");
+ out = Font_interface::get_default_font (me)->find_by_name ("noteheads.lmensural");
break;
case MLP_SS:
out = brew_flexa (me, delta_pitch, false,
k = -1;
}
- Stencil r (musfont->find_by_name ("rests-" + to_string (k)));
+ Stencil r (musfont->find_by_name ("rests." + to_string (k)));
symbols_width += r.extent (X_AXIS).length ();
mols = scm_cons (r.smobbed_copy (), mols);
}
l--;
}
- Stencil r (musfont->find_by_name ("rests-" + to_string (k)));
+ Stencil r (musfont->find_by_name ("rests." + to_string (k)));
if (k == 0)
{
Real staff_space = Staff_symbol_referencer::staff_space (me);
Stencil out;
- String prefix = "noteheads-";
+ String prefix = "noteheads.";
String idx =
prefix + ((stem_dir == UP) ? "u" : "d") + ly_scm2string (scm_font_char);
out = fm->find_by_name (idx);
{
m.add_at_edge (X_AXIS, RIGHT, s, -slash_neg_kern,0);
}
- Stencil d1 = Font_interface::get_default_font (me)->find_by_name ("dots-dot");
+ Stencil d1 = Font_interface::get_default_font (me)->find_by_name ("dots.dot");
Stencil d2 = d1;
d1.translate_axis (0.5, Y_AXIS );
d2.translate_axis (-0.5, Y_AXIS);
SCM str = ((scm_is_pair (name_entry)) ? index_get_cell (name_entry, d)
: name_entry);
return Font_interface::get_default_font (me)
- ->find_by_name ("scripts-" + ly_scm2string (str));
+ ->find_by_name ("scripts." + ly_scm2string (str));
}
else if (key == ly_symbol2scm ("accordion"))
return Lookup::accordion (scm_cdr (s), 1.0,
String font_char = flag_style
+ to_string (dir) + staffline_offs + to_string (duration_log (me));
Font_metric *fm = Font_interface::get_default_font (me);
- Stencil flag = fm->find_by_name ("flags-" + font_char);
+ Stencil flag = fm->find_by_name ("flags." + font_char);
if (flag.is_empty ())
me->warning (_f ("flag `%s' not found", font_char));
if (!stroke_style.is_empty ())
{
String font_char = to_string (dir) + stroke_style;
- Stencil stroke = fm->find_by_name ("flags-" + font_char);
+ Stencil stroke = fm->find_by_name ("flags." + font_char);
if (stroke.is_empty ())
me->warning (_f ("flag stroke `%s' not found", font_char));
else
String char_name = style + to_string (n) + "/" + to_string (d);
me->set_property ("font-encoding", ly_symbol2scm ("fetaMusic"));
Stencil out = Font_interface::get_default_font (me)
- ->find_by_name ("timesig-" + char_name);
+ ->find_by_name ("timesig." + char_name);
if (!out.is_empty ())
return out;
head_width = 0.0;
x_offset = join_thickness -
Font_interface::get_default_font (primitive)->
- find_by_name ("noteheads-" + glyph_name).extent (X_AXIS).length ();
+ find_by_name ("noteheads." + glyph_name).extent (X_AXIS).length ();
}
else if (!String::compare (glyph_name, "flexa") ||
!String::compare (glyph_name, ""))
*/
head_width =
Font_interface::get_default_font (primitive)->
- find_by_name ("noteheads-" + glyph_name).extent (X_AXIS).length ();
+ find_by_name ("noteheads." + glyph_name).extent (X_AXIS).length ();
x_offset = 0.0;
}
{
out =
Font_interface::get_default_font (me)->
- find_by_name ("noteheads-" + glyph_name);
+ find_by_name ("noteheads." + glyph_name);
}
out.translate_axis (x_offset, X_AXIS);
Real head_width = out.extent (X_AXIS).length ();
AF_FILES = $(wildcard *.af)
-EXTRA_DIST_FILES += README feta.tex
+EXTRA_DIST_FILES += README feta.tex merge.pe
+
# We don't use $(MF_FILES), because there's more .mf cruft here
FETA_MF_FILES = $(wildcard feta[0-9]*.mf)\
##
## todo: this also depends on .tfm, FIXME.
$(outdir)/%.afm $(outdir)/%.enc $(outdir)/%.tex $(outdir)/%list.ly $(outdir)/%.dep: $(outdir)/%.log $(outdir)/%.tfm
- $(PYTHON) $(buildscript-dir)/mf-to-table.py --package=$(topdir) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --afm $(outdir)/$(<F:.log=.afm) --enc $(outdir)/$(<F:.log=.enc) --tex $(outdir)/$(<F:.log=.tex) --ly $(outdir)/$(<F:.log=list.ly) $<
+ $(PYTHON) $(buildscript-dir)/mf-to-table.py --lisp=$(outdir)/$(<F:.log=.lisp) --outdir=$(outdir) --dep $(outdir)/$(<F:.log=.dep) --afm $(outdir)/$(<F:.log=.afm) --enc $(outdir)/$(<F:.log=.enc) --tex $(outdir)/$(<F:.log=.tex) --ly $(outdir)/$(<F:.log=list.ly) $<
fontdir: $(addprefix $(outdir)/, lilypond.map lilypond.sfd private-fonts fonts.scale fonts.dir Fontmap.lily)
% Extendable Trill symbol.
% Not yet used
% Rename me to Trill, rename Trill to Tr?
-fet_beginchar("Trill-element","trill-element","trillelement");
+fet_beginchar("Trill_element","trill_element","trillelement");
save height, overshoot;
height# = staff_space#;
width# = 0.8height#;
penlabels(1,2,3,4,5,6);
enddef;
-fet_beginchar ("4/4 meter", "C4/4", "fourfourmeter")
+fet_beginchar ("4/4 meter", "C44", "fourfourmeter")
draw_C;
fet_endchar;
-fet_beginchar ("2/2 meter", "C2/2", "allabreve")
+fet_beginchar ("2/2 meter", "C22", "allabreve")
draw_C;
save excentricity;
pair excentricity;