Re: Fonts in SVG output

2007-08-11 Thread Erik Sandberg
On Sunday 08 July 2007, Benjamin Esham wrote:
 Benjamin Esham wrote:
  I'm having some issues with Lilypond 2.10.x's SVG export.

 I seem to have fixed most (all?) of my font problems.  I now have another
 problem, however.

 In order to submit one of LilyPond's SVGs to e.g. the Wikimedia Commons, it
 is necessary to convert all of its text into paths; that way, users need
 not have LilyPond's fonts in order to view the image correctly.  Before
 converting text into paths in Inkscape, you must make sure that none of the
 text is contained within a group.  Therefore, I started to process my file
 by selecting everything and issuing an Ungroup command.

 When I did so, the staff lines disappeared!  Apparently every object in the
 file is in a one-element group.  For some reason, ungrouping the staff
 lines made them disappear—they were still present, just not visible.  I
 think there may be an Inkscape bug at play here too, since Select All
 couldn't find the lines, but on the LilyPond end... how can I get Lily to
 create a sane, usable SVG file?

 Any help is greatly appreciated here.

There's another approach to the SVG output problem: You can take PDF or EPS 
output from lilypond, and try to turn it into SVG files. The postscript 
backend of lilypond is obviously more mature, and there exist converters from 
pdf/ps to svg. Free converters are a bit shaky, but for some lily versions I 
managed to convert .ly files into valid SVG via a chain of converters.

Usually, you need to first expand fonts to curves using some ps2ps-like 
script, and then use pstoedit to convert to something that can be converted 
to svg. Unfortunately, most conversion tools are rather immature, so you will 
need some experimenting to make it work. IIRC, I managed to generate valid 
svg with this method for my master's thesis, using a lilypond version around 
2.6. I don't remember the exact combination of commands that worked though.

(I have vague memories that it may be good to start with pdf output and 
convert it back to eps)

Here's a script that works for some subsets of ps (not lily's though), you can 
look at it for ideas:
http://en.wikipedia.org/wiki/Wikipedia:WikiProject_Electronics/Ps2svg.sh

If you manage to find a fairly reliable path to convert the output of a recent 
lily version into wikipedia-usable SVGs, I'd be happy to know.

Erik


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


Re: Fonts in SVG output

2007-07-17 Thread Stuart Pullinger
Hi,

I thought I ought to follow up what Nick has said with a little
explanation of what I have done. (This is probably more appropriate to
the lilypond-devel list but, since the discussion was started on
*-user, I am following up here). I should also point out that I am not
a C/Guile/Scheme expert so there may be a much easier way to do the
following.

I have a database with music and performance data in it. I need to
create a score and display performance data above each note in the
score. I have written a Python script which creates a *.ly file from a
query to the database. Each line in the file contains just 1 note with
a comment at the end which contains the note ID number (which is unique
to each note in the database). The file is processed by a slightly
hacked version of lilypond to produce an *.svg file.

I changed the interpret_stencil_expression function, in
the ./lily/stencil-interpret.cc C file, after the

head == ly_symbol2scm (grob-cause)

line. (If I understand correctly, the grob-cause function is called
once to create the links to source file lines in the pdf output). It
now calls grob-cause with an extra begin parameter, followed by
calling itself, followed by grob-cause with an end parameter.

I changed the grob-cause function in the ./scm/output-svg.scm scheme
file to create a link to the originating line in the *.ly file on each
notehead. It creates an opening tag the first time it is called and a
closing tag the second time.

I then process the *.svg file to follow each link to the *.ly file and
read the originating note ID number from the comment at the end of the
line. I can then use the ID to access relevant data in the database and
display it above the notehead.

There are several problems with this approach:
The hacks break support for any other output other than SVG.
- Solution: I keep the hacked version in its own source tree and link
to it using the --relocate option.

The output could be made more informative by adding more/different data
to the svg output. For example, so that an SVG line says I am a ledger
line or I am a note stem. I hope to implement this in the not too
distant future. I'll keep the list posted.

No SVG viewers that I am aware of support multiple pages.
- Solution: An XSL transform or simple Python script could extract the
pages from the SVG output. I just haven't got around to this yet.

No SVG viewers that I am aware of actually use the font descriptions in
the lilypond SVG output - they rely on the correct font being available
in the system font directory.

Inkscape and rsvg-view (part of librsvg on most GNU-Linux distros) seem
to be the most reliable for displaying lilypond SVG output. I have had
some problems with SVGs and fonts. It seems to work OK if I use the
same version of lilypond for hacking and normal use and have copies of
the fonts in my ~/.fonts directory (GNU-Linux).

If anyone is interested in my hacks I would be happy to provide
code/patches.

Stuart


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


Re: Fonts in SVG output

2007-07-10 Thread Vincent
 I seem to have fixed most (all?) of my font problems.

did you managed to get the aybabtu font in the svg file? if yes, how?

thanks and greetings,

Vincent



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


Re: Fonts in SVG output

2007-07-08 Thread Nick Bailey

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1


On 8 Jul 2007, at 2:58 am, Graham Percival wrote:


Benjamin Esham wrote:
In order to submit one of LilyPond's SVGs to e.g. the Wikimedia  
Commons, it
is necessary to convert all of its text into paths; that way,  
users need not

have LilyPond's fonts in order to view the image correctly.  Before
converting text into paths in Inkscape, you must make sure that  
none of the
text is contained within a group.  Therefore, I started to process  
my file

by selecting everything and issuing an Ungroup command.
When I did so, the staff lines disappeared!  Apparently every  
object in the
file is in a one-element group.  For some reason, ungrouping the  
staff lines
made them disappear―they were still present, just not visible.  I  
think
there may be an Inkscape bug at play here too, since Select All  
couldn't
find the lines, but on the LilyPond end... how can I get Lily to  
create a

sane, usable SVG file?  Any help is greatly appreciated here.


There have been some discussions about SVG recently; it's an area  
of considerable interest to some users, including me.  Another  
example is this:

http://lists.gnu.org/archive/html/bug-lilypond/2007-07/msg9.html


Unfortunately, nobody is working on LilyPond SVG output.  We  
currently lack the developer resources to keep up with the current  
bug reports, let alone adding new features like improved SVG support.


I strongly urge anybody who is interested in SVG support to  
consider contributing resources (either source code or offering a  
bounty) to this end.  If you are involved in a project that uses  
SVG (like this Wikimedia Commons thing), then perhaps you could  
encourage one of their programmers (who is familiar with SVG) to  
work on lilypond's output.


Cheers,
- Graham


We are very interested in SVG output, and we're working on it, but  
with only very limited resources I'm afraid. The reason we're  
interested is that we see it as an excellent vehicle for enabling  
Lilypond to be used as a typesetting engine in database queries.  
We're wanting to produce excellent quality scores automatically and  
typeset additional information which arises as the result of, for  
example, performance information stored in a database.


Stuart Pullinger made a quick hack of the scheme and there's a brief  
demo of what might be done here:


http://markov.music.gla.ac.uk/Click-Chopin

Not much yet, but much much better than nothing. We also had font  
issues, so the SVG gets converted to PNG server-side. Stuart's wiki  
page: http://markov.music.gla.ac.uk/cmt-wiki/StuartPullinger


I can't offer a bounty per se, but if any UK national with a 1st  
class or upper second in a numerate discipline seriously wants to  
work on this for three or four years, we might be able to fund a PhD  
studentship (£12600p.a. tax free if memory serves, no council tax to  
pay). email me.


Perhaps someone should copy this to the dev list?

Nick/.
http://www.n-ism.org
http://cmt.gla.ac.uk

-BEGIN PGP SIGNATURE-
Version: GnuPG v1.2.3 (Darwin)

iD8DBQFGkKm1Fo+kGmUnzkQRAhO9AJ9mHT+vuF1rssOcXlDB/duynmImCQCeLehZ
4VmJVZD/IjE+uck6/YLMI+E=
=4sdx
-END PGP SIGNATURE-


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


Re: Fonts in SVG output

2007-07-07 Thread Benjamin Esham
Benjamin Esham wrote:

 I'm having some issues with Lilypond 2.10.x's SVG export.

I seem to have fixed most (all?) of my font problems.  I now have another
problem, however.

In order to submit one of LilyPond's SVGs to e.g. the Wikimedia Commons, it
is necessary to convert all of its text into paths; that way, users need not
have LilyPond's fonts in order to view the image correctly.  Before
converting text into paths in Inkscape, you must make sure that none of the
text is contained within a group.  Therefore, I started to process my file
by selecting everything and issuing an Ungroup command.

When I did so, the staff lines disappeared!  Apparently every object in the
file is in a one-element group.  For some reason, ungrouping the staff lines
made them disappear—they were still present, just not visible.  I think
there may be an Inkscape bug at play here too, since Select All couldn't
find the lines, but on the LilyPond end... how can I get Lily to create a
sane, usable SVG file?  

Any help is greatly appreciated here.
-- 
Benjamin D. Esham
[EMAIL PROTECTED]  |  AIM: bdesham128  |  Jabber: same as e-mail
All that is necessary for the triumph of evil is that good men
do nothing.— attributed to Edmund Burke



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


Re: Fonts in SVG output

2007-07-07 Thread Graham Percival

Benjamin Esham wrote:

In order to submit one of LilyPond's SVGs to e.g. the Wikimedia Commons, it
is necessary to convert all of its text into paths; that way, users need not
have LilyPond's fonts in order to view the image correctly.  Before
converting text into paths in Inkscape, you must make sure that none of the
text is contained within a group.  Therefore, I started to process my file
by selecting everything and issuing an Ungroup command.

When I did so, the staff lines disappeared!  Apparently every object in the
file is in a one-element group.  For some reason, ungrouping the staff lines
made them disappear—they were still present, just not visible.  I think
there may be an Inkscape bug at play here too, since Select All couldn't
find the lines, but on the LilyPond end... how can I get Lily to create a
sane, usable SVG file?  


Any help is greatly appreciated here.


There have been some discussions about SVG recently; it's an area of 
considerable interest to some users, including me.  Another example is this:

http://lists.gnu.org/archive/html/bug-lilypond/2007-07/msg9.html


Unfortunately, nobody is working on LilyPond SVG output.  We currently 
lack the developer resources to keep up with the current bug reports, 
let alone adding new features like improved SVG support.


I strongly urge anybody who is interested in SVG support to consider 
contributing resources (either source code or offering a bounty) to this 
end.  If you are involved in a project that uses SVG (like this 
Wikimedia Commons thing), then perhaps you could encourage one of their 
programmers (who is familiar with SVG) to work on lilypond's output.


Cheers,
- Graham


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


Re: Fonts in SVG output

2007-07-07 Thread Benjamin Esham
Graham Percival wrote:

 I strongly urge anybody who is interested in SVG support to consider
 contributing resources (either source code or offering a bounty) to this
 end.  If you are involved in a project that uses SVG (like this Wikimedia
 Commons thing), then perhaps you could encourage one of their programmers
 (who is familiar with SVG) to work on lilypond's output.

I have posted a call for help to that effect to the Wikimedia Commons
mailing list; hopefully someone there will be able to contribute, or will
know someone who can.  (There should be a number of SVG experts on that
list, and a bunch of coders as well.)  I would help myself, but know very
little about SVG's internals, and nothing whatsoever about Scheme.  Maybe if
I get some free time I can learn...

Cheers,
-- 
Benjamin D. Esham
[EMAIL PROTECTED]  |  AIM: bdesham128  |  Jabber: same as e-mail
As Gregor Samsa woke one morning from uneasy dreams he found
himself transformed in his bed into a monstrous vermin.
— Kafka, /The Metamorphosis/



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


Re: Fonts in SVG output

2007-06-12 Thread Vincent

 It is little difficult for me. I have in directory 
 ~/.fonts no fonts. There is only any file named fonts.dir.
 Is it necessary copy fonts into this directory from 
 other one? Will Inscape prefer fonts from this directory? 

Sorry, I don't use linux (yet ;-). I guess ~/fonts is where
linux stores the font files, but I don't know exactly what 
it is. In windows this is a folder named c:\windows\fonts.
I have all the lilypond otf font files here and inkscape
just finds them there.

I don't know how inkscape finds the fonts under 
linux, or how to configure it. Perhaps some linux user can 
tell you more about that. 

See more in this thread:

http://lists.gnu.org/archive/html/lilypond-user/2005-11/msg00194.html

Greetings,

Vincent






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


Re: Fonts in SVG output

2007-06-08 Thread Krokyn


Make sure the fonts you have in ~/.fonts are exactly the same 
 employed by the lilypond version you are using to the generate 
 the svg file.
 
 I've had the same problem before and I've found that the fonts
 vary quite often from one version to the next (at least in the 
 development brach). I replace the fonts each time I upgrade the
 lilypond version and then I recreate the svg file again. This
 works for me (except the aybabtu font).
 
 For the time signature and bar numbers, lilypond seems to 
 insist in using the feta font when it renders the svg file, 
 but (I guess) it should use Emmentaler. Because the feta 
 font doesn't exist for Inkscape, it uses the default font.
 
 Greetings,
 
 Vincent
 
 
 
 ___
 lilypond-user mailing list
 lilypond-user@gnu.org
 http://lists.gnu.org/mailman/listinfo/lilypond-user
 
 
Hi Vincent,

It is little difficult for me. I have in directory ~/.fonts no fonts. There
is only any file named fonts.dir.
Is it necessary copy fonts into this directory from other one? Will Inscape
prefer fonts from this directory? 

Sorry I am beginner in Linux. I'd like to combine lilypond score with draws
of notes about interpretation in different takes (like music director) and
Inscape is by my opinion the best way. Now, i make it in OpenOffice with
beautiful lilypond macro. But I'd like prefer to use vector graphic, not
png.
http://krokyn.wz.cz/CuttingEdit.png 
(the example: score is made with lilypond macro, the textes and lines in
OpenOffice - I know it is not nice now but the goal will be face of the
lines and numbers the same like with the pencil by hand)
I need it so for education.

Thanks,

K.
-- 
View this message in context: 
http://www.nabble.com/Fonts-in-SVG-output-tf3825023.html#a11036038
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.



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


Re: Fonts in SVG output

2007-06-01 Thread John Mandereau
Le jeudi 31 mai 2007 à 13:16 -0400, Benjamin Esham a écrit :
 Krokyn wrote:
 
  and the piano-staff brace showed up as a small box.
 
  I think there is problem with font, not in Inkscape. Preview of svg  
  file is
  with bad fonts in Gnome Nautilus too. It is not possible choose  
  Aubabtu from
  font list in Text Editors (I tried it in OpenOffice in Ubuntu). And  
  I have
  bad note heads shown with other font in Inkscape too and changed  
  the clefs
  :(
 
  Please compare:
  http://krokyn.wz.cz/Hudba/Bach.png
  http://krokyn.wz.cz/Hudba/Bach.svg-Inkscape.png
 
 My output is the same as yours.  What should I do to file this as an  
 official bug?  Wikipedia has some music samples that were made with  
 Sibelius and which are quite ugly.  I'm trying to replace them with  
 SVG, the preferred format, from LilyPond, but obviously the output is  
 useless right now.

Currently, it's not a good idea to include SVG files generated by
LilyPond in web pages on the Internet, because you have to make sure OTF
fonts -- from the LilyPond version used to generate the SVG -- are
installed on the (e.g. in ~/.fonts).  SVG files generated by LilyPond
are rather to be processed on a server or a machine building a web site,
where SVGs are cnoverted to PNGs -- that's what we do on lilypond.org
for language-dependent pictures, see
http://lilypond.org/web/switch/howto for example.

Cheers
-- 
John Mandereau [EMAIL PROTECTED]



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


Re: Fonts in SVG output

2007-06-01 Thread Benjamin Esham

John Mandereau wrote:


Currently, it's not a good idea to include SVG files generated by
LilyPond in web pages on the Internet, because you have to make  
sure OTF

fonts -- from the LilyPond version used to generate the SVG -- are
installed on the (e.g. in ~/.fonts).  SVG files generated by LilyPond
are rather to be processed on a server or a machine building a web  
site,

where SVGs are cnoverted to PNGs -- that's what we do on lilypond.org
for language-dependent pictures, see
http://lilypond.org/web/switch/howto for example.


I use Inkscape's convert text to paths feature to ensure that the  
end-user need not have the LilyPond fonts installed.  (That will work  
like I think it does, right?)


Cheers,
--
Benjamin D. Esham
[EMAIL PROTECTED]  |  AIM: bdesham128  |  Jabber: same as e-mail





PGP.sig
Description: This is a digitally signed message part
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Fonts in SVG output

2007-06-01 Thread Vincent
 Please compare:
 http://krokyn.wz.cz/Hudba/Bach.png
 http://krokyn.wz.cz/Hudba/Bach.svg-Inkscape.png

 My output is the same as yours. What should I do to 
 file this as an official bug? 

Make sure the fonts you have in ~/.fonts are exactly the same 
employed by the lilypond version you are using to the generate 
the svg file.

I've had the same problem before and I've found that the fonts
vary quite often from one version to the next (at least in the 
development brach). I replace the fonts each time I upgrade the
lilypond version and then I recreate the svg file again. This
works for me (except the aybabtu font).

For the time signature and bar numbers, lilypond seems to 
insist in using the feta font when it renders the svg file, 
but (I guess) it should use Emmentaler. Because the feta 
font doesn't exist for Inkscape, it uses the default font.

Greetings,

Vincent



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


Re: Fonts in SVG output

2007-05-31 Thread Krokyn

 and the piano-staff brace showed up as a small box. 


Hello.

I think there is problem with font, not in Inkscape. Preview of svg file is
with bad fonts in Gnome Nautilus too. It is not possible choose Aubabtu from
font list in Text Editors (I tried it in OpenOffice in Ubuntu). And I have
bad note heads shown with other font in Inkscape too and changed the clefs
:(

Please compare:
http://krokyn.wz.cz/Hudba/Bach.png
http://krokyn.wz.cz/Hudba/Bach.svg-Inkscape.png

K.


-- 
View this message in context: 
http://www.nabble.com/Fonts-in-SVG-output-tf3825023.html#a10895892
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.



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


Re: Fonts in SVG output

2007-05-31 Thread Benjamin Esham

Krokyn wrote:


and the piano-staff brace showed up as a small box.


I think there is problem with font, not in Inkscape. Preview of svg  
file is
with bad fonts in Gnome Nautilus too. It is not possible choose  
Aubabtu from
font list in Text Editors (I tried it in OpenOffice in Ubuntu). And  
I have
bad note heads shown with other font in Inkscape too and changed  
the clefs

:(

Please compare:
http://krokyn.wz.cz/Hudba/Bach.png
http://krokyn.wz.cz/Hudba/Bach.svg-Inkscape.png


My output is the same as yours.  What should I do to file this as an  
official bug?  Wikipedia has some music samples that were made with  
Sibelius and which are quite ugly.  I'm trying to replace them with  
SVG, the preferred format, from LilyPond, but obviously the output is  
useless right now.


Thanks,
--
Benjamin D. Esham
[EMAIL PROTECTED]  |  AIM: bdesham128  |  Jabber: same as e-mail
Esperanto, the international language  ☆  http://www.lernu.net




PGP.sig
Description: This is a digitally signed message part
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user


Re: Fonts in SVG output

2007-05-28 Thread Vincent
 I'm having some issues with Lilypond 2.10.x's SVG export. 
[snip]
 but the time signature was in a wrong font, 

Look for the text *feta* inside the svg file and manually replace all the
references to the feta font by Emmentaler (e.g where it says feta-alphabet20,
write Emmentaler).

 and the piano-staff brace showed up as a small box. 

I never managed to solve this problem, which I think is around from version 2.6
or earlier. The Aybabtu font simply doesn't show in inkscape and I really don't
know why. I'm usung windows but it appens in linux as it seeems.

those two problems persist in version 2.11.19 (which I use ATM).

Greetings,

Vincent



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


Fonts in SVG output

2007-05-27 Thread Benjamin Esham

Hello all,

I'm having some issues with Lilypond 2.10.x's SVG export.   I tried  
to open an exported file in Inkscape 0.44.1, and most of the music  
showed up fine, but the time signature was in a wrong font, and the  
piano-staff brace showed up as a small box.  I've already copied the  
fonts from .../share/lilypond/fonts/otf into ~/.fonts; is there  
anything else I need to do to get exported SVG files to appear  
correctly?


Thanks for any help,
--
Benjamin D. Esham
[EMAIL PROTECTED]  |  AIM: bdesham128  |  Jabber: same as e-mail
“It is the unknown we fear when we look upon death and darkness,
nothing more.” — Albus Dumbledore in HBP




PGP.sig
Description: This is a digitally signed message part
___
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user