]> git.donarmstrong.com Git - lilypond.git/commitdiff
* Documentation/pictures/GNUmakefile (local-dist): loose the rule
authorHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 19 Feb 2006 17:29:16 +0000 (17:29 +0000)
committerHan-Wen Nienhuys <hanwen@xs4all.nl>
Sun, 19 Feb 2006 17:29:16 +0000 (17:29 +0000)
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
Documentation/pictures/GNUmakefile
buildscripts/genicon.py [new file with mode: 0644]
lily/tie-formatting-problem.cc

index 42d5170bfefa2272958384d96c653f949a747d09..623838ef8ef1023d9ce50544f5374328744294ae 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 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
index 5ac3a4beeb2f6a7884f81986c5fe8435cc0f124c..3d2cca7608da0bfecb236d3b4533ecb6e4c3cffa 100644 (file)
@@ -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 (file)
index 0000000..2f02641
--- /dev/null
@@ -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())            
+
index fb3b74ad39d932b9b69ed2281a9059382cc7736c..8d40e75f71784c9f4aad5ed497fd7abbd824c656 100644 (file)
@@ -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;