Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Font symbols on Windows #59

Merged
merged 1 commit into from Jun 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
40 changes: 20 additions & 20 deletions src/font.c
Expand Up @@ -65,7 +65,7 @@ gdip_createFontFamily (GpFontFamily **family)
static GpFontCollection *system_fonts = NULL;

// coverity[+alloc : arg-*0]
GpStatus
GpStatus WINGDIPAPI
GdipNewInstalledFontCollection (GpFontCollection **font_collection)
{
if (!font_collection)
Expand Down Expand Up @@ -104,7 +104,7 @@ GdipNewInstalledFontCollection (GpFontCollection **font_collection)
}

// coverity[+alloc : arg-*0]
GpStatus
GpStatus WINGDIPAPI
GdipNewPrivateFontCollection (GpFontCollection **font_collection)
{
GpFontCollection *result;
Expand Down Expand Up @@ -143,7 +143,7 @@ GdipDeletePrivateFontCollection (GpFontCollection **font_collection)
return Ok;
}

GpStatus
GpStatus WINGDIPAPI
GdipPrivateAddFontFile (GpFontCollection *font_collection, GDIPCONST WCHAR *filename)
{
BYTE *file;
Expand All @@ -161,7 +161,7 @@ GdipPrivateAddFontFile (GpFontCollection *font_collection, GDIPCONST WCHAR *fil
return Ok;
}

GpStatus
GpStatus WINGDIPAPI
GdipCloneFontFamily (GpFontFamily *fontFamily, GpFontFamily **clonedFontFamily)
{
GpFontFamily *result;
Expand All @@ -187,8 +187,8 @@ GdipCloneFontFamily (GpFontFamily *fontFamily, GpFontFamily **clonedFontFamily)
return Ok;
}

GpStatus
WINGDIPAPI GdipDeleteFontFamily (GpFontFamily *fontFamily)
GpStatus WINGDIPAPI
GdipDeleteFontFamily (GpFontFamily *fontFamily)
{
BOOL delete = TRUE;

Expand Down Expand Up @@ -251,7 +251,7 @@ gdip_createPrivateFontSet (GpFontCollection *font_collection)
}

GpStatus WINGDIPAPI
GdipGetFontCollectionFamilyCount (GpFontCollection *font_collection, int *numFound)
GdipGetFontCollectionFamilyCount (GpFontCollection *font_collection, INT *numFound)
{
if (!font_collection || !numFound)
return InvalidParameter;
Expand All @@ -268,7 +268,7 @@ GdipGetFontCollectionFamilyCount (GpFontCollection *font_collection, int *numFou
}

GpStatus WINGDIPAPI
GdipGetFontCollectionFamilyList (GpFontCollection *font_collection, int num_sought, GpFontFamily *gpfamilies[], int *num_found)
GdipGetFontCollectionFamilyList (GpFontCollection *font_collection, INT num_sought, GpFontFamily *gpfamilies[], INT *num_found)
{
int i;

Expand Down Expand Up @@ -460,7 +460,7 @@ GdipCreateFontFamilyFromName (GDIPCONST WCHAR *name, GpFontCollection *font_coll
}

GpStatus WINGDIPAPI
GdipGetFamilyName (GDIPCONST GpFontFamily *family, WCHAR name[LF_FACESIZE], int language)
GdipGetFamilyName (GDIPCONST GpFontFamily *family, WCHAR name[LF_FACESIZE], LANGID language)
{
GpStatus status;
FcChar8 *fc_str;
Expand Down Expand Up @@ -847,7 +847,7 @@ GdipCreateFont (GDIPCONST GpFontFamily* family, float emSize, int style, Unit un
return Ok;
}

GpStatus
GpStatus WINGDIPAPI
GdipDeleteFont (GpFont* font)
{
if (!font)
Expand All @@ -871,7 +871,7 @@ GdipDeleteFont (GpFont* font)
return Ok;
}

GpStatus
GpStatus WINGDIPAPI
GdipCreateFontFromDC(void *hdc, GpFont **font)
{
return(NotImplemented);
Expand Down Expand Up @@ -959,8 +959,8 @@ gdip_logfont_from_font (GpFont *font, GpGraphics *graphics, void *lf, BOOL ucs2)
}

// coverity[+alloc : arg-*1]
GpStatus
GdipCreateFontFromHfontA(void *hfont, GpFont **font, void *lf)
GpStatus WINGDIPAPI
GdipCreateFontFromHfontA(HFONT hfont, GpFont **font, void *lf)
{
GpFont *src_font;
GpFont *result;
Expand Down Expand Up @@ -991,13 +991,13 @@ GdipCreateFontFromHfontA(void *hfont, GpFont **font, void *lf)
return gdip_logfont_from_font (result, NULL, lf, FALSE);
}

GpStatus
GpStatus WINGDIPAPI
GdipGetLogFontW (GpFont *font, GpGraphics *graphics, LOGFONTW *logfontW)
{
return gdip_logfont_from_font (font, graphics, logfontW, TRUE);
}

GpStatus
GpStatus WINGDIPAPI
GdipGetLogFontA (GpFont *font, GpGraphics *graphics, LOGFONTA *logfontA)
{
return gdip_logfont_from_font (font, graphics, logfontA, FALSE);
Expand Down Expand Up @@ -1068,8 +1068,8 @@ GdipCreateFontFromLogfontW(void *hdc, GDIPCONST LOGFONTW *logfont, GpFont **font
return gdip_create_font_from_logfont(hdc, (void *)logfont, font, TRUE);
}

GpStatus
GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void *memory, int length)
GpStatus WINGDIPAPI
GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void *memory, INT length)
{
FcBool result;
FcChar8 fontfile[256];
Expand Down Expand Up @@ -1106,7 +1106,7 @@ GdipPrivateAddMemoryFont(GpFontCollection *fontCollection, GDIPCONST void *memor
return result ? Ok : FileNotFound;
}

GpStatus
GpStatus WINGDIPAPI
GdipGetFontHeight (GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, float *height)
{
GpStatus status;
Expand All @@ -1132,7 +1132,7 @@ GdipGetFontHeight (GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, float
return Ok;
}

GpStatus
GpStatus WINGDIPAPI
GdipGetFontHeightGivenDPI (GDIPCONST GpFont *font, float dpi, float *height)
{
GpStatus status;
Expand All @@ -1155,7 +1155,7 @@ GdipGetFontHeightGivenDPI (GDIPCONST GpFont *font, float dpi, float *height)
return Ok;
}

GpStatus
GpStatus WINGDIPAPI
GdipGetFontSize (GpFont *font, float *size)
{
if (!font ||!size)
Expand Down
18 changes: 9 additions & 9 deletions src/font.h
Expand Up @@ -33,14 +33,14 @@

/* Font public API (only!) */

GpStatus GdipCreateFont (GDIPCONST GpFontFamily* family, float emSize, int style, Unit unit, GpFont **font);
GpStatus GdipCreateFontFromDC (void *hdc, GpFont **font);
GpStatus GdipDeleteFont (GpFont* font);
GpStatus GdipGetLogFontA (GpFont *font, GpGraphics *graphics, LOGFONTA *logfontA);
GpStatus GdipGetLogFontW (GpFont *font, GpGraphics *graphics, LOGFONTW *logfontW);
GpStatus GdipGetFontHeight (GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, float *height);
GpStatus GdipGetFontHeightGivenDPI (GDIPCONST GpFont *font, float dpi, float *height);
GpStatus GdipGetFontSize (GpFont *font, float *size);
GpStatus WINGDIPAPI GdipCreateFont (GDIPCONST GpFontFamily* family, float emSize, int style, Unit unit, GpFont **font);
GpStatus WINGDIPAPI GdipCreateFontFromDC (void *hdc, GpFont **font);
GpStatus WINGDIPAPI GdipDeleteFont (GpFont* font);
GpStatus WINGDIPAPI GdipGetLogFontA (GpFont *font, GpGraphics *graphics, LOGFONTA *logfontA);
GpStatus WINGDIPAPI GdipGetLogFontW (GpFont *font, GpGraphics *graphics, LOGFONTW *logfontW);
GpStatus WINGDIPAPI GdipGetFontHeight (GDIPCONST GpFont *font, GDIPCONST GpGraphics *graphics, float *height);
GpStatus WINGDIPAPI GdipGetFontHeightGivenDPI (GDIPCONST GpFont *font, float dpi, float *height);
GpStatus WINGDIPAPI GdipGetFontSize (GpFont *font, float *size);

/* missing API
GdipCreateFontFromLogfontA
Expand All @@ -52,6 +52,6 @@ GpStatus GdipGetFontSize (GpFont *font, float *size);
*/

/* libgdiplus extra API (not availble in MSGDI+ but exported from libgdiplus) */
GpStatus GdipCreateFontFromHfontA (HFONT hfont, GpFont **font, void *lf);
GpStatus WINGDIPAPI GdipCreateFontFromHfontA (HFONT hfont, GpFont **font, void *lf);

#endif