[cairo] Improving PDF output
Bill Spitzak
spitzak at d2.com
Mon Jan 8 12:03:40 PST 2007
I suspect the application will be well aware that they are using the
metrics for the glyphs unchanged.
What I would like to see is a api which is "here is a big list of
glyphs, please draw them all starting at x,y and use the escapements for
each glyph to get the next one". I'm pretty certain Pango/whatever is in
a better position to detect when and if it can use this api, rather than
having the backend check every displacement to see if it happens to be
the metric escapement, which sounds very wasteful, especially because it
is complex enough that you don't think the backends can do it directly
but must be provided with helper code.
While you are at it there should also be the exact same function except
the list of glyphs is a UTF-8 encoded string and byte count. Yes I know
this is the "toy" api. Lets make it not be a "toy". I think it is pretty
clear that it is the api everybody wants! Pango and other layout
programs should be able to cleanly and easily use this as well as the
per-glyph api. I know the problem is that glyphs are not unicode
characters, but I feel that should be fixed by the cairo api, by
defining glyph ids as being equal to the unicode code they match, or
using the application-defined block of unicode if there is no
correspondence. Glyph id's are incredibly confusing and completely
contrary to the idea that Cairo's api should be "fun" and "easy".
Carl Worth wrote:
> On Mon, 8 Jan 2007 15:12:05 +0000, Baz wrote:
>> It does seem wrong though, to disassemble the string and rebuild it in
>> the back-end like that.
>
> But again, this is just the toy API, so it's not at all interesting to
> architect the implementation around it.
>
> The fact is, real applications, (mozilla, anything using GTK+/pango),
> will have decomposes any text into glyphs in the application and
> called into cairo_show_glyphs. So we have to have code for recombining
> things regardless.
>
> Of course, we should share that code across as many backends as
> possible, (which I think means writing helper functions for the
> backends to call rather than making new entry points in the backend
> interface---but I haven't actually been very close to this part of the
> implementation lately so I might be a little off).
>
> -Carl
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> cairo mailing list
> cairo at cairographics.org
> http://cairographics.org/cgi-bin/mailman/listinfo/cairo
More information about the cairo
mailing list