Commit 2b98f325 authored by Dmitry Timoshkov's avatar Dmitry Timoshkov Committed by Alexandre Julliard

Fully initialize NEWTEXTMETRICEXW structure for bitmap fonts.

parent 7cb43c9d
......@@ -126,7 +126,7 @@ typedef struct
*/
#define FS(x) {{0,0,0,0},{0x1<<(x),0}}
#define MAXTCIINDEX 32
static CHARSETINFO FONT_tci[MAXTCIINDEX] = {
static const CHARSETINFO FONT_tci[MAXTCIINDEX] = {
/* ANSI */
{ ANSI_CHARSET, 1252, FS(0)},
{ EASTEUROPE_CHARSET, 1250, FS(1)},
......
......@@ -2032,16 +2032,16 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
if(!(ptm->tmPitchAndFamily & TMPF_VECTOR))
*ptype |= RASTER_FONTTYPE;
if(potm) {
pntm->ntmTm.ntmFlags = ptm->tmItalic ? NTM_ITALIC : 0;
if(ptm->tmWeight > 550) pntm->ntmTm.ntmFlags |= NTM_BOLD;
if(pntm->ntmTm.ntmFlags == 0) pntm->ntmTm.ntmFlags = NTM_REGULAR;
pntm->ntmTm.ntmFlags = ptm->tmItalic ? NTM_ITALIC : 0;
if(ptm->tmWeight > 550) pntm->ntmTm.ntmFlags |= NTM_BOLD;
if(pntm->ntmTm.ntmFlags == 0) pntm->ntmTm.ntmFlags = NTM_REGULAR;
pntm->ntmTm.ntmSizeEM = potm->otmEMSquare;
pntm->ntmTm.ntmCellHeight = 0;
pntm->ntmTm.ntmAvgWidth = 0;
pntm->ntmTm.ntmCellHeight = pntm->ntmTm.tmHeight;
pntm->ntmTm.ntmAvgWidth = pntm->ntmTm.tmAveCharWidth;
memset(&pntm->ntmFontSig, 0, sizeof(FONTSIGNATURE));
memset(&pntm->ntmFontSig, 0, sizeof(FONTSIGNATURE));
if(potm) {
pntm->ntmTm.ntmSizeEM = potm->otmEMSquare;
strncpyW(pelf->elfLogFont.lfFaceName,
(WCHAR*)((char*)potm + (ptrdiff_t)potm->otmpFamilyName),
......@@ -2053,7 +2053,10 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
(WCHAR*)((char*)potm + (ptrdiff_t)potm->otmpStyleName),
LF_FACESIZE);
HeapFree(GetProcessHeap(), 0, potm);
} else {
pntm->ntmTm.ntmSizeEM = pntm->ntmTm.tmHeight - pntm->ntmTm.tmInternalLeading;
strncpyW(pelf->elfLogFont.lfFaceName, face->family->FamilyName, LF_FACESIZE);
strncpyW(pelf->elfFullName, face->family->FamilyName, LF_FACESIZE);
pelf->elfStyle[0] = '\0';
......@@ -2061,9 +2064,7 @@ static void GetEnumStructs(Face *face, LPENUMLOGFONTEXW pelf,
pelf->elfScript[0] = '\0'; /* This will get set in WineEngEnumFonts */
HeapFree(GetProcessHeap(), 0, potm);
free_font(font);
return;
}
/*************************************************************
......
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