From f2e3ac85c60bc8f407077057a9b61abf5b0f26b7 Mon Sep 17 00:00:00 2001 From: extratype Date: Wed, 6 Jan 2021 22:13:10 +0900 Subject: [PATCH 1/2] Add /utf-8 build option to handle warning C4819 --- gdipp.vcxproj | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/gdipp.vcxproj b/gdipp.vcxproj index bf8b26e..83aee03 100644 --- a/gdipp.vcxproj +++ b/gdipp.vcxproj @@ -288,6 +288,7 @@ Level3 EditAndContinue + /utf-8 %(AdditionalOptions) freetype.lib;usp10.lib;%(AdditionalDependencies) @@ -315,6 +316,7 @@ Level3 EditAndContinue + /utf-8 %(AdditionalOptions) freetype_inf.lib;usp10.lib;%(AdditionalDependencies) @@ -344,6 +346,7 @@ Level3 ProgramDatabase + /utf-8 %(AdditionalOptions) freetype64.lib;usp10.lib;%(AdditionalDependencies) @@ -374,6 +377,7 @@ Level3 ProgramDatabase + /utf-8 %(AdditionalOptions) freetype64.lib;usp10.lib;%(AdditionalDependencies) @@ -402,6 +406,7 @@ Level3 ProgramDatabase + /utf-8 %(AdditionalOptions) freetype64.lib;usp10.lib;%(AdditionalDependencies) @@ -429,6 +434,7 @@ Level3 ProgramDatabase + /utf-8 %(AdditionalOptions) freetype64.lib;usp10.lib;%(AdditionalDependencies) @@ -458,7 +464,7 @@ Level3 ProgramDatabase $(SolutionDir)deps\include;%(AdditionalIncludeDirectories) - /Zc:threadSafeInit- %(AdditionalOptions) + /Zc:threadSafeInit- /utf-8 %(AdditionalOptions) freetype.lib;usp10.lib;dwrite.lib;%(AdditionalDependencies) @@ -492,6 +498,7 @@ Level3 ProgramDatabase + /utf-8 %(AdditionalOptions) freetype_inf.lib;usp10.lib;dwrite.lib;%(AdditionalDependencies) @@ -525,6 +532,7 @@ Level3 ProgramDatabase $(SolutionDir)deps\include;%(AdditionalIncludeDirectories) + /utf-8 %(AdditionalOptions) freetype64.lib;usp10.lib;%(AdditionalDependencies) @@ -559,6 +567,7 @@ Level3 ProgramDatabase + /utf-8 %(AdditionalOptions) freetype64_inf.lib;usp10.lib;%(AdditionalDependencies) @@ -590,6 +599,7 @@ Level3 ProgramDatabase + /utf-8 %(AdditionalOptions) freetype64.lib;usp10.lib;%(AdditionalDependencies) @@ -620,6 +630,7 @@ Level3 ProgramDatabase + /utf-8 %(AdditionalOptions) freetype64.lib;usp10.lib;%(AdditionalDependencies) From 905f74b4e37c60ab0a8e139248e0fad1af0540a9 Mon Sep 17 00:00:00 2001 From: extratype Date: Wed, 6 Jan 2021 22:37:17 +0900 Subject: [PATCH 2/2] Export FT_Glyph_To_BitmapEx in the patched freetype --- doc/glyph_to_bitmapex.diff | 22 +++++++++++++++++----- ft.cpp | 10 ---------- 2 files changed, 17 insertions(+), 15 deletions(-) diff --git a/doc/glyph_to_bitmapex.diff b/doc/glyph_to_bitmapex.diff index 185f236..cc98e0d 100644 --- a/doc/glyph_to_bitmapex.diff +++ b/doc/glyph_to_bitmapex.diff @@ -1,8 +1,3 @@ - src/base/ftglyph.c | 112 +++++++++++++++++++++++++++++++++++++++++++++++++++++ - 1 file changed, 112 insertions(+) - -diff --git a/src/base/ftglyph.c b/src/base/ftglyph.c -index 27402ecf8..7637388a8 100644 --- a/src/base/ftglyph.c +++ b/src/base/ftglyph.c @@ -634,6 +634,118 @@ @@ -124,3 +119,20 @@ index 27402ecf8..7637388a8 100644 /* documentation is in ftglyph.h */ FT_EXPORT_DEF( void ) +--- a/include/freetype/ftglyph.h ++++ b/include/freetype/ftglyph.h +@@ -574,6 +574,14 @@ + FT_Vector* origin, + FT_Bool destroy ); + ++ FT_EXPORT(FT_Error) ++ FT_Glyph_To_BitmapEx(FT_Glyph* the_glyph, ++ FT_Render_Mode render_mode, ++ FT_Vector* origin, ++ FT_Bool destroy, ++ FT_Bool loadcolor, ++ FT_UInt glyphindex, ++ FT_Face face); + + /************************************************************************** + * diff --git a/ft.cpp b/ft.cpp index cdde467..106f23d 100644 --- a/ft.cpp +++ b/ft.cpp @@ -99,16 +99,6 @@ void Log(wchar_t* Msg) fclose(f); } -FT_EXPORT_DEF(FT_Error) -FT_Glyph_To_BitmapEx(FT_Glyph* the_glyph, - FT_Render_Mode render_mode, - FT_Vector* origin, - FT_Bool destroy, - FT_Bool loadcolor, - FT_UInt glyphindex, - FT_Face face); - - class CAlphaBlend { private: