fix font handle
This commit is contained in:
@@ -74,7 +74,7 @@ static PVOID h = nullptr;
|
||||
|
||||
HFONT WINAPI HookedCreateFontW(int nHeight, int nWidth, int nEscapement, int nOrientation, int fnWeight, DWORD dwItalic, DWORD dwUnderline, DWORD dwStrikeOut, DWORD dwCharSet, DWORD dwOutPrecision, DWORD dwClipPrecision, DWORD dwQuality, DWORD dwPitchAndFamily, LPCWSTR lpFaceName) {
|
||||
std::wstring name(lpFaceName);
|
||||
if (name == L"Meiryo") {
|
||||
if (name == L"MS Gothic" || name == L"MS ゴシック") {
|
||||
lpFaceName = defaultFont.c_str();
|
||||
}
|
||||
return TrueCreateFontW(nHeight, nWidth, nEscapement, nOrientation, fnWeight, dwItalic, dwUnderline, dwStrikeOut, dwCharSet, dwOutPrecision, dwClipPrecision, dwQuality, dwPitchAndFamily, lpFaceName);
|
||||
@@ -85,13 +85,13 @@ HFONT WINAPI HookedCreateFontA(int nHeight, int nWidth, int nEscapement, int nOr
|
||||
std::wstring font;
|
||||
for (int i = 0; i < 4; i++) {
|
||||
if (wchar_util::str_to_wstr(font, lpFaceName, cp[i])) {
|
||||
if (font == L"Meiryo") {
|
||||
if (font == L"MS Gothic" || font == L"MS ゴシック") {
|
||||
font = defaultFont;
|
||||
}
|
||||
return TrueCreateFontW(nHeight, nWidth, nEscapement, nOrientation, fnWeight, dwItalic, dwUnderline, dwStrikeOut, dwCharSet, dwOutPrecision, dwClipPrecision, dwQuality, dwPitchAndFamily, font.c_str());
|
||||
}
|
||||
}
|
||||
if (!strcmp(lpFaceName, "Meiryo")) {
|
||||
if (!strcmp(lpFaceName, "MS Gothic")) {
|
||||
lpFaceName = "Microsoft YaHei";
|
||||
}
|
||||
return TrueCreateFontA(nHeight, nWidth, nEscapement, nOrientation, fnWeight, dwItalic, dwUnderline, dwStrikeOut, dwCharSet, dwOutPrecision, dwClipPrecision, dwQuality, dwPitchAndFamily, lpFaceName);
|
||||
|
||||
Reference in New Issue
Block a user