Skip to content

Commit

Permalink
Bump version.
Browse files Browse the repository at this point in the history
Removed ForceChangeFont.
Refactored the declaration of FT_Glyph_To_BitmapEx
  • Loading branch information
snowie2000 committed May 7, 2021
1 parent 02bb123 commit 1dfb340
Show file tree
Hide file tree
Showing 5 changed files with 45 additions and 63 deletions.
3 changes: 1 addition & 2 deletions ft.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
14 changes: 7 additions & 7 deletions gdidll.rc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "winres.h"
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS

Expand All @@ -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
Expand All @@ -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
Expand Down
8 changes: 5 additions & 3 deletions gdipp.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,14 @@
<ProjectGuid>{15C33FD9-0811-4981-B08F-E0BAD74A3028}</ProjectGuid>
<RootNamespace>gdipp</RootNamespace>
<Keyword>Win32Proj</Keyword>
<WindowsTargetPlatformVersion>10.0.19041.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release Infinality|Win32'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
Expand All @@ -82,7 +82,7 @@
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<ConfigurationType>DynamicLibrary</ConfigurationType>
<PlatformToolset>v140</PlatformToolset>
<PlatformToolset>v142</PlatformToolset>
<CharacterSet>Unicode</CharacterSet>
<WholeProgramOptimization>true</WholeProgramOptimization>
</PropertyGroup>
Expand Down Expand Up @@ -473,6 +473,7 @@
<TargetMachine>MachineX86</TargetMachine>
<DelayLoadDLLs>easyhk32.dll</DelayLoadDLLs>
<AdditionalLibraryDirectories>$(SolutionDir)deps\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Infinality|Win32'">
Expand Down Expand Up @@ -539,6 +540,7 @@
<TargetMachine>MachineX64</TargetMachine>
<DelayLoadDLLs>easyhk64.dll</DelayLoadDLLs>
<AdditionalLibraryDirectories>$(SolutionDir)deps\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<CETCompat>true</CETCompat>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release Infinality|x64'">
Expand Down
75 changes: 32 additions & 43 deletions settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,9 +122,9 @@ void CGdippSettings::DelayedInit()
}

//ForceChangeFont
if (m_szForceChangeFont[0]) {
EnumFontFamilies(hdcScreen, m_szForceChangeFont, EnumFontFamProc, reinterpret_cast<LPARAM>(this));
}
//if (m_szForceChangeFont[0]) {
// EnumFontFamilies(hdcScreen, m_szForceChangeFont, EnumFontFamProc, reinterpret_cast<LPARAM>(this));
//}
//fetch screen dpi
m_nScreenDpi = GetDeviceCaps(hdcScreen, LOGPIXELSX);
ReleaseDC(NULL, hdcScreen);
Expand Down Expand Up @@ -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);

Expand Down Expand Up @@ -597,7 +597,7 @@ bool CGdippSettings::LoadAppSettings(LPCTSTR lpszFile)
// フォント指定
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のバージョンがXP以降かどうか
//OSVERSIONINFO osvi = { sizeof(OSVERSIONINFO) };
Expand Down Expand Up @@ -636,10 +636,10 @@ bool CGdippSettings::LoadAppSettings(LPCTSTR lpszFile)
// [IncludeModule]セクションから対象モジュールリストを読み込む
AddListFromSection(_T("IncludeModule"), lpszFile, m_arrIncludeModule);
//AddListFromSection(_T("IncludeModule"), szMainFile, m_arrIncludeModule);
// [UnloadDLL]ヘ・ォイサシモヤリオトト」ソ・
// [UnloadDLL]ヘ・ォイサシモヤリオトト」ソ・
AddListFromSection(_T("UnloadDLL"), lpszFile, m_arrUnloadModule);
//AddListFromSection(_T("UnloadDLL"), szMainFile, m_arrUnloadModule);
// [ExcludeSub]イサスミラヨフ衫貊サオトト」ソ・
// [ExcludeSub]イサスミラヨフ衫貊サオトト」ソ・
AddListFromSection(L"ExcludeSub", lpszFile, m_arrUnFontSubModule);
//AddListFromSection(L"ExcludeSub", szMainFile, m_arrUnFontSubModule);
//ネ郢鈹ヌナナウオトト」ソ鬟ャヤリアユラヨフ衫貊サ
Expand Down Expand Up @@ -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<CGdippSettings*>(lParam);
if (pThis && FontType == TRUETYPE_FONTTYPE)
pThis->m_lfForceFont = *lplf;
return 0;
}

bool CGdippSettings::AddExcludeListFromSection(LPCTSTR lpszSection, LPCTSTR lpszFile, set<wstring> & arr)
{
LPTSTR buffer = _GetPrivateProfileSection(lpszSection, lpszFile);
Expand All @@ -688,7 +680,7 @@ bool CGdippSettings::AddExcludeListFromSection(LPCTSTR lpszSection, LPCTSTR lpsz
LOGFONT truefont={0};
while (*p) {
bool b = false;
GetFontLocalName(p, buff);//ラェササラヨフ蠹・
GetFontLocalName(p, buff);//ラェササラヨフ蠹・
set<wstring>::const_iterator it = arr.find(buff);
if (it==arr.end())
arr.insert(buff);
Expand Down Expand Up @@ -769,7 +761,7 @@ bool CGdippSettings::AddIndividualFromSection(LPCTSTR lpszSection, LPCTSTR lpszF
argc = token.Parse(value);
}

GetFontLocalName(p, buff);//ラェササラヨフ蠹・
GetFontLocalName(p, buff);//ラェササラヨフ蠹・

CFontIndividual fi(buff);
const CFontSettings& fsCommon = m_FontSettings;
Expand Down Expand Up @@ -988,7 +980,7 @@ bool CGdippSettings::IsProcessUnload() const
return false;
}

bool CGdippSettings::IsExeUnload(LPCTSTR lpApp) const //シ・鯡ヌキレコレテ遧・チミア朗?
bool CGdippSettings::IsExeUnload(LPCTSTR lpApp) const //シ・鯡ヌキレコレテ遧・チミア朗?
{
if (m_bRunFromGdiExe) {
return false;
Expand All @@ -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())) { //ニ・ナ菁ナウマ・
if (!lstrcmpi(lpApp, it->c_str())) { //ニ・ナ菁ナウマ・
return true;
}
}
return false;
}

bool CGdippSettings::IsExeInclude(LPCTSTR lpApp) const //シ・鯡ヌキレーラテ遧・チミア朗?
bool CGdippSettings::IsExeInclude(LPCTSTR lpApp) const //シ・鯡ヌキレーラテ遧・チミア朗?
{
if (m_bRunFromGdiExe) {
return false;
Expand All @@ -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())) { //ニ・ナ菁ナウマ・
if (!lstrcmpi(lpApp, it->c_str())) { //ニ・ナ菁ナウマ・
return true;
}
}
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -1232,7 +1221,7 @@ void CFontLinkInfo::init()
LONG rc;
DWORD regtype;

for (int k = 0; ; ++k) { //サテラヨフ螻櫢ミオトヒミラヨフ・
for (int k = 0; ; ++k) { //サテラヨフ螻櫢ミオトヒミラヨフ・
namesz = nBufSize;
valuesz = nBufSize;
rc = RegEnumValue(h2, k, name, &namesz, 0, &regtype, (LPBYTE)value, &valuesz); //エモラヨフ螻櫢ミムーユメ
Expand All @@ -1248,7 +1237,7 @@ void CFontLinkInfo::init()
}
while (buf[wcslen(buf)-1] == L' ')
buf[wcslen(buf)-1] = 0;
//サテオトカヤモヲオトラヨフ蠹・
//サテオトカヤモヲオトラヨフ蠹・
FontNameCache.Add(value, buf);
}

Expand All @@ -1269,7 +1258,7 @@ void CFontLinkInfo::init()
TCHAR buff[LF_FACESIZE];
GetFontLocalName(name, buff);

info[row][col] = _wcsdup(buff); //オレメサマ﨩ェラヨフ蠹・
info[row][col] = _wcsdup(buff); //オレメサマ﨩ェラヨフ蠹・
++col;

for (LPCWSTR linep = value; col < FONTMAX && *linep; linep += wcslen(linep) + 1) {
Expand All @@ -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; //ムーユメラヨフ蠱エスモヨミラヨフ衾トシカヤモヲオトラヨフ蠹・
if (lstrcmpi(value2, linep) != 0) continue; //ムーユメラヨフ蠱エスモヨミラヨフ衾トシカヤモヲオトラヨフ蠹・
StringCchCopyW(buf, sizeof(buf)/sizeof(buf[0]), name);
if (buf[wcslen(buf) - 1] == L')') { //ネ・オィコナ
Expand All @@ -1317,7 +1306,7 @@ void CFontLinkInfo::init()
if (valp) {
GetFontLocalName((TCHAR*)valp, buff);;
//StringCchCopy(truefont.lfFaceName, LF_FACESIZE, buff); //クエヨニオスス盪ケヨミ
//pSettings->CopyForceFont(truefont, truefont); //サテフ貊サラヨフ・
//pSettings->CopyForceFont(truefont, truefont); //サテフ貊サラヨフ・
info[row][col] = _wcsdup(buff);//truefont.lfFaceName); //クエヨニオスチエスモア櫢ミ
++col;
}
Expand All @@ -1328,11 +1317,11 @@ void CFontLinkInfo::init()
} else {
/*if (sOsVinfo.dwMajorVersion>=6 && sOsVinfo.dwMinorVersion>=1) //ー豎セコナ>=6.1」ャハヌWin7マオチミ
{
//カヤラヨフ蠱エスモア櫤賺ヲタ・
//カヤラヨフ蠱エスモア櫤賺ヲタ・
LPWSTR swapbuff[32];
memcpy(swapbuff, info[row], 32*sizeof(LPWSTR)); //ユ鄕昤エヨニケタエ
for (int i=1; i<col; i++)
info[row][i]=swapbuff[col-i]; //ト賻ヨフ蠱エスモア・
info[row][i]=swapbuff[col-i]; //ト賻ヨフ蠱エスモア・
}*/
++row;
}
Expand All @@ -1348,20 +1337,20 @@ void CFontLinkInfo::init()

extern HFONT g_alterGUIFont;
const CGdippSettings* pSettings = CGdippSettings::GetInstance();
if (pSettings->FontSubstitutes()>=SETTING_FONTSUBSTITUTE_SAFE && pSettings->CopyForceFont(truefont, syslf)) //ハケモテヘ・ォフ貊サト」ハスハア」ャフ貊サオオヘウラヨフ・
if (pSettings->FontSubstitutes()>=SETTING_FONTSUBSTITUTE_SAFE && pSettings->CopyForceFont(truefont, syslf)) //ハケモテヘ・ォフ貊サト」ハスハア」ャフ貊サオオヘウラヨフ・
{
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; //ヨアスモハケモテマネヌーオトラヨフ・
g_alterGUIFont = tempfont; //ヨアスモハケモテマネヌーオトラヨフ・
}
else
{
g_alterGUIFont = CreateFontIndirectW(&truefont); //エエスィメサクツオトフ貊サラヨフ・
g_alterGUIFont = CreateFontIndirectW(&truefont); //エエスィメサクツオトフ貊サラヨフ・
_ui64tow((ULONG_PTR)g_alterGUIFont, envvalue, 10); //ラェササホェラヨキ逸ョ
SetEnvironmentVariable(envname, envvalue); //ミエネ・キセウア菽?
SetEnvironmentVariable(envname, envvalue); //ミエネ・キセウア菽?
}
}

Expand Down Expand Up @@ -1585,13 +1574,13 @@ CFontSubstitutesInfo::initini(const CFontSubstitutesIniArray& iniarray)
/* StringCchCopy(truefont.lfFaceName, LF_FACESIZE, buf);
truefont.lfCharSet=DEFAULT_CHARSET;
if (!GetFontLocalName(truefont))
continue; //テサモミエヒラヨフ・
continue; //テサモミエヒラヨフ・
buff = truefont.lfFaceName;
StringCchCopy(truefont2.lfFaceName, LF_FACESIZE, vp);
truefont2.lfCharSet=DEFAULT_CHARSET;
if (!GetFontLocalName(truefont2))
continue; //テサモミエヒラヨフ・
continue; //テサモミエヒラヨフ・
buff2 = truefont2.lfFaceName;
if (m_mfontsub.find(buff)==m_mfontsub.end())
Expand Down Expand Up @@ -1634,7 +1623,7 @@ CFontSubstitutesInfo::lookup(LOGFONT& lf) const
k.m_bCharSet = true;
k.m_lf = lf;

TCHAR * buff; //ソ・ルサテラヨフ蠏トユ賁オテ﨤?
TCHAR * buff; //ソ・ルサテラヨフ蠏トユ賁オテ﨤?
LOGFONT mylf(lf);
if (!(buff = FontNameCache.Find((TCHAR*)lf.lfFaceName)))
{
Expand Down
8 changes: 0 additions & 8 deletions settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <typename T>
static bool AddListFromSection(LPCTSTR lpszSection, LPCTSTR lpszFile, set<wstring> & arr);
static bool AddExcludeListFromSection(LPCTSTR lpszSection, LPCTSTR lpszFile, set<wstring> & arr);
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 1dfb340

Please sign in to comment.