[=PATCH v5 1/2] gdi32: In AddFaceToList allow fonts with long names and add tests

Huw Davies huw at codeweavers.com
Mon Nov 20 02:51:45 CST 2017


On Sun, Nov 19, 2017 at 08:44:25PM +0100, Fabian Maurer wrote:
> v4
> remove global variable
> don't check if functions are available
> fix RemoveFontResourceExA test
> properly release dc
> add another test for completeness sake
> 
> Signed-off-by: Fabian Maurer <dark.shadow4 at web.de>
> ---
>  dlls/gdi32/freetype.c              |   9 ++---
>  dlls/gdi32/tests/font.c            |  54 ++++++++++++++++++++++++++++++
>  dlls/gdi32/tests/resource.rc       |   3 ++
>  dlls/gdi32/tests/wine_longname.sfd |  66 +++++++++++++++++++++++++++++++++++++
>  dlls/gdi32/tests/wine_longname.ttf | Bin 0 -> 2252 bytes
>  5 files changed, 128 insertions(+), 4 deletions(-)
>  create mode 100644 dlls/gdi32/tests/wine_longname.sfd
>  create mode 100644 dlls/gdi32/tests/wine_longname.ttf
> 
> diff --git a/dlls/gdi32/freetype.c b/dlls/gdi32/freetype.c
> index 346e21dc21..8be1bfe22e 100644
> --- a/dlls/gdi32/freetype.c
> +++ b/dlls/gdi32/freetype.c
> @@ -1571,6 +1571,9 @@ static BOOL insert_face_in_family_list( Face *face, Family *family )
>      face->family = family;
>      family->refcount++;
>      face->refcount++;
> +    /* GDI32 can't deal with long names, truncate them */
> +    if (face->FullName && lstrlenW(face->FullName) > LF_FACESIZE - 1)
> +        face->FullName[LF_FACESIZE - 1] = 0;

Shouldn't this be LF_FULLFACESIZE ?

Huw.



More information about the wine-devel mailing list