From ce4b414845234eb78c507c0b0c0dc441436388f2 Mon Sep 17 00:00:00 2001 From: Adam Petaccia Date: Sat, 21 Jun 2008 13:02:49 -0400 Subject: [PATCH] gdiplus: Implement GdipGetFamilyName. --- dlls/gdiplus/font.c | 33 +++++++++++++++++++++++++++++++++ dlls/gdiplus/gdiplus.spec | 2 +- include/gdiplusflat.h | 1 + 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/dlls/gdiplus/font.c b/dlls/gdiplus/font.c index ec591c160c1..f38261da685 100644 --- a/dlls/gdiplus/font.c +++ b/dlls/gdiplus/font.c @@ -219,6 +219,39 @@ GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR *name, return Ok; } +/******************************************************************************* + * GdipGetFamilyName [GDIPLUS.@] + * + * Returns the family name into name + * + * PARAMS + * *family [I] Family to retrieve from + * *name [O] WCHARS of the family name + * LANGID [I] charset + * + * RETURNS + * SUCCESS: Ok + * FAILURE: InvalidParameter if family is NULL + * + * NOTES + * If name is a NULL ptr, then both XP and Vista will crash (so we do as well) + */ +GpStatus WINGDIPAPI GdipGetFamilyName (GDIPCONST GpFontFamily *family, + WCHAR *name, LANGID language) +{ + if (family == NULL) + return InvalidParameter; + + TRACE("%p, %p, %d\n", family, name, language); + + if (language != LANG_NEUTRAL) + FIXME("No support for handling of multiple languages!\n"); + + lstrcpynW (name, family->FamilyName, LF_FACESIZE); + + return Ok; +} + /***************************************************************************** * GdipDeleteFontFamily [GDIPLUS.@] diff --git a/dlls/gdiplus/gdiplus.spec b/dlls/gdiplus/gdiplus.spec index b88298e01d0..0b093a431cc 100644 --- a/dlls/gdiplus/gdiplus.spec +++ b/dlls/gdiplus/gdiplus.spec @@ -264,7 +264,7 @@ @ stub GdipGetEncoderParameterList @ stub GdipGetEncoderParameterListSize @ stub GdipGetFamily -@ stub GdipGetFamilyName +@ stdcall GdipGetFamilyName(ptr ptr long) @ stub GdipGetFontCollectionFamilyCount @ stub GdipGetFontCollectionFamilyList @ stub GdipGetFontHeight diff --git a/include/gdiplusflat.h b/include/gdiplusflat.h index cb6ca0170d0..fb4fbfc8567 100644 --- a/include/gdiplusflat.h +++ b/include/gdiplusflat.h @@ -351,6 +351,7 @@ GpStatus WINGDIPAPI GdipCloneFont(GpFont*,GpFont**); GpStatus WINGDIPAPI GdipCreateFontFamilyFromName(GDIPCONST WCHAR*, GpFontCollection*, GpFontFamily**); GpStatus WINGDIPAPI GdipDeleteFontFamily(GpFontFamily*); +GpStatus WINGDIPAPI GdipGetFamilyName(GDIPCONST GpFontFamily*, WCHAR*, LANGID); GpStatus WINGDIPAPI GdipCreateStringFormat(INT,LANGID,GpStringFormat**); GpStatus WINGDIPAPI GdipDeleteStringFormat(GpStringFormat*);