From eec01270c06f2e7b1fdf37709ee79fad53c091f1 Mon Sep 17 00:00:00 2001 From: Piotr Caban Date: Mon, 1 May 2023 12:25:23 +0200 Subject: [PATCH] wineps: Use only TrueType fonts in print processor. --- dlls/wineps.drv/printproc.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dlls/wineps.drv/printproc.c b/dlls/wineps.drv/printproc.c index 9786f5f83df..39a46f8d6c3 100644 --- a/dlls/wineps.drv/printproc.c +++ b/dlls/wineps.drv/printproc.c @@ -185,8 +185,21 @@ static BOOL CDECL font_GetTextMetrics(PHYSDEV dev, TEXTMETRICW *metrics) static HFONT CDECL font_SelectFont(PHYSDEV dev, HFONT hfont, UINT *aa_flags) { + HFONT tt_font, old_font; + LOGFONTW lf; + *aa_flags = GGO_BITMAP; - return SelectObject(dev->hdc, hfont) ? hfont : 0; + if (!GetObjectW(hfont, sizeof(lf), &lf)) + return 0; + + lf.lfOutPrecision = OUT_TT_ONLY_PRECIS; + tt_font = CreateFontIndirectW(&lf); + if (!tt_font) + return 0; + + old_font = SelectObject(dev->hdc, tt_font); + DeleteObject(tt_font); + return old_font ? hfont : 0; } static const struct gdi_dc_funcs font_funcs = -- 2.11.4.GIT