Skip to content

Commit

Permalink
1.16
Browse files Browse the repository at this point in the history
updated
  • Loading branch information
silight-jp committed Oct 23, 2016
1 parent c479d22 commit bc08503
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 18 deletions.
Binary file modified bin/Release/EasyHK32.dll
Binary file not shown.
Binary file modified bin/Release/EasyHK64.dll
Binary file not shown.
1 change: 1 addition & 0 deletions readmeEN.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ How to use
Good Luck!

Version History
2016/10/08 1.16 Bug fix.
2016/10/07 1.15 Bug fix and speed up.
2016/10/05 1.14 Bug fix for High DPI.
Bug fix for text including space.
Expand Down
Binary file modified readmeJP.txt
Binary file not shown.
8 changes: 4 additions & 4 deletions resource32.rc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,15,0,0
PRODUCTVERSION 1,15,0,0
FILEVERSION 1,16,0,0
PRODUCTVERSION 1,16,0,0
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -31,12 +31,12 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "MacTypePatch for DirectWrite Hook"
VALUE "FileVersion", "1.15.0.0"
VALUE "FileVersion", "1.16.0.0"
VALUE "InternalName", "EasyHK32.dll"
VALUE "LegalCopyright", "Copyright (C) 2016 silight"
VALUE "OriginalFilename", "EasyHK32.dll"
VALUE "ProductName", "MacTypePatch for DirectWrite Hook"
VALUE "ProductVersion", "1.15.0.0"
VALUE "ProductVersion", "1.16.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down
8 changes: 4 additions & 4 deletions resource64.rc
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
//

VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,15,0,0
PRODUCTVERSION 1,15,0,0
FILEVERSION 1,16,0,0
PRODUCTVERSION 1,16,0,0
FILEFLAGSMASK 0x0L
#ifdef _DEBUG
FILEFLAGS 0x1L
Expand All @@ -31,12 +31,12 @@ BEGIN
BLOCK "040904b0"
BEGIN
VALUE "FileDescription", "MacTypePatch for DirectWrite Hook"
VALUE "FileVersion", "1.15.0.0"
VALUE "FileVersion", "1.16.0.0"
VALUE "InternalName", "EasyHK64.dll"
VALUE "LegalCopyright", "Copyright (C) 2016 silight"
VALUE "OriginalFilename", "EasyHK64.dll"
VALUE "ProductName", "MacTypePatch for DirectWrite Hook"
VALUE "ProductVersion", "1.15.0.0"
VALUE "ProductVersion", "1.16.0.0"
END
END
BLOCK "VarFileInfo"
Expand Down
29 changes: 19 additions & 10 deletions src/mactype.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -163,13 +163,14 @@ namespace Impl
CONST INT *lpDx
) {
// space bug fix
if (cbCount > 1 && (GetTextAlign(hdc) & 0x7) == (TA_NOUPDATECP & TA_LEFT)) {
if (lpDx && cbCount > 1 && (GetTextAlign(hdc) & 0x7) == (TA_NOUPDATECP & TA_LEFT)) {
bool isSucceeded = true;
UINT16 space = L' ';
if (fuOptions & ETO_GLYPH_INDEX) {
isSucceeded = GetGlyphIndicesW(hdc, L" ", 1, &space, GGI_MARK_NONEXISTING_GLYPHS) == 1;
}
if (isSucceeded) {
int textCharacterExtra = GetTextCharacterExtra(hdc);
if (isSucceeded && textCharacterExtra != 0x80000000) {
WCHAR* textStr = new WCHAR[cbCount];
WCHAR* spaceStr = new WCHAR[cbCount];
UINT textCount = 0;
Expand All @@ -187,13 +188,15 @@ namespace Impl
spaceX = 0;
spaceY = 0;
spaceCount++;
textX += textCharacterExtra;
} else {
textStr[textCount] = lpString[i];
textDx[2 * textCount] = textX;
textDx[2 * textCount + 1] = textY;
textX = 0;
textY = 0;
textCount++;
spaceX += textCharacterExtra;
}
textX += lpDx[2 * i];
textY += lpDx[2 * i + 1];
Expand All @@ -217,11 +220,13 @@ namespace Impl
spaceDx[spaceCount] = spaceX;
spaceX = 0;
spaceCount++;
textX += textCharacterExtra;
} else {
textStr[textCount] = lpString[i];
textDx[textCount] = textX;
textX = 0;
textCount++;
spaceX += textCharacterExtra;
}
textX += lpDx[i];
spaceX += lpDx[i];
Expand Down Expand Up @@ -262,22 +267,26 @@ namespace Impl
) {
// use lpDx in ExtTextOutW_BugFix2
if (!lpDx && !(fuOptions & ETO_PDY)) {
INT* dx = new INT[cbCount]{};
INT* dx = new INT[cbCount];
if (dx) {
SIZE size = { };
SIZE size;
BOOL isSucceeded = fuOptions & ETO_GLYPH_INDEX ?
GetTextExtentExPointI(hdc, (LPWORD)lpString, cbCount, 0, nullptr, dx, &size) :
GetTextExtentExPointW(hdc, lpString, cbCount, 0, nullptr, dx, &size);
if (isSucceeded) {
for (size_t i = cbCount - 1; i > 0; i--) {
dx[i] -= dx[i - 1];
int prevTextCharacterExtra = SetTextCharacterExtra(hdc, 0);
if (prevTextCharacterExtra != 0x80000000) {
for (size_t i = cbCount - 1; i > 0; i--) {
dx[i] -= dx[i - 1];
}
BOOL ret = ExtTextOutW_BugFix2(hdc, X, Y, fuOptions, lprc, lpString, cbCount, dx);
SetTextCharacterExtra(hdc, prevTextCharacterExtra);
delete[] dx;
return ret;
}
BOOL ret = ExtTextOutW_BugFix2(hdc, X, Y, fuOptions, lprc, lpString, cbCount, dx);
delete[] dx;
return ret;
}
delete[] dx;
}

}
return ExtTextOutW_BugFix2(hdc, X, Y, fuOptions, lprc, lpString, cbCount, lpDx);
}
Expand Down

0 comments on commit bc08503

Please sign in to comment.