Author: zguo Date: Wed Oct 29 16:03:21 2014 New Revision: 65101 URL: http://svn.reactos.org/svn/reactos?rev=65101&view=rev Log: [WIN32SS] Merge in workaround for freetype rendering issue.
CORE-8525, CORE-6023, CORE-7735 and CORE-8635 Modified: branches/0.3.17/reactos/ (props changed) branches/0.3.17/reactos/win32ss/gdi/ntgdi/freetype.c Propchange: branches/0.3.17/reactos/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Wed Oct 29 16:03:21 2014 @@ -18,4 +18,4 @@ /branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859 /branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567 /branches/wlan-bringup:54809-54998 -/trunk/reactos:64752-64754,64765,64769,64771,64776,64793,64800,64825,64829,64832-64833,64855-64856,64859,64908-64909,64976,65025-65028,65041 +/trunk/reactos:64752-64754,64765,64769,64771,64776-64777,64793,64800,64825,64829,64832-64833,64855-64856,64859,64908-64909,64976,65025-65028,65041 Modified: branches/0.3.17/reactos/win32ss/gdi/ntgdi/freetype.c URL: http://svn.reactos.org/svn/reactos/branches/0.3.17/reactos/win32ss/gdi/ntgdi/freetype.c?rev=65101&r1=65100&r2=65101&view=diff ============================================================================== --- branches/0.3.17/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] (original) +++ branches/0.3.17/reactos/win32ss/gdi/ntgdi/freetype.c [iso-8859-1] Wed Oct 29 16:03:21 2014 @@ -2664,15 +2664,42 @@ Status = RtlAnsiStringToUnicodeString(&EntryFaceNameW, &EntryFaceNameA, TRUE); if (NT_SUCCESS(Status)) { + static const UNICODE_STRING MarlettFaceNameW = RTL_CONSTANT_STRING(L"Marlett"); + static const UNICODE_STRING SymbolFaceNameW = RTL_CONSTANT_STRING(L"Symbol"); + static const UNICODE_STRING VGAFaceNameW = RTL_CONSTANT_STRING(L"VGA"); + if ((LF_FACESIZE - 1) * sizeof(WCHAR) < EntryFaceNameW.Length) { EntryFaceNameW.Length = (LF_FACESIZE - 1) * sizeof(WCHAR); EntryFaceNameW.Buffer[LF_FACESIZE - 1] = L'\0'; } - if (0 == RtlCompareUnicodeString(FaceName, &EntryFaceNameW, TRUE)) + + if (!RtlCompareUnicodeString(FaceName, &EntryFaceNameW, TRUE)) { Score += 49; } + + /* FIXME: this is a work around to counter weird fonts on weird places. + A proper fix would be to score fonts on more attributes than + the ones in this function */ + if (!RtlCompareUnicodeString(&MarlettFaceNameW, &EntryFaceNameW, TRUE) && + RtlCompareUnicodeString(&MarlettFaceNameW, FaceName, TRUE)) + { + Score = 0; + } + + if (!RtlCompareUnicodeString(&SymbolFaceNameW, &EntryFaceNameW, TRUE) && + RtlCompareUnicodeString(&SymbolFaceNameW, FaceName, TRUE)) + { + Score = 0; + } + + if (!RtlCompareUnicodeString(&VGAFaceNameW, &EntryFaceNameW, TRUE) && + RtlCompareUnicodeString(&VGAFaceNameW, FaceName, TRUE)) + { + Score = 0; + } + RtlFreeUnicodeString(&EntryFaceNameW); }