From 8054dbca2f440e4cdbf98af57a9d548df64f9f8f Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 19 Feb 2006 17:29:16 +0000 Subject: [PATCH] * 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 at Y + DIR*h + DELTA_Y. (get_variations): consider variation for dot positions too. --- ChangeLog | 5 +++++ Documentation/pictures/GNUmakefile | 34 ++++++------------------------ buildscripts/genicon.py | 31 +++++++++++++++++++++++++++ lily/tie-formatting-problem.cc | 4 ++-- 4 files changed, 44 insertions(+), 30 deletions(-) create mode 100644 buildscripts/genicon.py diff --git a/ChangeLog b/ChangeLog index 42d5170bfe..623838ef8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-02-19 Han-Wen Nienhuys + * 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 diff --git a/Documentation/pictures/GNUmakefile b/Documentation/pictures/GNUmakefile index 5ac3a4beeb..3d2cca7608 100644 --- a/Documentation/pictures/GNUmakefile +++ b/Documentation/pictures/GNUmakefile @@ -2,45 +2,23 @@ depth = ../.. 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) diff --git a/buildscripts/genicon.py b/buildscripts/genicon.py new file mode 100644 index 0000000000..2f02641ac9 --- /dev/null +++ b/buildscripts/genicon.py @@ -0,0 +1,31 @@ +#!@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()) + diff --git a/lily/tie-formatting-problem.cc b/lily/tie-formatting-problem.cc index fb3b74ad39..8d40e75f71 100644 --- a/lily/tie-formatting-problem.cc +++ b/lily/tie-formatting-problem.cc @@ -434,8 +434,8 @@ Tie_formatting_problem::score_configuration (Tie_configuration const &conf) cons { 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; -- 2.39.2