[cairo] Trying to figure out some rasterization problems

David Kastrup dak at gnu.org
Wed Apr 24 00:55:45 PDT 2013


James Cloos <cloos at jhcloos.com> writes:

>>>>>> "DK" == David Kastrup <dak at gnu.org> writes:
>
> DK> There is quite a bit of variation in stem lengths (they are adjusted
> DK> for collision avoidance, cross stem etc).  Fixed fonts are pretty
> DK> much out, generating fonts on the fly is somewhat easier to suggest
> DK> than implemented.
>
> You can grab the code cairo uses to convert a cairo user font into cff
> (for pdf) and type1 (for ps) fonts.  It should be a very usable basis
> for lilypond to do the same.
>
> It doesn't generate hints, but most renderers these days seem to ignore
> type1/cff hints and autofit anyway.

Seems sort of pointless to go via fonts without using hints if one of
the main aims of the exercise was getting good rasterization.

> Postscript forms might rasterize once and blit to each destination; if
> so that also should ensure constant width stems.

I did not have much success going through user paths (which are supposed
to do caching when asked for), so the quite more complex experiment of
PostScript forms is not necessarily something I am particularly looking
forward to.

> But that heavily depends on how the rasterizer works, of course.
>
> Directly generating pdf when that is desires also is a good idea.
>
> Perhaps the LuaTeX code might provide a good basis for direct pdf
> output.  (To be clear, I don't mean generating TeX, but using
> something based on Taco's code in lilypond.)

Information on LuaTeX licensing is quite sparse (the official web pages
and documentation don't mention it at all), but it would appear to be
GPLv2 only.  Which rules out use in the GPLv3+ LilyPond.

At any rate, I'd doubt that there would be overlap of any significance
beyond using the same libraries.

-- 
David Kastrup


More information about the cairo mailing list