2005-04-14 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * python/lilylib.py (make_ps_images): use -dEPSCrop
+
* VERSION (PACKAGE_NAME): release 2.5.19
* Documentation/user/lilypond-book.itely (Invoking lilypond-book):
-#(ly:set-option 'old-relative)
% NOT FINISHED!!!!
\include "deutsch.ly"
c c8 c c16 r4_\fermata r8 \bar "|." |
}
+
+\paper {
+ indent = 0.5 \in
+ % textheight = 29.8 \cm
+ pagenumber = no
+ linewidth = 17.0 \cm
+}
+
\score {
\context PianoStaff <<
#(set-accidental-style 'piano-cautionary)
<< \global \context Voice = "lva" \lefta \context Voice = "lvb" \leftb >>
}
>>
- \layout {
- interscoreline = 0.0
- interscorelinefill = 1
- indent = 0.5 \in
- % textheight = 29.8 \cm
- pagenumber = no
- linewidth = 17.0 \cm
+ \layout {
\context {
\RemoveEmptyStaffContext
}
%% 394 capital delta
#(ly:export (ly:wide-char->utf-8 #x0394))
-
- %% need to have symbol; can't deal with TTF yet.
- %\override #'(font-name . "Symbol")
-
%% 2206 : delta from the symbol font.
% #(ly:export (ly:wide-char->utf-8 #x2206))
base = re.sub (r'\.e?ps', '', ps_name)
header = open (ps_name).read (1024)
- match = re.search (BOUNDING_BOX_RE, header, re.MULTILINE)
- bbox = []
- if match:
- bbox = map (string.atoi, match.groups ())
png1 = base + '.png'
pngn = base + '-page%d.png'
output_file = pngn
multi_page = re.search ('\n%%Pages: ', header)
+
if not multi_page:
- if not bbox:
- bbox = get_bbox (ps_name)
-
- transform_ps = ps_name + '.trans.ps'
-
- # Use margin to avoid letters getting cropped off.
- margin = 3
- h = open (transform_ps, 'w')
- h.write ('%d %d translate\n' % (-bbox[0] + margin,
- -bbox[1] + margin))
- h.close ()
-
- x = (2* margin + bbox[2] - bbox[0]) \
- * resolution / 72.0
- y = (2* margin + bbox[3] - bbox[1]) \
- * resolution / 72.0
- if x == 0:
- x = 1
- if y == 0:
- y = 1
-
cmd = r'''gs\
- -g%(x)dx%(y)d\
+ -dEPSCrop
-dGraphicsAlphaBits=4\
-dNOPAUSE\
-dTextAlphaBits=4\
- -sDEVICE=png16m\
+ -sDEVICE=pnggray\
-sOutputFile='%(output_file)s'\
-sPAPERSIZE=%(papersize)s\
-q\
-r%(resolution)d\
- %(transform_ps)s\
'%(ps_name)s'\
-c showpage\
-c quit ''' % vars ()
-dGraphicsAlphaBits=4\
-dNOPAUSE\
-dTextAlphaBits=4\
- -sDEVICE=png16m\
+ -sDEVICE=pnggray\
-sOutputFile='%(output_file)s'\
-sPAPERSIZE=%(papersize)s\
-q\