Fully initialize NEWTEXTMETRICEXW structure for bitmap fonts.
This commit is contained in:
parent
7cb43c9dbe
commit
2b98f3255f
|
@ -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,
|
||||||
if(!(ptm->tmPitchAndFamily & TMPF_VECTOR))
|
if(!(ptm->tmPitchAndFamily & TMPF_VECTOR))
|
||||||
*ptype |= RASTER_FONTTYPE;
|
*ptype |= RASTER_FONTTYPE;
|
||||||
|
|
||||||
|
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.ntmCellHeight = pntm->ntmTm.tmHeight;
|
||||||
|
pntm->ntmTm.ntmAvgWidth = pntm->ntmTm.tmAveCharWidth;
|
||||||
|
memset(&pntm->ntmFontSig, 0, sizeof(FONTSIGNATURE));
|
||||||
|
|
||||||
if(potm) {
|
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.ntmSizeEM = potm->otmEMSquare;
|
pntm->ntmTm.ntmSizeEM = potm->otmEMSquare;
|
||||||
pntm->ntmTm.ntmCellHeight = 0;
|
|
||||||
pntm->ntmTm.ntmAvgWidth = 0;
|
|
||||||
|
|
||||||
memset(&pntm->ntmFontSig, 0, sizeof(FONTSIGNATURE));
|
|
||||||
|
|
||||||
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,
|
||||||
(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,
|
||||||
|
|
||||||
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;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************************************************
|
/*************************************************************
|
||||||
|
|
Loading…
Reference in New Issue