https://git.reactos.org/?p=reactos.git;a=commitdiff;h=9835710f7e9ef9b9c273d…
commit 9835710f7e9ef9b9c273d0213ea630b97392689d
Author: Joachim Henze <Joachim.Henze(a)reactos.org>
AuthorDate: Tue Sep 1 19:11:22 2020 +0200
Commit: Joachim Henze <Joachim.Henze(a)reactos.org>
CommitDate: Tue Sep 1 19:11:22 2020 +0200
[GDI] Demote the insane amount of logging CORE-1091
that was introduced by
0.4.15-dev-684-g
448bcede24b2f8384c35656019622eb0ff5379d2
---
win32ss/gdi/ntgdi/text.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/win32ss/gdi/ntgdi/text.c b/win32ss/gdi/ntgdi/text.c
index 3761dd8f3e0..8de0855558e 100644
--- a/win32ss/gdi/ntgdi/text.c
+++ b/win32ss/gdi/ntgdi/text.c
@@ -41,7 +41,7 @@ IntTMWFixUp(
* to a TrueType one when we have a 'Raster' font as our input we filter
* out the problematic TrueType and Vector bits.
* Our list below checks for Raster Font Facenames. */
- DPRINT1("Font Facename is '%S'.\n", lf.lfFaceName);
+ DPRINT("Font Facename is '%S'.\n", lf.lfFaceName);
if ((wcsicmp(lf.lfFaceName, L"Helv") == 0) ||
(wcsicmp(lf.lfFaceName, L"Courier") == 0) ||
(wcsicmp(lf.lfFaceName, L"MS Sans Serif") == 0) ||
https://git.reactos.org/?p=reactos.git;a=commitdiff;h=448bcede24b2f8384c356…
commit 448bcede24b2f8384c35656019622eb0ff5379d2
Author: Doug Lyons <douglyons(a)douglyons.com>
AuthorDate: Tue Sep 1 06:08:26 2020 -0500
Commit: GitHub <noreply(a)github.com>
CommitDate: Tue Sep 1 20:08:26 2020 +0900
[GDI32] Preserve PitchAndFamily across GetTextMetricsW call (#2689)
ReactOS has no Raster fonts today, so compensate for this affecting the editbox margins.
CORE-1091
This patch fixes the inability to see all of the characters in the CD-KEY box of Starcraft and Visual Basic 5 and Visual Basic 6 Installs. It supersedes #2656
---
win32ss/gdi/ntgdi/text.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
1 file changed, 44 insertions(+)
diff --git a/win32ss/gdi/ntgdi/text.c b/win32ss/gdi/ntgdi/text.c
index 2ea694103ae..3761dd8f3e0 100644
--- a/win32ss/gdi/ntgdi/text.c
+++ b/win32ss/gdi/ntgdi/text.c
@@ -13,6 +13,48 @@
#define NDEBUG
#include <debug.h>
+
+/*
+ This is a hack. See CORE-1091.
+
+ It is needed because ReactOS does not support raster fonts now.
+ After Raster Font support is added, then it can be removed.
+ Find the current font's logfont for testing its lf.lfFaceName.
+
+ The ftGdiGetTextMetricsW function currently in ReactOS will always return a Truetype font
+ because we cannot yet handle raster fonts. So it will return flags
+ TMPF_VECTOR and TMPF_TRUETYPE, which can cause problems in edit boxes.
+ */
+
+VOID FASTCALL
+IntTMWFixUp(
+ HDC hDC,
+ TMW_INTERNAL *ptm)
+{
+ LOGFONTW lf;
+ HFONT hCurrentFont;
+
+ hCurrentFont = NtGdiGetDCObject(hDC, GDI_OBJECT_TYPE_FONT);
+ GreGetObject(hCurrentFont, sizeof(LOGFONTW), &lf);
+
+ /* To compensate for the GetTextMetricsW call changing the PitchAndFamily
+ * to a TrueType one when we have a 'Raster' font as our input we filter
+ * out the problematic TrueType and Vector bits.
+ * Our list below checks for Raster Font Facenames. */
+ DPRINT1("Font Facename is '%S'.\n", lf.lfFaceName);
+ if ((wcsicmp(lf.lfFaceName, L"Helv") == 0) ||
+ (wcsicmp(lf.lfFaceName, L"Courier") == 0) ||
+ (wcsicmp(lf.lfFaceName, L"MS Sans Serif") == 0) ||
+ (wcsicmp(lf.lfFaceName, L"MS Serif") == 0) ||
+ (wcsicmp(lf.lfFaceName, L"Times New Roman") == 0) ||
+ (wcsicmp(lf.lfFaceName, L"MS Shell Dlg") == 0) ||
+ (wcsicmp(lf.lfFaceName, L"System") == 0) ||
+ (wcsicmp(lf.lfFaceName, L"Terminal") == 0))
+ {
+ ptm->TextMetric.tmPitchAndFamily &= ~(TMPF_TRUETYPE | TMPF_VECTOR);
+ }
+}
+
/** Functions *****************************************************************/
BOOL FASTCALL
@@ -154,6 +196,7 @@ GreGetTextMetricsW(
{
TMW_INTERNAL tmwi;
if (!ftGdiGetTextMetricsW(hdc, &tmwi)) return FALSE;
+ IntTMWFixUp(hdc, &tmwi);
*lptm = tmwi.TextMetric;
return TRUE;
}
@@ -555,6 +598,7 @@ NtGdiGetTextMetricsW(
{
if (ftGdiGetTextMetricsW(hDC, &Tmwi))
{
+ IntTMWFixUp(hDC, &Tmwi);
_SEH2_TRY
{
ProbeForWrite(pUnsafeTmwi, cj, 1);