[ui] use 'Segoe UI Symbol' when available

* This is required to display Thai in RTF fields (#217)
* Also fix the position of the Advanced groupbox
This commit is contained in:
Pete Batard 2015-12-30 15:27:52 +01:00
parent 4757a4ac48
commit 0f56c2d1ef
4 changed files with 51 additions and 17 deletions

View file

@ -39,7 +39,7 @@ char WindowsVersionStr[128] = "Windows ";
* [Knuth] The Art of Computer Programming, part 3 (6.4)
*/
/*
/*
* For the used double hash method the table size has to be a prime. To
* correct the user given table size we need a prime test. This trivial
* algorithm is adequate because the code is called only during init and
@ -563,7 +563,7 @@ DWORD RunCommand(const char* cmd, const char* dir, BOOL log)
goto out;
}
// We need an inheritable pipe endpoint handle
DuplicateHandle(GetCurrentProcess(), hOutputWrite, GetCurrentProcess(), &hDupOutputWrite,
DuplicateHandle(GetCurrentProcess(), hOutputWrite, GetCurrentProcess(), &hDupOutputWrite,
0L, TRUE, DUPLICATE_CLOSE_SOURCE | DUPLICATE_SAME_ACCESS);
si.dwFlags = STARTF_USESHOWWINDOW | STARTF_USESTDHANDLES;
si.wShowWindow = SW_HIDE;
@ -618,6 +618,25 @@ BOOL CompareGUID(const GUID *guid1, const GUID *guid2) {
return FALSE;
}
static BOOL CALLBACK EnumFontFamExProc(const LOGFONTA *lpelfe,
const TEXTMETRICA *lpntme, DWORD FontType, LPARAM lParam)
{
return TRUE;
}
BOOL IsFontAvailable(const char* font_name) {
LOGFONTA lf = { 0 };
HDC hDC = GetDC(hMainDialog);
if (font_name == NULL)
return FALSE;
lf.lfCharSet = DEFAULT_CHARSET;
safe_strcpy(lf.lfFaceName, LF_FACESIZE, font_name);
return EnumFontFamiliesExA(hDC, &lf, EnumFontFamExProc, 0, 0);
}
/*
* Set or restore a Local Group Policy DWORD key indexed by szPath/SzPolicy
*/
@ -677,9 +696,9 @@ DWORD WINAPI SetLGPThread(LPVOID param)
static DWORD original_val;
HKEY path_key = NULL, policy_key = NULL;
// MSVC is finicky about these ones => redefine them
const IID my_IID_IGroupPolicyObject =
const IID my_IID_IGroupPolicyObject =
{ 0xea502723L, 0xa23d, 0x11d1, { 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3 } };
const IID my_CLSID_GroupPolicyObject =
const IID my_CLSID_GroupPolicyObject =
{ 0xea502722L, 0xa23d, 0x11d1, { 0xa7, 0xd3, 0x0, 0x0, 0xf8, 0x75, 0x71, 0xe3 } };
GUID ext_guid = REGISTRY_EXTENSION_GUID;
// Can be anything really