Re: Removing white space from svg output

2016-02-02 Thread paul booker
Paul Morris  paulwmorris.com> writes:

> 
> > On Feb 1, 2016, at 10:15 PM, Paul Booker  homebass.net> wrote:
> > 
> > Ok, that wasn't clear, got it now, thanks
> > Works for one-line parts but also converts two line pieces to one line,
> > ignoring the \break. Can I reinstate that somehow, without the white-space?
> 
> Not with this function.  It puts everything on one line.  The
ly:one-page-breaking function should do what
> you want, but it’s still in development, not released yet.
> 
> -Paul
> ___
> lilypond-user mailing list
> lilypond-user  gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
> 

Thanks for your guidance. I would never have come across these new features
otherwise.
As a bonus, 

\paper
top-system-spacing=##f

resolves the mysterious extra pixel included in my script's "viewBox="0 1 w
h). Now I can reset it to 0.

Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Removing white space from svg output

2016-02-01 Thread Paul Morris
> On Feb 1, 2016, at 10:15 PM, Paul Booker  wrote:
> 
> Ok, that wasn't clear, got it now, thanks
> Works for one-line parts but also converts two line pieces to one line,
> ignoring the \break. Can I reinstate that somehow, without the white-space?

Not with this function.  It puts everything on one line.  The 
ly:one-page-breaking function should do what you want, but it’s still in 
development, not released yet.

-Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Removing white space from svg output

2016-02-01 Thread Paul Booker
Paul Morris  paulwmorris.com> writes:

> 
> %
> 
> \version "2.19.36"
> 
> \paper {
>   page-breaking = #ly:one-line-auto-height-breaking
> }
> 
> { c1 }
> 
> %
> 
> The syntax is documented on that page in the Notation Reference that I
linked to in my previous message.
> 
> Cheers,
> -Paul
> 
Ok, that wasn't clear, got it now, thanks
Works for one-line parts but also converts two line pieces to one line,
ignoring the \break. Can I reinstate that somehow, without the white-space?
I'd really like to be able to change the svg units to the pixel size of the
png than change my layouts, line-breaks etc.





___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Removing white space from svg output

2016-02-01 Thread Paul Morris
> On Feb 1, 2016, at 8:00 PM, Paul Booker  wrote:
> 
> Interesting!
> I had a go, guessing with 
> 
>paper-height=#(one-line-auto-height-breaking)

Try this:

%

\version "2.19.36"

\paper {
  page-breaking = #ly:one-line-auto-height-breaking
}

{ c1 }

%

The syntax is documented on that page in the Notation Reference that I linked 
to in my previous message.

Cheers,
-Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Removing white space from svg output

2016-02-01 Thread Paul Booker

> 
> These are timely questions.  See ly:one-line-auto-height-breaking 
> 
>
http://lilypond.org/doc/v2.19/Documentation/notation/page-breaking#one_002dline_002dauto_002dheight-page-breaking
> 
> which just landed in the LilyPond development release, 2.19.36
> 

Interesting!
I had a go, guessing with 

paper-height=#(one-line-auto-height-breaking)

which worked on the svg output but with log as below
# -*-compilation-*-
Processing `ly/scaleC.ly'
Parsing...
include/defs.ily:9:19: error: GUILE signaled an error for the expression
beginning here
paper-height=#
  (one-line-auto-height-breaking)

Interpreting music...
Preprocessing graphical objects...
Interpreting music...
MIDI output to `ly/scaleC.mid'...
Finding the ideal number of pages...Unbound variable:
one-line-auto-height-breaking
C:/Program Files
(x86)/LilyPond/usr/share/lilypond/current/scm/page.scm:194:21: In procedure
- in expression (- paper-height (ly:output-def-lookup layout #)):
C:/Program Files
(x86)/LilyPond/usr/share/lilypond/current/scm/page.scm:194:21: Wrong type
argument in position 1: #
#
This also prevented the png output, so it suggests I should use different
definition.ily for each kind of output.



___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Removing white space from svg output

2016-02-01 Thread Paul Morris
Hi Paul,

> On Feb 1, 2016, at 7:36 AM, paul booker  wrote:
> 
> Can anyone see this becoming a scheme function which could sit in my
> defs.ily file and save this ugly step?
> I guess I mean an internal to Lilypond rather than external solution.
> I'm not at all familiar with Scheme, but I did peek at "svg-output.scm". I
> can't find the equivalent for png output.

These are timely questions.  See ly:one-line-auto-height-breaking 

http://lilypond.org/doc/v2.19/Documentation/notation/page-breaking#one_002dline_002dauto_002dheight-page-breaking

which just landed in the LilyPond development release, 2.19.36

There’s also (in the works) a similar ly:one-page-breaking function that will 
set the paper height to fit the music.  

http://sourceforge.net/p/testlilyissues/issues/4752/

Cheers,
-Paul
___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


Removing white space from svg output

2016-02-01 Thread paul booker
While trying to achieve svg output comparable to png output, I have reached
a workaround which comes close enough for my purposes. Now I have a question
at the other end of this!
I have this in my "defs.ily" file:

#(set-default-paper-size "a6" 'landscape) 
\paper{
indent=0\mm  
top-margin = 0\mm
right-margin = 0\mm
left-margin = 0\mm 
print-page-number = ##f   
oddFooterMarkup=##f
oddHeaderMarkup=##f
bookTitleMarkup = ##f
scoreTitleMarkup = ##f
}

Essentially minimises anything top and left of the "page". It may be more
than necessary.
I produce the png image (at 300dpi) and svg image, and file them in their
own folders.
>From the parent folder I run this shell script. This uses the pixel size of
the png to set the size of the svg, by changing the svg's width, height and
viewport sizes.

###start###
#!/bin/sh
# GNU bash, version 4.3.42(4)-release (x86_64-pc-msys)
# Assumes svg in svg folder and png in png folder with the same name for sizing
myfile=filenameNoSuffix
# ImageMagick identifies the size of the png image
well=$(identify -format "%w" png/$myfile.png)
hell=$(identify -format "%h" png/$myfile.png)
#Check that the variables now hold the size in pixels
echo well = $well
echo hell = $hell
# If png is 300dpi, divide sizes by 30 (if 100dpi, divide by 10)
wim=$(awk -v w=$well 'BEGIN { print w / 30 }')
him=$(awk -v h=$hell 'BEGIN { print h / 30 }')
# Again, check the result
echo wim = $wim
echo him = $him
# the 'sed' command replaces a line containing 'http://www.w3.org/2000/svg"; version="1.2" width="'$well'"
height="'$hell'" viewBox="0 1 '$wim' '$him'">
' svg/$myfile.svg
# "read" just keeps the window open to check values
read -p "Done, press ENTER"
##finish#

This might need tweaking for other shells.
My question is:
Can anyone see this becoming a scheme function which could sit in my
defs.ily file and save this ugly step?
I guess I mean an internal to Lilypond rather than external solution.
I'm not at all familiar with Scheme, but I did peek at "svg-output.scm". I
can't find the equivalent for png output.
Regards
Paul


___
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user