[PATCH 2/4] gdi32: Return NTM_DSIG when table is present
Huw Davies
huw at codeweavers.com
Tue Mar 1 04:14:11 CST 2016
On Tue, Mar 01, 2016 at 07:19:02AM +0300, Nikolay Sivov wrote:
> Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
> ---
> dlls/gdi32/freetype.c | 13 ++++++++++---
> dlls/gdi32/tests/font.c | 3 +++
> 2 files changed, 13 insertions(+), 3 deletions(-)
>
> diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
> index 01cb913..57cf695 100644
> --- a/dlls/gdi32/freetype.c
> +++ b/dlls/gdi32/freetype.c
> @@ -1942,7 +1942,6 @@ static inline FT_Fixed get_font_version( FT_Face ft_face )
> static inline DWORD get_ntm_flags( FT_Face ft_face )
> {
> DWORD flags = 0;
> - FT_ULong table_size = 0;
> FT_WinFNT_HeaderRec winfnt_header;
>
> if (ft_face->style_flags & FT_STYLE_FLAG_ITALIC) flags |= NTM_ITALIC;
> @@ -1956,8 +1955,16 @@ static inline DWORD get_ntm_flags( FT_Face ft_face )
>
> if (flags == 0) flags = NTM_REGULAR;
>
> - if (!pFT_Load_Sfnt_Table( ft_face, FT_MAKE_TAG( 'C','F','F',' ' ), 0, NULL, &table_size ))
> - flags |= NTM_PS_OPENTYPE;
> + if (FT_IS_SFNT( ft_face )) {
> + FT_ULong table_size = 0;
> +
> + if (!pFT_Load_Sfnt_Table( ft_face, FT_MAKE_TAG( 'C','F','F',' ' ), 0, NULL, &table_size ))
> + flags |= NTM_PS_OPENTYPE;
> +
> + table_size = 0;
> + if (!pFT_Load_Sfnt_Table( ft_face, FT_MAKE_TAG( 'D','S','I','G' ), 0, NULL, &table_size ))
> + flags |= NTM_DSIG;
> + }
>
> return flags;
> }
> diff --git a/dlls/gdi32/tests/font.c b/dlls/gdi32/tests/font.c
> index d39e701..1059d29 100644
> --- a/dlls/gdi32/tests/font.c
> +++ b/dlls/gdi32/tests/font.c
> @@ -78,6 +78,7 @@ static WORD system_lang_id;
> #define MS_CMAP_TAG MS_MAKE_TAG('c','m','a','p')
> #define MS_NAME_TAG MS_MAKE_TAG('n','a','m','e')
> #define MS_CFF_TAG MS_MAKE_TAG('C','F','F',' ')
> +#define MS_DSIG_TAG MS_MAKE_TAG('D','S','I','G')
>
> static void init(void)
> {
> @@ -3968,6 +3969,8 @@ static void test_text_metrics(const LOGFONTA *lf, const NEWTEXTMETRICA *ntm)
> has_cff = GetFontData(hdc, MS_CFF_TAG, 0, NULL, 0) != GDI_ERROR;
> ok(((ntm->ntmFlags & NTM_PS_OPENTYPE) == NTM_PS_OPENTYPE) == has_cff, "CFF test, got flags 0x%08x, CFF table %d, %s\n",
> ntm->ntmFlags, has_cff, font_name);
> + if (GetFontData(hdc, MS_DSIG_TAG, 0, NULL, 0) != GDI_ERROR)
> + ok(ntm->ntmFlags & NTM_DSIG, "DSIG test, got flags 0x%08x, %s\n", ntm->ntmFlags, font_name);
>
> test_negative_width(hdc, lf);
I get a test failure on OS/X. I suspect it might be something to do
with the Helvetica -> Arial substitution.
font.c:3974: Test failed: DSIG test, got flags 0x00040040, Helvetica
Also, since you'll have to resend it, could you avoid adding more K&R
style braces.
Huw.
More information about the wine-devel
mailing list