[PATCH v2 0/1] MR10358: comctl32:Add TrueType font support for vertically tab text.
Wine-Bug:https://bugs.winehq.org/show_bug.cgi?id=50582 -- v2: comctl32:Add TrueType font support for vertically tab text. https://gitlab.winehq.org/wine/wine/-/merge_requests/10358
From: Maotong Zhang <zmtong1988@gmail.com> Wine-Bug:https://bugs.winehq.org/show_bug.cgi?id=50582 --- dlls/comctl32/tab.c | 1 + 1 file changed, 1 insertion(+) diff --git a/dlls/comctl32/tab.c b/dlls/comctl32/tab.c index 352c4bf861d..dfb6985113a 100644 --- a/dlls/comctl32/tab.c +++ b/dlls/comctl32/tab.c @@ -1904,6 +1904,7 @@ TAB_DrawItemInterior(const TAB_INFO *infoPtr, HDC hdc, INT iItem, RECT *drawRect logfont.lfEscapement = nEscapement; logfont.lfOrientation = nOrientation; + logfont.lfOutPrecision = OUT_TT_ONLY_PRECIS; hFont = CreateFontIndirectW(&logfont); SelectObject(hdc, hFont); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/10358
Should rotation not work for non TT case? -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10358#note_132587
Yes. For non TT fonts, rotation usually doesn’t work. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/10358#note_132590
On Mon Mar 23 10:08:19 2026 +0000, Maotong Zhang wrote:
Yes. For non TT fonts, rotation usually doesn’t work. I tried drawing vertical text using the System font, which is a bitmap font on Windows. The text is drawn vertically. So maybe we should fix CreateFontIndirectA() or ExtTextOutW() instead.
case WM_PAINT:
{
PAINTSTRUCT ps;
HDC hdc;
RECT rect;
LOGFONTA logfont = { 0 };
HFONT old_font, font2;
hdc = wParam ? (HDC)wParam : BeginPaint( hwnd, &ps );
logfont.lfEscapement = 900;
logfont.lfOrientation = 900;
logfont.lfHeight = -12;
logfont.lfWeight = FW_NORMAL;
strcpy(logfont.lfFaceName, "System");
font2 = CreateFontIndirectA(&logfont);
SetRect(&rect, 50, 50, 100, 100);
old_font = SelectObject(hdc, font2);
ExtTextOutW(hdc, 50, 50, ETO_OPAQUE, &rect, L"12345", 5, 0);
SelectObject(hdc, old_font);
DeleteObject(font2);
if ( !wParam ) EndPaint( hwnd, &ps );
return 0;
}
--
https://gitlab.winehq.org/wine/wine/-/merge_requests/10358#note_133350
On Mon Mar 23 10:08:19 2026 +0000, Zhiyi Zhang wrote:
I tried drawing vertical text using the System font, which is a bitmap font on Windows. The text is drawn vertically. So maybe we should fix CreateFontIndirectA() or ExtTextOutW() instead. ```c case WM_PAINT: { PAINTSTRUCT ps; HDC hdc; RECT rect; LOGFONTA logfont = { 0 }; HFONT old_font, font2; hdc = wParam ? (HDC)wParam : BeginPaint( hwnd, &ps ); logfont.lfEscapement = 900; logfont.lfOrientation = 900; logfont.lfHeight = -12; logfont.lfWeight = FW_NORMAL; strcpy(logfont.lfFaceName, "System"); font2 = CreateFontIndirectA(&logfont); SetRect(&rect, 50, 50, 100, 100); old_font = SelectObject(hdc, font2); ExtTextOutW(hdc, 50, 50, ETO_OPAQUE, &rect, L"12345", 5, 0); SelectObject(hdc, old_font); DeleteObject(font2); if ( !wParam ) EndPaint( hwnd, &ps ); return 0; } I agree. Proposed fix looks more like a workaround, that can potentially select different font, if I understand it correctly.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10358#note_133351
On Mon Mar 23 10:12:57 2026 +0000, Nikolay Sivov wrote:
I agree. Proposed fix looks more like a workaround, that can potentially select different font, if I understand it correctly. Okay, I’ll test it.
-- https://gitlab.winehq.org/wine/wine/-/merge_requests/10358#note_133377
participants (4)
-
Maotong Zhang -
Maotong Zhang (@xiaotong) -
Nikolay Sivov (@nsivov) -
Zhiyi Zhang (@zhiyi)