lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Rendering cropped SVG


From: potoroo
Subject: Re: Rendering cropped SVG
Date: Tue, 15 Sep 2015 20:22:02 +0200

Thanks, that works. I set up a build system for Sublime (which has Lilypond 
syntax highlighting with the SubLilyPond package).

{
        "shell_cmd": "lilypond -dno-point-and-click '$file_base_name.ly'; 
pdfcrop --margins 1 '$file_base_name.pdf' '$file_base_name.pdf'; pdf2svg 
'$file_base_name.pdf' '$file_base_name.svg'; rm -f '$file_base_name.pdf'; rm -f 
'$file_base_name.ps'",
        "selector": "source.lilypond",
}

This will render and crop a pdf, convert it to svg and delete the pdf. However, 
I don't know why it won't remove the .ps file, or why it is created in the 
first place. Is there a way to prevent Lilypond from creating the .ps file?


> Am 15.09.2015 um 04:02 schrieb David Wright <address@hidden>:
> 
> Quoting address@hidden (address@hidden):
>> I forgot: My file is just the minimum to test if Lilypond can do what I want 
>> it to do.
>> 
>> \pointAndClickOff
>> 
>> \relative {
>>  c' d e f g f e d
>>  c' d e f a a b d
>>  c' d e f a a b d
>> }
>> 
>> \version "2.18.2"
> 
> I typeset music fragments for insertion into LuaLaTeX files, so I
> generate .pdf files and then crop them. My .ly source is built up from
> quite a few includes, and processed with bash functions (on Debian)
> but I've processed this minimal fragment with the same utilities:
> 
> \version "2.18.2"
> \relative {
>  c' d e f g f e d
>  c' d e f a a b d
>  c' d e f a a b d
> }
> \header { tagline = ##f }
> \paper { indent = 0 \mm }
> 
> $ lilypond -dno-point-and-click -drelative-includes --include="$HOME/LilyLib" 
> foo.ly
> 
> $ pdfcrop --margins 1 foo.pdf bar.pdf
> 
> $ pdf2svg bar.pdf foo.svg
> 
> pdfcrop is from texlive in Debian's texlive-extra-utils
> pdf2svg homepage is at http://www.cityinthesky.co.uk/pdf2svg.html
> 
> Filesizes:
> 
>    141 foo.ly
>  18078 foo.pdf
>  17158 bar.pdf
>  39154 foo.svg
> 
> I checked the SVG with inkscape and it looks ok, as does the PDF.
> 
> I also ran your PNG command line:
> 
>   7454 foo.png
> 
> but I haven't looked at why the output has over a bar's width of
> whitespace at the right side. I don't use PNGs anyway because they're
> blurry, whereas PDFs (and the SVGs) remain crisp whatever the size.
> 
> I then added \break at the midpoint of the notes and reran everything.
> The SVG is complete, and it also happens to fix the PNG.
> 
> pdfcrop handles multiple pages; pdf2svg has to process a page at a time.
> 
> Cheers,
> David.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]