Commit 629ba192 authored by Akihiro Sagawa's avatar Akihiro Sagawa Committed by Alexandre Julliard

gdi32: Get rid of redundant ntmCellHeight member.

parent 837c4f4b
......@@ -2714,10 +2714,12 @@ static BOOL get_face_enum_data( struct gdi_font_face *face, ENUMLOGFONTEXW *elf,
if (font_funcs->set_outline_text_metrics( font ))
{
static const DWORD ntm_ppem = 32;
UINT cell_height;
#define TM font->otm.otmTextMetrics
#define SCALE_NTM(value) (MulDiv( ntm->ntmTm.tmHeight, (value), TM.tmHeight ))
ntm->ntmTm.tmHeight = MulDiv( ntm_ppem, font->ntmCellHeight, font->otm.otmEMSquare );
cell_height = TM.tmHeight / ( -lf.lfHeight / font->otm.otmEMSquare );
ntm->ntmTm.tmHeight = MulDiv( ntm_ppem, cell_height, font->otm.otmEMSquare );
ntm->ntmTm.tmAscent = SCALE_NTM( TM.tmAscent );
ntm->ntmTm.tmDescent = ntm->ntmTm.tmHeight - ntm->ntmTm.tmAscent;
ntm->ntmTm.tmInternalLeading = SCALE_NTM( TM.tmInternalLeading );
......@@ -2729,7 +2731,7 @@ static BOOL get_face_enum_data( struct gdi_font_face *face, ENUMLOGFONTEXW *elf,
(const char *)&TM + offsetof( TEXTMETRICW, tmWeight ),
sizeof(TEXTMETRICW) - offsetof( TEXTMETRICW, tmWeight ));
ntm->ntmTm.ntmSizeEM = font->otm.otmEMSquare;
ntm->ntmTm.ntmCellHeight = font->ntmCellHeight;
ntm->ntmTm.ntmCellHeight = cell_height;
ntm->ntmTm.ntmAvgWidth = font->ntmAvgWidth;
#undef SCALE_NTM
#undef TM
......
......@@ -3775,7 +3775,6 @@ static BOOL CDECL freetype_set_outline_text_metrics( struct gdi_font *font )
descent = windescent;
}
font->ntmCellHeight = ascent + descent;
font->ntmAvgWidth = pOS2->xAvgCharWidth;
#define SCALE_X(x) (pFT_MulFix(x, em_scale))
......
......@@ -344,7 +344,6 @@ struct gdi_font
SHORT yMax;
SHORT yMin;
UINT ntmFlags;
UINT ntmCellHeight;
UINT ntmAvgWidth;
UINT aa_flags;
ULONG ttc_item_offset; /* 0 if font is not a part of TrueType collection */
......
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