[PATCH v2 5/7] gdi32: Add helper functions to get GGO glyph from FreeType glyph.

Huw Davies huw at codeweavers.com
Wed Feb 6 04:07:56 CST 2019


On Wed, Jan 30, 2019 at 02:12:39AM +0900, Byeongsik Jeon wrote:
> Signed-off-by: Byeongsik Jeon <bsjeon at hanmail.net>
> ---
>  dlls/gdi32/freetype.c | 698 +++++++++++++++++++++---------------------
>  1 file changed, 351 insertions(+), 347 deletions(-)
> 
> diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
> index e5e3af2fe4..8e4d8e33ad 100644
> --- a/dlls/gdi32/freetype.c
> +++ b/dlls/gdi32/freetype.c
> @@ -7347,352 +7680,23 @@ static DWORD get_glyph_outline(GdiFont *incoming_font, UINT glyph, UINT format,
>          return 1; /* FIXME */
>      }
>  
> -    if(ft_face->glyph->format != ft_glyph_format_outline &&
> -       (format == GGO_NATIVE || format == GGO_BEZIER))
> +    switch (ft_face->glyph->format)
>      {
> -        TRACE("loaded a bitmap\n");
> -	return GDI_ERROR;
> -    }
> -
> -    switch(format) {


I'm not sure inverting the switch order between requested format and
loaded format makes it any better, though adding the helpers is good.

I'd suggest keeping the original switch but adding

get_mono_glyph_bitmap() for GGO_BITMAP
get_antialias_glyph_bitmap() for GGO_GRAY*_BITMAP
get_subpixel_glyph_bitmap() for the subpixel formats.

Also, please align the cases with the switch.

> -    case GGO_BITMAP:
> -	pitch = ((width + 31) >> 5) << 2;
> -        needed = pitch * height;
> -
> -	if(!buf || !buflen) break;
> -        if (!needed) return GDI_ERROR;  /* empty glyph */
> -        if (needed > buflen)
> -            return GDI_ERROR;
> -
> -	switch(ft_face->glyph->format) {
> -	case ft_glyph_format_bitmap:




More information about the wine-devel mailing list