[cairo] Re: [PATCH]reworked _transform_glyph_bitmap
Jinghua Luo
sunmoon1997 at gmail.com
Mon Jun 12 17:17:55 PDT 2006
Carl Worth wrote:
> On Sun, 11 Jun 2006 13:33:32 +0800, Jinghua Luo wrote:
>> I'm going to commit the attached two updated patches if there're no
>> objections.
>
>> From: Jinghua Luo <sunmoon1997 at gmail.com>
>> Date: Sun Jun 11 13:16:00 2006 +0800
>> Subject: [PATCH] freetype: rework _transform_glyph_bitmap.
>>
>> This function is used to shape bitmap glyphs(outline glyphs are
>> transformed by freetype). That means freetype backend is able to
>> tranform both bitmap & outline glyphs now. This is needed for glyph
>> rotating.
>
> This one looks pretty good to me. Thanks for fixing up and re-enabling
> this old code. And thanks for pushing it out.
>
> I do have one quick question though:
>
>> @@ -1897,7 +1899,13 @@ #endif
>> if (glyph->format == FT_GLYPH_FORMAT_OUTLINE)
>> status = _render_glyph_outline (face, &scaled_font->base.options,
>> &surface);
>> - else
>> + else if (glyph->format == FT_GLYPH_FORMAT_BITMAP) {
>> + status = _render_glyph_bitmap (face, &scaled_font->base.options,
>> + &surface);
>> + if (status == CAIRO_STATUS_SUCCESS && unscaled->have_shape)
>> + status = _transform_glyph_bitmap (&unscaled->current_shape,
>> + &surface);
>> + } else
>> status = _render_glyph_bitmap (face, &scaled_font->base.options,
>> &surface);
>
> At the risk of exposing my ignorance of freetype interfaces: What
> other values for glyph->format are possible other than OUTLINE and
> BITMAP? Is there are case where the final else clause is expected to
> be executed?
>
> If not, let's drop that. If so, are we even doing the right thing
> there?
Currently, the possible values are OUTLINE and BITMAP. I just don't know
whether is it possible in the future.OK, let's drop the final else clause.
>
>> From: Jinghua Luo <sunmoon1997 at gmail.com>
>> Date: Sun Jun 11 13:31:34 2006 +0800
>> Subject: [PATCH] freetype: ignore FC_MATRIX in fontconfig pattern.
>>
>> With previous commit, freetype font backend is able to transform
>> both bitmap and outline glyphs, so ignores FC_MATRIX from now,
>> cairo doesn't need this for artificial oblique. And cairo doesn't use
>> FC_MATRIX direct anyway, it has its own font matrix that may be not
>> equal to FC_MATRIX in the font pattern!
>
> And this one looks great.
>
> Again, thanks!
>
> -Carl
>
>
Thanks for your comments.
More information about the cairo
mailing list