Commit 2bd5f6e0 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

gdi32: Remove runtime check for FT_Set_Charmap().

parent fae0570a
......@@ -159,7 +159,6 @@ MAKE_FUNCPTR(FT_Outline_Get_CBox);
MAKE_FUNCPTR(FT_Outline_Transform);
MAKE_FUNCPTR(FT_Outline_Translate);
MAKE_FUNCPTR(FT_Render_Glyph);
MAKE_FUNCPTR(FT_Select_Charmap);
MAKE_FUNCPTR(FT_Set_Charmap);
MAKE_FUNCPTR(FT_Set_Pixel_Sizes);
MAKE_FUNCPTR(FT_Vector_Length);
......@@ -4139,7 +4138,6 @@ static BOOL init_freetype(void)
LOAD_FUNCPTR(FT_Outline_Transform)
LOAD_FUNCPTR(FT_Outline_Translate)
LOAD_FUNCPTR(FT_Render_Glyph)
LOAD_FUNCPTR(FT_Select_Charmap)
LOAD_FUNCPTR(FT_Set_Charmap)
LOAD_FUNCPTR(FT_Set_Pixel_Sizes)
LOAD_FUNCPTR(FT_Vector_Length)
......@@ -5059,56 +5057,51 @@ static BOOL create_child_font_list(GdiFont *font)
static BOOL select_charmap(FT_Face ft_face, FT_Encoding encoding)
{
FT_Error ft_err = FT_Err_Invalid_CharMap_Handle;
FT_CharMap cmap0, cmap1, cmap2, cmap3, cmap_def;
FT_Int i;
if (pFT_Set_Charmap)
{
FT_Int i;
FT_CharMap cmap0, cmap1, cmap2, cmap3, cmap_def;
cmap0 = cmap1 = cmap2 = cmap3 = cmap_def = NULL;
cmap0 = cmap1 = cmap2 = cmap3 = cmap_def = NULL;
for (i = 0; i < ft_face->num_charmaps; i++)
for (i = 0; i < ft_face->num_charmaps; i++)
{
if (ft_face->charmaps[i]->encoding == encoding)
{
if (ft_face->charmaps[i]->encoding == encoding)
{
TRACE("found cmap with platform_id %u, encoding_id %u\n",
ft_face->charmaps[i]->platform_id, ft_face->charmaps[i]->encoding_id);
TRACE("found cmap with platform_id %u, encoding_id %u\n",
ft_face->charmaps[i]->platform_id, ft_face->charmaps[i]->encoding_id);
switch (ft_face->charmaps[i]->platform_id)
{
default:
cmap_def = ft_face->charmaps[i];
break;
case 0: /* Apple Unicode */
cmap0 = ft_face->charmaps[i];
break;
case 1: /* Macintosh */
cmap1 = ft_face->charmaps[i];
break;
case 2: /* ISO */
cmap2 = ft_face->charmaps[i];
break;
case 3: /* Microsoft */
cmap3 = ft_face->charmaps[i];
break;
}
switch (ft_face->charmaps[i]->platform_id)
{
default:
cmap_def = ft_face->charmaps[i];
break;
case 0: /* Apple Unicode */
cmap0 = ft_face->charmaps[i];
break;
case 1: /* Macintosh */
cmap1 = ft_face->charmaps[i];
break;
case 2: /* ISO */
cmap2 = ft_face->charmaps[i];
break;
case 3: /* Microsoft */
cmap3 = ft_face->charmaps[i];
break;
}
if (cmap3) /* prefer Microsoft cmap table */
ft_err = pFT_Set_Charmap(ft_face, cmap3);
else if (cmap1)
ft_err = pFT_Set_Charmap(ft_face, cmap1);
else if (cmap2)
ft_err = pFT_Set_Charmap(ft_face, cmap2);
else if (cmap0)
ft_err = pFT_Set_Charmap(ft_face, cmap0);
else if (cmap_def)
ft_err = pFT_Set_Charmap(ft_face, cmap_def);
}
return ft_err == FT_Err_Ok;
if (cmap3) /* prefer Microsoft cmap table */
ft_err = pFT_Set_Charmap(ft_face, cmap3);
else if (cmap1)
ft_err = pFT_Set_Charmap(ft_face, cmap1);
else if (cmap2)
ft_err = pFT_Set_Charmap(ft_face, cmap2);
else if (cmap0)
ft_err = pFT_Set_Charmap(ft_face, cmap0);
else if (cmap_def)
ft_err = pFT_Set_Charmap(ft_face, cmap_def);
}
return pFT_Select_Charmap(ft_face, encoding) == FT_Err_Ok;
return ft_err == FT_Err_Ok;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment