[cairo] PDF type3 font support; Just bugs to fix before cairo 1.2

Carl Worth cworth at cworth.org
Tue May 16 01:41:19 PDT 2006


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.

> 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 good question.

The easy answer I have here is that this is a value that crosses the
user-level API so it must necessarily be in the current user
space. Let's see how that plays out:

> 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.

So I'm choosing (b) here, motivated by the all-values-in-user-space
convention. As you point out it also satisfies the idempotence of:

	cairo_set_line_width (cr, cairo_get_line_width (cr));

>  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. (Of course, you don't
actually get to next the calls as you have above since we use pointers
for cairo_matrix_t objects rather than passing them around
directly---so sad.)

> 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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20060516/fb9f6b4d/attachment.pgp


More information about the cairo mailing list