[cairo] PDF type3 font support; Just bugs to fix before cairo 1.2
Behdad Esfahbod
behdad at cs.toronto.edu
Tue May 16 02:02:38 PDT 2006
On Tue, 16 May 2006, Carl Worth wrote:
> On Tue, 16 May 2006 04:06:00 -0400 (EDT), Behdad Esfahbod 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()
>
> That doesn't look ambiguous to me at all. I can' imagine why setting
> the font face would lock the matrix.
True. My bad..
> > 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?
>
> And you win here, too. The font matrix maps from font space to user
> space, so if there's a CTM change between set_font_matrix and
> get_font_matrix then the values returned will be modified from those
> originally set. In other words, getting the font matrix and setting it
> back again should also not change any output.
Ok, that simplifies the implementation then. We just need to
keep the font space matrix and divide by the current CTM in
cairo_get_font_matrix(). Oh, and so the same reasoning means
that cairo_text/glyph_extents() will return values in user space,
so one doesn't really need to know what the CTM at the time of
setting font matrix was. No new API needed. Or do you see any
other uses Bill?
> > Pango HEAD uses cairo_set_scaled_font; older pango versions call
> > cairo_set_font_matrix/face just before drawing text. So no
> > worries there.
>
> Well, that's encouraging too.
>
> I think you might be winning this one, Bill.
>
> All we need now is a nice, failing test case, (perhaps
> font-matrix-scale which could mimic my line-width-scale), with a
> reference image, and then we can easily code to that.
>
> -Carl
--behdad
http://behdad.org/
"Commandment Three says Do Not Kill, Amendment Two says Blood Will Spill"
-- Dan Bern, "New American Language"
More information about the cairo
mailing list