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