[cairo] PDF type3 font support; Just bugs to fix before cairo 1.2
behdad at cs.toronto.edu
Tue May 16 01:06:00 PDT 2006
On Mon, 15 May 2006, Carl Worth wrote:
> On Mon, 15 May 2006 13:55:22 -0700, Bill Spitzak wrote:
> > Could I get an indication as to whether the idea of making this work for
> > fonts is being considered or has been rejected?
I liked this proposal too. However, it's a bit unclear when
exactly should the font ctm be locked. The alternatives are:
a) during cairo_set_font_face()
b) during cairo_set_font_size/matrix()
while the second choice makes much more sense than the first one,
it still means that it's not as obvious as with the line width.
However, locking the font ctm does bridge one gap we already have
in the current API: that an scaled_font has a ctm which is
ignored during cairo_set_scaled_font(). So this is a move in the
right direction IMHO.
Thinking about what new API we need to support the font ctm,
leads me to this other question: what does cairo_get_line_width
return? a) whatever it was last set with cairo_set_line_width(),
or b) a line width that if set using cairo_set_line_width() with
the current ctm, will not change the output; means, the line
width adjusted to match the current ctm. The same question
arises with font matrix too. What does cairo_get_font_matrix
return? Does it mean that
cairo_set_font_matrix(cairo_get_font_matrix()) may change the
output if ctm has been changed? I don't like that.
> I have been nervous about compatibility. You made one argument (which
> I hadn't previously considered):
> > Compatability is probably not a problem, for the same reason changing
> > the behavior of line width is not a problem: because the current
> > behavior is useless, nobody changes the CTM after setting the font.
> and that seems fairly appealing. For lines, though, we have a stronger
> argument that nobody _uses_ stroked lines ;-) while there are
That's not really true. Most users of cairo use stroked lines I
would say. But the proposed change is probably safe enough to
> definitely users of fonts out there (pango and GTK+). So we will have
> to at least be careful here I think.
Pango HEAD uses cairo_set_scaled_font; older pango versions call
cairo_set_font_matrix/face just before drawing text. So no
"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
-- Dan Bern, "New American Language"
More information about the cairo