Skip to content

Commit

Permalink
allow you to disable clipboxfix again to get rid of potential side ef…
Browse files Browse the repository at this point in the history
…fect of clipbox enlargement.

Removed usage of Getversion/GetVersionEx.
  • Loading branch information
snowie2000 committed Sep 1, 2016
1 parent 89bab78 commit f6c05e2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions override.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,7 @@ DWORD WINAPI IMPL_GetGlyphOutlineW(__in HDC hdc, __in UINT uChar, __in UINT fuFo
{
const CGdippSettings* pSettings = CGdippSettings::GetInstance();
DWORD ret= ORIG_GetGlyphOutlineW(hdc, uChar, fuFormat, lpgm, cjBuffer, pvBuffer, lpmat2);
if (!cjBuffer || !pvBuffer) {
if (!cjBuffer || !pvBuffer && pSettings->EnableClipBoxFix()) {
if (!(fuFormat & (GGO_BITMAP | GGO_GRAY2_BITMAP | GGO_GRAY4_BITMAP | GGO_GRAY8_BITMAP | GGO_NATIVE))) {
//lpgm->gmptGlyphOrigin.x -= 1;
//lpgm->gmptGlyphOrigin.y += 1;
Expand All @@ -474,7 +474,7 @@ DWORD WINAPI IMPL_GetGlyphOutlineA(__in HDC hdc, __in UINT uChar, __in UINT fuFo
// lpgm->gmptGlyphOrigin.y+=1;
// lpgm->gmBlackBoxY+=1;
// }
if (!cjBuffer || !pvBuffer) {
if (!cjBuffer || !pvBuffer && pSettings->EnableClipBoxFix()) {
if (!(fuFormat & (GGO_BITMAP | GGO_GRAY2_BITMAP | GGO_GRAY4_BITMAP | GGO_GRAY8_BITMAP | GGO_NATIVE))) {
//lpgm->gmptGlyphOrigin.x -= 1;
//lpgm->gmptGlyphOrigin.y += 1;
Expand Down
12 changes: 6 additions & 6 deletions settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,8 +116,8 @@ void CGdippSettings::DelayedInit()
g_pFTEngine->AddFont(lpszFace, FW_NORMAL, false);*/


DWORD dwVersion = GetVersion();
/*
/* DWORD dwVersion = GetVersion();
if (m_bDirectWrite && (DWORD)(LOBYTE(LOWORD(dwVersion)))>5) //vista or later
{
if (GetModuleHandle(_T("d2d1.dll"))) //directwrite support
Expand Down Expand Up @@ -405,7 +405,7 @@ bool CGdippSettings::LoadAppSettings(LPCTSTR lpszFile)
m_nCacheMaxBytes = _GetFreeTypeProfileInt(_T("CacheMaxBytes"), 10485760, lpszFile);

//experimental settings:
m_bEnableClipBoxFix = !!_GetFreeTypeProfileIntFromSection(_T("Experimental"), _T("ClipBoxFix"), 0, lpszFile);
m_bEnableClipBoxFix = !!_GetFreeTypeProfileIntFromSection(_T("Experimental"), _T("ClipBoxFix"), 1, lpszFile);

if (m_nFontLoader == SETTING_FONTLOADER_WIN32) {
// APIが処理してくれるはずなので自前処理は無効化
Expand All @@ -432,9 +432,9 @@ bool CGdippSettings::LoadAppSettings(LPCTSTR lpszFile)
InitTuneTable(nTextTuningB, m_nTuneTableB);

// OSのバージョンがXP以降かどうか
OSVERSIONINFO osvi = { sizeof(OSVERSIONINFO) };
GetVersionEx(&osvi);
m_bIsWinXPorLater = ((osvi.dwMajorVersion > 5) || ((osvi.dwMajorVersion == 5) && (osvi.dwMinorVersion >= 1)));
//OSVERSIONINFO osvi = { sizeof(OSVERSIONINFO) };
//GetVersionEx(&osvi);
m_bIsWinXPorLater = IsWindowsXPOrGreater();

STARTUPINFO si = { sizeof(STARTUPINFO) };
GetStartupInfo(&si);
Expand Down
1 change: 1 addition & 0 deletions settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "gdiPlusFlat2.h"
#include "cache.h"
#include "hash_list.h"
#include <VersionHelpers.h>

#define MACTYPE_VERSION 20160830
#define MAX_FONT_SETTINGS 16
Expand Down

0 comments on commit f6c05e2

Please sign in to comment.