[cairo] (Grossly) Misplaced glyph(s) at certain font sizes

Behdad Esfahbod behdad at behdad.org
Sat May 3 09:10:38 PDT 2008


Hi Peter,

Thanks for tracking it down.

On Sat, 2008-05-03 at 16:25 +0100, Peter Clifton wrote:
> 
> We end up in _cairo_surface_show_glyphs, and we try the backend first:
> 
> 
>     if (surface->backend->show_glyphs)
>         status = surface->backend->show_glyphs (surface, op, dev_source,
>                                                 glyphs, num_glyphs,
>                                                 dev_scaled_font);
> 
> Delving into the xlib backend code, we get as far as trying to emit the
> glyphs, but bail because the request is too large (in
> _cairo_xlib_surface_add_glyph):
> 
>     /* XXX XRenderAddGlyph does not handle a glyph surface larger than the
>      * maximum XRequest size.
>      */
>     {
>         /* pessimistic length estimation in case we need to change formats */
>         int len = 4 * glyph_surface->width * glyph_surface->height;
>         int max_request_size = XMaxRequestSize (dpy)  -
>                                sz_xRenderAddGlyphsReq -
>                                sz_xGlyphInfo          -
>                                4;
>         if (len >= max_request_size)
>             return CAIRO_INT_STATUS_UNSUPPORTED;
>     }
> 
> 
> 
> This violates the condition required of the backends in commit
> 5a9642c5746fd677aed35ce620ce90b1029b1a0c, where it states:


Ugh, that's ugly.  Lemme think about it.


-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759



More information about the cairo mailing list