diff --git a/ft.cpp b/ft.cpp
index 6a27e4e..754b433 100644
--- a/ft.cpp
+++ b/ft.cpp
@@ -99,8 +99,7 @@ void Log(wchar_t* Msg)
fclose(f);
}
-FT_EXPORT_DEF(FT_Error)
-FT_Glyph_To_BitmapEx(FT_Glyph* the_glyph,
+extern "C" FT_Error FT_Glyph_To_BitmapEx(FT_Glyph* the_glyph,
FT_Render_Mode render_mode,
FT_Vector* origin,
FT_Bool destroy,
diff --git a/gdidll.rc b/gdidll.rc
index dbf3cca..187df91 100644
--- a/gdidll.rc
+++ b/gdidll.rc
@@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
-#include "winres.h"
+#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
@@ -24,8 +24,8 @@ LANGUAGE LANG_NEUTRAL, SUBLANG_SYS_DEFAULT
//
VS_VERSION_INFO VERSIONINFO
- FILEVERSION 1,2019,523,1
- PRODUCTVERSION 1,2019,5,23
+ FILEVERSION 1,2021,507,1
+ PRODUCTVERSION 1,2021,5,7
FILEFLAGSMASK 0x8L
#ifdef _DEBUG
FILEFLAGS 0xbL
@@ -40,15 +40,15 @@ BEGIN
BEGIN
BLOCK "000004b0"
BEGIN
- VALUE "Comments", "Portions of this software are copyright (c) 2005-2017 The FreeType Project (www.freetype.org). All rights reserved."
- VALUE "CompanyName", "2ch & THEMEX"
+ VALUE "Comments", "Portions of this software are copyright (c) 2005-2021 The FreeType Project (www.freetype.org). All rights reserved."
+ VALUE "CompanyName", "2ch & THEMEX & everyone"
VALUE "FileDescription", "The Ultimate Font Rasterizer"
- VALUE "FileVersion", "1.2019.523.1"
+ VALUE "FileVersion", "1.2021.507.1"
VALUE "InternalName", "MacType"
VALUE "LegalCopyright", "(C) 460, 168, Higambana, 555 and sy567. All rights reserved. FlyingSnow republished"
VALUE "OriginalFilename", "MacType.dll"
VALUE "ProductName", "The Ultimate Font Rasterizer"
- VALUE "ProductVersion", "1.2019.5.23"
+ VALUE "ProductVersion", "1.2021.5.7"
VALUE "URL", "http://www.mactype.net http://drwatson.nobody.jp/gdi++/"
END
END
diff --git a/gdipp.vcxproj b/gdipp.vcxproj
index 0fcddf1..23be7af 100644
--- a/gdipp.vcxproj
+++ b/gdipp.vcxproj
@@ -55,14 +55,14 @@
{15C33FD9-0811-4981-B08F-E0BAD74A3028}
gdipp
Win32Proj
- 10.0.19041.0
+ 10.0
DynamicLibrary
Unicode
true
- v140
+ v142
DynamicLibrary
@@ -82,7 +82,7 @@
DynamicLibrary
- v140
+ v142
Unicode
true
@@ -473,6 +473,7 @@
MachineX86
easyhk32.dll
$(SolutionDir)deps\lib;%(AdditionalLibraryDirectories)
+ UseLinkTimeCodeGeneration
@@ -539,6 +540,7 @@
MachineX64
easyhk64.dll
$(SolutionDir)deps\lib;%(AdditionalLibraryDirectories)
+ true
diff --git a/settings.cpp b/settings.cpp
index d25b8a4..9c34c3d 100644
--- a/settings.cpp
+++ b/settings.cpp
@@ -122,9 +122,9 @@ void CGdippSettings::DelayedInit()
}
//ForceChangeFont
- if (m_szForceChangeFont[0]) {
- EnumFontFamilies(hdcScreen, m_szForceChangeFont, EnumFontFamProc, reinterpret_cast(this));
- }
+ //if (m_szForceChangeFont[0]) {
+ // EnumFontFamilies(hdcScreen, m_szForceChangeFont, EnumFontFamProc, reinterpret_cast(this));
+ //}
//fetch screen dpi
m_nScreenDpi = GetDeviceCaps(hdcScreen, LOGPIXELSX);
ReleaseDC(NULL, hdcScreen);
@@ -568,8 +568,8 @@ bool CGdippSettings::LoadAppSettings(LPCTSTR lpszFile)
INF_INT_ENV( "INFINALITY_FT_AUTOHINT_VERTICAL_STEM_DARKEN_STRENGTH", 25);
INF_INT_ENV( "INFINALITY_FT_FRINGE_FILTER_STRENGTH", 0);
INF_INT_ENV("INFINALITY_FT_GLOBAL_EMBOLDEN_X_VALUE", 0);
- INF_INT_ENV("INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE", 0);
- INF_INT_ENV("INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE", 0);
+ INF_INT_ENV("INFINALITY_FT_GLOBAL_EMBOLDEN_Y_VALUE", 0);
+ INF_INT_ENV("INFINALITY_FT_BOLD_EMBOLDEN_X_VALUE", 0);
INF_INT_ENV("INFINALITY_FT_BOLD_EMBOLDEN_Y_VALUE", 0);
INF_INT_ENV("INFINALITY_FT_STEM_SNAPPING_SLIDING_SCALE", 0);
@@ -597,7 +597,7 @@ bool CGdippSettings::LoadAppSettings(LPCTSTR lpszFile)
// �t�H���g�w��
ZeroMemory(&m_lfForceFont, sizeof(LOGFONT));
m_szForceChangeFont[0] = _T('\0');
- _GetFreeTypeProfileString(_T("ForceChangeFont"), _T(""), m_szForceChangeFont, LF_FACESIZE, lpszFile);
+ //_GetFreeTypeProfileString(_T("ForceChangeFont"), _T(""), m_szForceChangeFont, LF_FACESIZE, lpszFile);
// OS�̃o�[�W������XP�ȍ~���ǂ���
//OSVERSIONINFO osvi = { sizeof(OSVERSIONINFO) };
@@ -636,10 +636,10 @@ bool CGdippSettings::LoadAppSettings(LPCTSTR lpszFile)
// [IncludeModule]�Z�N�V��������Ώۃ��W���[�����X�g��ǂݍ���
AddListFromSection(_T("IncludeModule"), lpszFile, m_arrIncludeModule);
//AddListFromSection(_T("IncludeModule"), szMainFile, m_arrIncludeModule);
- // [UnloadDLL]́E������ص�ģ��E
+ // [UnloadDLL]́E������ص�ģ��E
AddListFromSection(_T("UnloadDLL"), lpszFile, m_arrUnloadModule);
//AddListFromSection(_T("UnloadDLL"), szMainFile, m_arrUnloadModule);
- // [ExcludeSub]�����������滻��ģ��E
+ // [ExcludeSub]�����������滻��ģ��E
AddListFromSection(L"ExcludeSub", lpszFile, m_arrUnFontSubModule);
//AddListFromSection(L"ExcludeSub", szMainFile, m_arrUnFontSubModule);
//������ų���ģ�飬��ر������滻
@@ -667,14 +667,6 @@ bool CGdippSettings::LoadAppSettings(LPCTSTR lpszFile)
return true;
}
-int CALLBACK CGdippSettings::EnumFontFamProc(const LOGFONT* lplf, const TEXTMETRIC* /*lptm*/, DWORD FontType, LPARAM lParam)
-{
- CGdippSettings* pThis = reinterpret_cast(lParam);
- if (pThis && FontType == TRUETYPE_FONTTYPE)
- pThis->m_lfForceFont = *lplf;
- return 0;
-}
-
bool CGdippSettings::AddExcludeListFromSection(LPCTSTR lpszSection, LPCTSTR lpszFile, set & arr)
{
LPTSTR buffer = _GetPrivateProfileSection(lpszSection, lpszFile);
@@ -688,7 +680,7 @@ bool CGdippSettings::AddExcludeListFromSection(LPCTSTR lpszSection, LPCTSTR lpsz
LOGFONT truefont={0};
while (*p) {
bool b = false;
- GetFontLocalName(p, buff);//ת������ÁE
+ GetFontLocalName(p, buff);//ת������ÁE
set::const_iterator it = arr.find(buff);
if (it==arr.end())
arr.insert(buff);
@@ -769,7 +761,7 @@ bool CGdippSettings::AddIndividualFromSection(LPCTSTR lpszSection, LPCTSTR lpszF
argc = token.Parse(value);
}
- GetFontLocalName(p, buff);//ת������ÁE
+ GetFontLocalName(p, buff);//ת������ÁE
CFontIndividual fi(buff);
const CFontSettings& fsCommon = m_FontSettings;
@@ -988,7 +980,7 @@ bool CGdippSettings::IsProcessUnload() const
return false;
}
-bool CGdippSettings::IsExeUnload(LPCTSTR lpApp) const //��E��Ƿ��ں������б��?
+bool CGdippSettings::IsExeUnload(LPCTSTR lpApp) const //��E��Ƿ��ں������б��?
{
if (m_bRunFromGdiExe) {
return false;
@@ -998,14 +990,14 @@ bool CGdippSettings::IsProcessUnload() const
return false;
ModuleHashMap::const_iterator it = m_arrUnloadModule.begin();
for(; it != m_arrUnloadModule.end(); ++it) {
- if (!lstrcmpi(lpApp, it->c_str())) { //ƥ���ų�ρE
+ if (!lstrcmpi(lpApp, it->c_str())) { //ƥ���ų�ρE
return true;
}
}
return false;
}
-bool CGdippSettings::IsExeInclude(LPCTSTR lpApp) const //��E��Ƿ��ڰ������б��?
+bool CGdippSettings::IsExeInclude(LPCTSTR lpApp) const //��E��Ƿ��ڰ������б��?
{
if (m_bRunFromGdiExe) {
return false;
@@ -1015,7 +1007,7 @@ bool CGdippSettings::IsProcessUnload() const
return false;
ModuleHashMap::const_iterator it = m_arrIncludeModule.begin();
for(; it != m_arrIncludeModule.end(); ++it) {
- if (!lstrcmpi(lpApp, it->c_str())) { //ƥ���ų�ρE
+ if (!lstrcmpi(lpApp, it->c_str())) { //ƥ���ų�ρE
return true;
}
}
@@ -1152,15 +1144,12 @@ bool CGdippSettings::CopyForceFont(LOGFONT& lf, const LOGFONT& lfOrg) const
if (GetLastError()!=ERROR_ENVVAR_NOT_FOUND)
return false;
//&lf == &lfOrg����
- bool bForceFont = !!GetForceFontName();
+ bool bForceFont = false;
BOOL bFontExist = true;
const LOGFONT *lplf;
- if (bForceFont) {
- lplf = &m_lfForceFont;
- } else {
- lplf = GetFontSubstitutesInfo().lookup((LOGFONT&)lfOrg);
- if (lplf) bForceFont = true;
- }
+ lplf = GetFontSubstitutesInfo().lookup((LOGFONT&)lfOrg);
+ if (lplf) bForceFont = true;
+
if (bForceFont) {
memcpy(&lf, &lfOrg, sizeof(LOGFONT)-sizeof(lf.lfFaceName));
StringCchCopy(lf.lfFaceName, LF_FACESIZE, lplf->lfFaceName);
@@ -1232,7 +1221,7 @@ void CFontLinkInfo::init()
LONG rc;
DWORD regtype;
- for (int k = 0; ; ++k) { //���������е�������́E
+ for (int k = 0; ; ++k) { //���������е�������́E
namesz = nBufSize;
valuesz = nBufSize;
rc = RegEnumValue(h2, k, name, &namesz, 0, ®type, (LPBYTE)value, &valuesz); //���������Ѱ��
@@ -1248,7 +1237,7 @@ void CFontLinkInfo::init()
}
while (buf[wcslen(buf)-1] == L' ')
buf[wcslen(buf)-1] = 0;
- //��õĶ�Ӧ������ÁE
+ //��õĶ�Ӧ������ÁE
FontNameCache.Add(value, buf);
}
@@ -1269,7 +1258,7 @@ void CFontLinkInfo::init()
TCHAR buff[LF_FACESIZE];
GetFontLocalName(name, buff);
- info[row][col] = _wcsdup(buff); //��һ�������ÁE
+ info[row][col] = _wcsdup(buff); //��һ�������ÁE
++col;
for (LPCWSTR linep = value; col < FONTMAX && *linep; linep += wcslen(linep) + 1) {
@@ -1293,7 +1282,7 @@ void CFontLinkInfo::init()
if (rc == ERROR_NO_MORE_ITEMS) break;
if (rc != ERROR_SUCCESS) break;
if (regtype != REG_SZ) continue;
- if (lstrcmpi(value2, linep) != 0) continue; //Ѱ�����������������ļ���Ӧ������ÁE
+ if (lstrcmpi(value2, linep) != 0) continue; //Ѱ�����������������ļ���Ӧ������ÁE
StringCchCopyW(buf, sizeof(buf)/sizeof(buf[0]), name);
if (buf[wcslen(buf) - 1] == L')') { //ȥ������
@@ -1317,7 +1306,7 @@ void CFontLinkInfo::init()
if (valp) {
GetFontLocalName((TCHAR*)valp, buff);;
//StringCchCopy(truefont.lfFaceName, LF_FACESIZE, buff); //���Ƶ��ṹ��
- //pSettings->CopyForceFont(truefont, truefont); //����滻��́E
+ //pSettings->CopyForceFont(truefont, truefont); //����滻��́E
info[row][col] = _wcsdup(buff);//truefont.lfFaceName); //���Ƶ����ӱ���
++col;
}
@@ -1328,11 +1317,11 @@ void CFontLinkInfo::init()
} else {
/*if (sOsVinfo.dwMajorVersion>=6 && sOsVinfo.dwMinorVersion>=1) //�汾��>=6.1����Win7ϵ��
{
- //���������ӱ���������E
+ //���������ӱ���������E
LPWSTR swapbuff[32];
memcpy(swapbuff, info[row], 32*sizeof(LPWSTR)); //������Դ�ƹ���
for (int i=1; iFontSubstitutes()>=SETTING_FONTSUBSTITUTE_SAFE && pSettings->CopyForceFont(truefont, syslf)) //ʹ��́E��滻ģʽʱ���滻��ϵͳ��́E
+ if (pSettings->FontSubstitutes()>=SETTING_FONTSUBSTITUTE_SAFE && pSettings->CopyForceFont(truefont, syslf)) //ʹ��́E��滻ģʽʱ���滻��ϵͳ��́E
{
WCHAR envname[30] = L"MT_SYSFONT";
WCHAR envvalue[30] = { 0 };
HFONT tempfont;
if (GetEnvironmentVariable(L"MT_SYSFONT", envvalue, 29) && GetObjectType(tempfont = (HFONT)wcstoull(envvalue, 0 ,10)) == OBJ_FONT)//�Ѿ����������
{
- g_alterGUIFont = tempfont; //ֱ��ʹ����ǰ����́E
+ g_alterGUIFont = tempfont; //ֱ��ʹ����ǰ����́E
}
else
{
- g_alterGUIFont = CreateFontIndirectW(&truefont); //����һ���µ��滻��́E
+ g_alterGUIFont = CreateFontIndirectW(&truefont); //����һ���µ��滻��́E
_ui64tow((ULONG_PTR)g_alterGUIFont, envvalue, 10); //ת��Ϊ�ַ���
- SetEnvironmentVariable(envname, envvalue); //дȁE������?
+ SetEnvironmentVariable(envname, envvalue); //дȁE������?
}
}
@@ -1585,13 +1574,13 @@ CFontSubstitutesInfo::initini(const CFontSubstitutesIniArray& iniarray)
/* StringCchCopy(truefont.lfFaceName, LF_FACESIZE, buf);
truefont.lfCharSet=DEFAULT_CHARSET;
if (!GetFontLocalName(truefont))
- continue; //û�д���́E
+ continue; //û�д���́E
buff = truefont.lfFaceName;
StringCchCopy(truefont2.lfFaceName, LF_FACESIZE, vp);
truefont2.lfCharSet=DEFAULT_CHARSET;
if (!GetFontLocalName(truefont2))
- continue; //û�д���́E
+ continue; //û�д���́E
buff2 = truefont2.lfFaceName;
if (m_mfontsub.find(buff)==m_mfontsub.end())
@@ -1634,7 +1623,7 @@ CFontSubstitutesInfo::lookup(LOGFONT& lf) const
k.m_bCharSet = true;
k.m_lf = lf;
- TCHAR * buff; //��Eٻ���������ʵ���?
+ TCHAR * buff; //��Eٻ���������ʵ���?
LOGFONT mylf(lf);
if (!(buff = FontNameCache.Find((TCHAR*)lf.lfFaceName)))
{
diff --git a/settings.h b/settings.h
index 9f693c2..00bfb3b 100644
--- a/settings.h
+++ b/settings.h
@@ -349,7 +349,6 @@ class CGdippSettings
static float _GetFreeTypeProfileFloat (LPCTSTR lpszKey, float fDefault, LPCTSTR lpszFile);
static float _GetFreeTypeProfileBoundFloat(LPCTSTR lpszKey, float fDefault, float fMin, float fMax, LPCTSTR lpszFile);
static DWORD _GetFreeTypeProfileString (LPCTSTR lpszKey, LPCTSTR lpszDefault, LPTSTR lpszRet, DWORD cch, LPCTSTR lpszFile);
- static int CALLBACK EnumFontFamProc(const LOGFONT* lplf, const TEXTMETRIC* lptm, DWORD FontType, LPARAM lParam);
//template
static bool AddListFromSection(LPCTSTR lpszSection, LPCTSTR lpszFile, set & arr);
static bool AddExcludeListFromSection(LPCTSTR lpszSection, LPCTSTR lpszFile, set & arr);
@@ -468,13 +467,6 @@ class CGdippSettings
// OS version comparsion for magic code
bool IsWindows8() const { return m_dwOSMajorVer == 6 && m_dwOSMinorVer == 2; }
bool IsWindows81() const { return m_dwOSMajorVer == 6 && m_dwOSMinorVer == 3; }
- // �ե��������ߤȤ�
- LPCTSTR GetForceFontName() const
- {
- _ASSERTE(m_bDelayedInit);
- LPCTSTR lpszFace = m_lfForceFont.lfFaceName;
- return lpszFace[0] ? lpszFace : NULL;
- }
bool CopyForceFont(LOGFONT& lf, const LOGFONT& lfOrg) const;