[cairo] Re: [cairo-commit] 2 commits - ROADMAP src/cairo-ft-font.c
sunmoon1997
sunmoon1997 at gmail.com
Wed Jun 14 04:15:09 PDT 2006
Thanks for you fix.
On 6/14/06, Carl Worth <cworth at cworth.org> wrote:
>
> > diff-tree 0d2900477cd6edfe6025be06c3f1eda63cbe5230 (from
> b104a79502e2c01c508e40d83613ecfa001a2a4e)
> > Author: Jinghua Luo <sunmoon1997 at gmail.com>
> > Date: Wed Jun 14 15:56:17 2006 +0800
> ...
> > @@ -1896,8 +1897,7 @@ _cairo_ft_scaled_glyph_init
> (void *abs
> > status = _transform_glyph_bitmap
> (&unscaled->current_shape,
> > &surface);
> > } else
> > - status = _render_glyph_bitmap (face, &scaled_font->
> base.options,
> > - &surface);
> > + status = CAIRO_STATUS_NO_MEMORY;
>
> There are a few problems with the above:
>
> 1. There's a style problem with inconsistent usage of braces, (a
> closing brace before the else but no opening brace).
>
> 2. The implementation should never abuse CAIRO_STATUS_NO_MEMORY values
> to indicate arbitrary errors, (yes, there are existing cases of
> this is in the implementation and I consider all of them bugs).
>
> 3. Most importantly, the _render_glyph_bitmap function is already
> written to handle the case where glyph->format is neither
> FT_GLYPH_FORMAT_OUTLINE nor FT_GLYPH_FORMAT_BITMAP. Its comment
> says:
>
> /* According to the FreeType docs, glyphslot->format could be
> * something other than FT_GLYPH_FORMAT_OUTLINE or
> * FT_GLYPH_FORMAT_BITMAP. Calling FT_Render_Glyph gives FreeType
> * the opportunity to convert such to
> * bitmap.
>
> So there's a regression in not calling this in this case.
>
> I just pushed out the following patch to fix the above issues.
>
> -Carl
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freedesktop.org/archives/cairo/attachments/20060614/bd1b9274/attachment.html
More information about the cairo
mailing list