mirror of
https://github.com/reactos/reactos.git
synced 2025-06-03 16:30:26 +00:00
[FREETYPE] Fix WordPad ruler rendering (#7803)
Based on @Doug-Lyons's wordpad-ruler-fix-05.patch. JIRA issue: CORE-19870 In IntRequestFontSize function, if lfWidth < 10, then req.width = 0;. Co-authored-by: Doug Lyons <douglyons@douglyons.com>
This commit is contained in:
parent
7dc7b866b1
commit
27bb510282
1 changed files with 9 additions and 8 deletions
|
@ -4095,7 +4095,7 @@ IntRequestFontSize(PDC dc, PFONTGDI FontGDI, LONG lfWidth, LONG lfHeight)
|
||||||
TT_OS2 *pOS2;
|
TT_OS2 *pOS2;
|
||||||
TT_HoriHeader *pHori;
|
TT_HoriHeader *pHori;
|
||||||
FT_WinFNT_HeaderRec WinFNT;
|
FT_WinFNT_HeaderRec WinFNT;
|
||||||
LONG Ascent, Descent, Sum, EmHeight, Width64;
|
LONG Ascent, Descent, Sum, EmHeight;
|
||||||
|
|
||||||
lfWidth = abs(lfWidth);
|
lfWidth = abs(lfWidth);
|
||||||
if (lfHeight == 0)
|
if (lfHeight == 0)
|
||||||
|
@ -4205,20 +4205,21 @@ IntRequestFontSize(PDC dc, PFONTGDI FontGDI, LONG lfWidth, LONG lfHeight)
|
||||||
#if 1
|
#if 1
|
||||||
/* I think this is wrong implementation but its test result is better. */
|
/* I think this is wrong implementation but its test result is better. */
|
||||||
if (lfWidth != 0)
|
if (lfWidth != 0)
|
||||||
Width64 = FT_MulDiv(lfWidth, face->units_per_EM, pOS2->xAvgCharWidth) << 6;
|
req.width = FT_MulDiv(lfWidth, face->units_per_EM, pOS2->xAvgCharWidth) << 6;
|
||||||
else
|
|
||||||
Width64 = 0;
|
|
||||||
#else
|
#else
|
||||||
/* I think this is correct implementation but it is mismatching to the
|
/* I think this is correct implementation but it is mismatching to the
|
||||||
other metric functions. The test result is bad. */
|
other metric functions. The test result is bad. */
|
||||||
if (lfWidth != 0)
|
if (lfWidth != 0)
|
||||||
Width64 = (FT_MulDiv(lfWidth, 96 * 5, 72 * 3) << 6); /* ??? FIXME */
|
req.width = (FT_MulDiv(lfWidth, 96 * 5, 72 * 3) << 6); /* ??? FIXME */
|
||||||
else
|
|
||||||
Width64 = 0;
|
|
||||||
#endif
|
#endif
|
||||||
|
else
|
||||||
|
req.width = 0;
|
||||||
|
|
||||||
|
/* HACK: We do not handle small widths well, so just use zero for these. See CORE-19870. */
|
||||||
|
if (lfWidth < 10)
|
||||||
|
req.width = 0;
|
||||||
|
|
||||||
req.type = FT_SIZE_REQUEST_TYPE_NOMINAL;
|
req.type = FT_SIZE_REQUEST_TYPE_NOMINAL;
|
||||||
req.width = Width64;
|
|
||||||
req.height = (EmHeight << 6);
|
req.height = (EmHeight << 6);
|
||||||
req.horiResolution = 0;
|
req.horiResolution = 0;
|
||||||
req.vertResolution = 0;
|
req.vertResolution = 0;
|
||||||
|
|
Loading…
Reference in a new issue