[cairo] assert failures in _cairo_ft_unscaled_font_set_scale

Robert O'Callahan rocallahan at novell.com
Thu Nov 23 15:04:00 PST 2006


On Fri, 2006-11-24 at 10:48 +1300, Robert O'Callahan wrote:
> On Fri, 2006-11-24 at 08:51 +1300, Robert O'Callahan wrote:
> > In _cairo_ft_unscaled_font_set_scale there are a couple of "assert(error
> > == 0)" statements. We're hitting one in SVG testcases that try to render
> > text while the CTM has a huge scale in it. This kills the browser.
> > Shouldn't these asserts be replaced by something that propagates cairo
> > error status?
> 
> Actually, a better solution would be to try falling back to a size that
> freetype can handle and then scaling the resulting glyphs in some crude
> but failsafe way.

The attached patch is less ambitious. It just clamps the maximum size to
1000 in each direction and doesn't bother trying to scale up the
results. A limit of 2000 caused an X error on my system with a simple
testcase, so this seems a reasonable choice for the threshold.

Rob
-------------- next part --------------
A non-text attachment was scrubbed...
Name: patch
Type: text/x-patch
Size: 1048 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/cairo/attachments/20061124/90fdf70a/patch.bin


More information about the cairo mailing list