Wednesday, August 27, 2008

OTF versions of the LilyPond custom fonts

LilyPond uses custom fonts, primarily of the Feta and Emmentaler families. These custom fonts draw noteheads, accidentals, tuplet numbers, time signatures and curly braces. LilyPond also uses New Century Schoolbook for default letting in titles and credits.

LilyPond stores font information here:

/Applications/LilyPond.app/Contents/Resources/share/lilypond/current/fonts

LilyPond does not appear to install these custom fonts in the usual places in the filesystem such that other applications, like Illustrator and InDesign, can find them.

The LilyPond /fonts folder contains three subfolders: /otf, /svg and /type1.

If you use Apple's FontBook application to load the custom LilyPond fonts, those fonts in /otf will load perfectly. But the fonts in /svg and /type1 will not load at all.

The fonts in /svg duplicate the fonts in /otf and so probably aren't necessary under any circumstances to load with FontBook.

The fonts in /type1 are unique and, therefore, probably are necessary. The fonts end in .pfa and FontBook will not recognize them. The solution is to download FontForge and use FontForge to convert these .pfa fonts to .otf fonts. The FontForge UI requires the X11 client, which was available in the Utilities subfolder in my Applications folder without recourse to install discs for the MacBook. Double-click to start the X11 server before double-clicking to start FontForge. Then use FontForge to Open each .pfa by hand, and then Generate each .pfa as an .oft. Generate is apparently FontForge's term for convert or save-as. The process is tedious but works.

The resulting 33 new .otf fonts load correctly under FontBook.

I would publish the zipped file of the complete set of all 46 custom LilyPond fonts as .otf here, but I can't figure out how to get Blogger to let me upload a nonimage, nonvideo file.

Tuesday, August 19, 2008

Importing LilyPond output into Adobe Illustrator

Take the simplest possible test.ly LilyPond file ...

\version "2.11.50"
\new Staff { c'4 }

... and render test.pdf as PDF output. Two different ways of 'moving' test.pdf into LilyPond.

Dragging test.pdf onto the Illustrator icon on the dock causes Illustrator to open test.pdf as a pdf for pdf editing. This isn't a successful way of working. Illustrator complains about missing fonts ...



... and then displays the pdf incorrectly ...



... which is bad.

Placing test.pdf into an existing Illustrator file using File > Place works ...



... which is good.

So it would appear that the way to get LilyPond output into Illustrator is to render a PDF from LilyPond and then place the PDF into Illustrator.

However, this is with Illustrator 11.0.0 from the very first release of Creative Suite a couple of years back. When Eryn places test.pdf in her more modern version of Illustrator, missing font problems result and, for example, dynamics appear in Arial.

So the conclusion appears to be that placing LilyPond PDFs works only under certain versions of illustrator. Which is frustrating.

There is a third way of moving LilyPond output into Illustrator. This third way involves the UNIX utility ps2ps for clean up. The ps2ps utility runs against an existing postscript or pdf file. So it's possible to run ps2ps against test.pdf and generate test-clean.pdf as output. From here again we can either drag or place test-clean.pdf onto or in Illustrator. And here the results differ from those above.

Dragging test-clean.pdf onto the Illustartor icon to edit as PDF does not cause Illustrator to complain about missing fonts but does cause Illustrator to display time signatures and dynamics with a slight degree of jagginess visible at high magnification.



Placing test-clean.pdf into an existing Illustrator file does not work. Illustrator complains the test-clean.pdf is not in a format that can place.




CONCLUSIONS:

1. Placing LilyPond PDF output works perfectly in Illustrator 11.0.0 under OS 10.5.4; placing LilyPond PDF output causing missing font problems under more modern versions of Illustrator under OS 10.4 something.

2. Running ps2ps on LilyPond PDF output enables Illustrator 11.0.0 under OS 10.5.4 and also more modern versions of Illustrator under 10.4 something to open LilyPond PDF output directly from the dock but with high magnification jaggies; on the other hand, running ps2ps on LilyPond PDF output causes both of these versions of Illustrator to be unable to place LilyPond PDF output.


ONE LAST OBSERVATION:

3. LilyPond PDF output that I place perfectly in Illustrator 11.0.0 under OS 10.5.4 does not open correctly under more modern versions of Illustrator under OS 10.4 something. In other words, my LilyPond AI files open incorrectly on Eryn's machine. Interestingly, Eryn's machine finds all fonts correctly but displaces a good many noteheads down to such a degree that they are musically incorrect.



LAST CONCLUSION:

4. Placed files are perfect on my machine but open incorrectly on Eryn's machine. So we're going with the ps2ps method of production on my machine so that the files open correctly on Eryn's machine and, hopefully, at the printers.