[cairo] cairo_scale_font/cairo_transform_font()

Owen Taylor otaylor at redhat.com
Sat Mar 19 10:27:56 PST 2005


On Sat, 2005-03-19 at 19:21 +0100, Øyvind Kolås wrote:
> On Sat, 19 Mar 2005 13:03:20 -0500, Owen Taylor <otaylor at redhat.com> wrote:
> > What if we just had:
> > 
> >  cairo_set_font_size()
> 
> I presume this would be specified in relation to user space as
> dictated by the CTM. This would make:
> 
> cairo_select_font (cr, "Sans",
>    CAIRO_FONT_SLANT_NORMAL,
>    CAIRO_FONT_WEiGHT_NORMAL);  
> cairo_scale_font (cr, 10);
> 
> equal to:
> 
> cairo_set_font_name (cr, "Sans");
> cairo_set_font_size (cr, 10);
> 
> Here assuming that slant and weight will be seperate setters/getters.

The font_name() that I referenced is a "FontName" as defined in my "Font
analysis" mail ... so for the simple case, all three of
family/slant/weight.

The font matrix continues to be defined as currently. I just want to
change:

 cairo_select_font (cr, "Sans",
                    CAIRO_FONT_SLANT_NORMAL,
                    CAIRO_FONT_WEIGHT_NORMAL);    
 cairo_scale_font (cr, 10); /* 10 pt font */
 cairo_scale_font (cr, 12); /* 120 pt font */

To:

 cairo_select_font (cr, "Sans",
                    CAIRO_FONT_SLANT_NORMAL,
                    CAIRO_FONT_WEIGHT_NORMAL);    
 cairo_set_font_size (cr, 10); /* 10 pt font */
 cairo_set_font_size (cr, 12); /* 12 pt font */

> Would the value returned by cairo_get_font_size change when the CTM changes?

I don't know if a getter for font_size() makes sense ... what is the
result for set_font_transform() followed by get_font_size()? I guess we
could return some value from _cairo_matrix_compute_scale_factors().

But if there was a getter, it would not change with the CTM. The CTM and
font matrix are entirely independent entities.

Regards,
						Owen

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : http://lists.freedesktop.org/archives/cairo/attachments/20050319/34c6daf9/attachment.pgp


More information about the cairo mailing list