Commit 56a41706 authored by Eric Pouech's avatar Eric Pouech Committed by Alexandre Julliard

winhelp: Setup a better font size for the richedit rendering.

parent bfa999ea
......@@ -1113,13 +1113,15 @@ static BOOL HLPFILE_BrowseParagraph(HLPFILE_PAGE* page, struct RtfData* rd, BYTE
case 0x80:
{
unsigned font = GET_USHORT(format, 1);
unsigned fs;
attributes.wFont = font;
WINE_TRACE("Changing font to %d\n", attributes.wFont);
format += 3;
fs = (4 * page->file->fonts[font].LogFont.lfHeight - 3) / 5;
/* FIXME: missing at least colors, also bold attribute looses information */
sprintf(tmp, "\\f%d\\cf%d\\fs%d%s%s%s%s",
font, font + 2,
-2 * page->file->fonts[font].LogFont.lfHeight,
font, font + 2, fs,
page->file->fonts[font].LogFont.lfWeight > 400 ? "\\b" : "\\b0",
page->file->fonts[font].LogFont.lfItalic ? "\\i" : "\\i0",
page->file->fonts[font].LogFont.lfUnderline ? "\\ul" : "\\ul0",
......@@ -1530,7 +1532,7 @@ static BOOL HLPFILE_ReadFont(HLPFILE* hlpfile)
flag = ref[dscr_offset + i * 11 + 0];
family = ref[dscr_offset + i * 11 + 2];
hlpfile->fonts[i].LogFont.lfHeight = -ref[dscr_offset + i * 11 + 1] / 2 - 3;
hlpfile->fonts[i].LogFont.lfHeight = ref[dscr_offset + i * 11 + 1];
hlpfile->fonts[i].LogFont.lfWidth = 0;
hlpfile->fonts[i].LogFont.lfEscapement = 0;
hlpfile->fonts[i].LogFont.lfOrientation = 0;
......
......@@ -1803,7 +1803,11 @@ static BOOL WINHELP_SplitLines(HWND hWnd, LPSIZE newsize)
HLPFILE* hlpfile = win->page->file;
if (!hlpfile->fonts[p->u.text.wFont].hFont)
hlpfile->fonts[p->u.text.wFont].hFont = CreateFontIndirect(&hlpfile->fonts[p->u.text.wFont].LogFont);
{
LOGFONT lf = hlpfile->fonts[p->u.text.wFont].LogFont;
lf.lfHeight = -lf.lfHeight / 2 - 3;
hlpfile->fonts[p->u.text.wFont].hFont = CreateFontIndirect(&lf);
}
hFont = hlpfile->fonts[p->u.text.wFont].hFont;
color = hlpfile->fonts[p->u.text.wFont].color;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment