[cairo] font size=0 and cairo_set_font_matrix() issue

Behdad Esfahbod behdad at behdad.org
Fri Feb 4 12:38:26 PST 2011


On 02/04/11 08:29, Kamil Blank wrote:
> Dear All,
> 
> I'd like to use font size = 0 and pass this value into cairo_t.
> cairo_set_font_matrix() description says: "Normally, a simple scale is used
> (see cairo_set_font_size()), but a more complex font matrix can be used to
> shear the font or stretch it unequally along the two axes"
> 
> What is the difference between passing zeroed matrix into
> cairo_set_font_matrix() and call cairo_set_font_size(cairo, 0) ?
> As I understand both of them should work but in the first case cairo status
> becomes invalid (invalid matrix), in the second one everything is ok. 
> 
> What is wrong with passing zeroed matrix here? Is it a bug or natural behavior?

Ugh, this check in _cairo_gstate_set_font_matrix() needs to be removed:

    if (! _cairo_matrix_is_invertible (matrix))
        return _cairo_error (CAIRO_STATUS_INVALID_MATRIX);

This is a leftover from before I made size-0 fonts work...

I'll remove it now.

behdad


> Regards,
> Kamil Blank
> 
> 
> 
> --
> cairo mailing list
> cairo at cairographics.org
> http://lists.cairographics.org/mailman/listinfo/cairo


More information about the cairo mailing list