2006-02-19 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * Documentation/pictures/GNUmakefile (local-dist): loose the rule
+ spaghetti for icons.
+
+ * buildscripts/genicon.py (program_name): new file.
+
* lily/tie-formatting-problem.cc (set_chord_outline): put dots
in outline too.
(generate_configuration): for small ties, also look for collisions
STEPMAKE_TEMPLATES=documentation
XPM_FILES=$(wildcard *.xpm)
-OUTGIF_FILES = $(addprefix $(outdir)/,$(XPM_FILES:.xpm=.gif))
-OUTPNG_FILES = $(addprefix $(outdir)/,$(XPM_FILES:.xpm=.png))
-
EXTRA_DIST_FILES= $(XPM_FILES)
-include $(depth)/make/stepmake.make
-
-ifeq ($(PLATFORM_WINDOWS),yes)
-OUT_DIST_FILES = $(lilypond-icon) $(ly-icon) # $(package-icon)
-
-ICON_SIZES=48 32 16
-
lilypond-icon = $(outdir)/lilypond.ico
ly-icon = $(outdir)/ly.ico
-#$(outdir)/lilypond.ico: platte-lucht-kikker-ly-48.xpm
-
-$(outdir)/%.ico: $(ICON_SIZES:%=$(outdir)/\%-%.png) $(ICON_SIZES:%=$(outdir)/\%-%-8.png)
- #convert +adjoin $^ $@
- icotool --output=$@ --create $^
+include $(depth)/make/stepmake.make
-# cancel default rule that breaks transparency
-$(outdir)/%.png: %.xpm
+ifeq ($(PLATFORM_WINDOWS),yes)
-$(outdir)/%-48.png: %.xpm
- convert -sample 48 -depth 24 $< $@
-
-$(outdir)/%-32.png: %.xpm
- convert -depth 24 -sample 32 $< $@
+$(outdir)/%.ico: %.xpm
+ $(PYTHON) $(buildscript-dir)/genico.py $< $@
-$(outdir)/%-16.png: %.xpm
- convert -depth 24 -sample 16 $< $@
+default: $(lilypond-icon) $(ly-icon)
-$(outdir)/%-8.png: $(outdir)/%.png
- convert -depth 8 $< $@
endif # PLATFORM_WINDOWS
-default: $(lilypond-icon) $(ly-icon)
-local-dist: $(icon) # $(package-icon)
+local-dist: $(icon)
xgifs: $(OUTGIF_FILES)
pngs: $(OUTPNG_FILES)
local-WWW: $(OUTPNG_FILES)
--- /dev/null
+#!@PYTHON@
+import os
+import sys
+import tempfile
+
+base = os.path.splitext (os.path.split (sys.argv[1])[1])[0]
+input = os.path.abspath (sys.argv[1])
+output = os.path.abspath (sys.argv[2])
+program_name= os.path.split (sys.argv[0])[1]
+
+dir = tempfile.mktemp (program_name)
+os.mkdir (temp_dir, 0777)
+os.chdir(dir)
+
+def system (c):
+ print c
+ if os.system (c):
+ raise 'barf'
+
+outputs = []
+for sz in [48,32,16] :
+
+ for depth in [24,8]:
+ out = '%(base)s-%(sz)d-%(depth)d.png' % locals()
+ system ('convert -depth %(depth)d -sample %(sz)d %(input)s %(out)s' %
+ locals ())
+ outputs.append (out)
+
+system('icotool --output %s --create %s' % (output, ' '.join (outputs)))
+system('rm -rf %(dir)s' % locals())
+
{
Real penalty = 0.0;
Real length = conf.attachment_x_.length ();
- if (length < details_.min_length_)
- penalty += details_.length_penalty_factor_ / max (0.01, length);
+
+ penalty += peak_around (0.5 * details_.min_length_, details_.min_length_, length);
Real tip_pos = conf.position_ + conf.delta_y_ / 0.5 * details_.staff_space_;
Real tip_y = tip_pos * details_.staff_space_ * 0.5;