mirror of
https://github.com/reactos/reactos.git
synced 2025-05-30 22:49:12 +00:00
[NTGDI][FONT] Delete FillTMEx function and simplify codes
This commit is contained in:
parent
6f2662688b
commit
ebfb62b420
1 changed files with 16 additions and 51 deletions
|
@ -2234,9 +2234,9 @@ static BOOL face_has_symbol_charmap(FT_Face ft_face)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FASTCALL
|
static void FASTCALL
|
||||||
FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
|
FillTM(TEXTMETRICW *TM, PFONTGDI FontGDI,
|
||||||
TT_OS2 *pOS2, TT_HoriHeader *pHori,
|
TT_OS2 *pOS2, TT_HoriHeader *pHori,
|
||||||
FT_WinFNT_HeaderRec *pFNT, BOOL RealFont)
|
FT_WinFNT_HeaderRec *pFNT)
|
||||||
{
|
{
|
||||||
FT_Fixed XScale, YScale;
|
FT_Fixed XScale, YScale;
|
||||||
int Ascent, Descent;
|
int Ascent, Descent;
|
||||||
|
@ -2264,22 +2264,11 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
|
||||||
TM->tmDefaultChar = pFNT->default_char + pFNT->first_char;
|
TM->tmDefaultChar = pFNT->default_char + pFNT->first_char;
|
||||||
TM->tmBreakChar = pFNT->break_char + pFNT->first_char;
|
TM->tmBreakChar = pFNT->break_char + pFNT->first_char;
|
||||||
TM->tmPitchAndFamily = pFNT->pitch_and_family;
|
TM->tmPitchAndFamily = pFNT->pitch_and_family;
|
||||||
if (RealFont)
|
TM->tmWeight = FontGDI->RequestWeight;
|
||||||
{
|
TM->tmItalic = FontGDI->RequestItalic;
|
||||||
TM->tmWeight = FontGDI->OriginalWeight;
|
TM->tmUnderlined = FontGDI->RequestUnderline;
|
||||||
TM->tmItalic = FontGDI->OriginalItalic;
|
TM->tmStruckOut = FontGDI->RequestStrikeOut;
|
||||||
TM->tmUnderlined = pFNT->underline;
|
TM->tmCharSet = FontGDI->CharSet;
|
||||||
TM->tmStruckOut = pFNT->strike_out;
|
|
||||||
TM->tmCharSet = pFNT->charset;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TM->tmWeight = FontGDI->RequestWeight;
|
|
||||||
TM->tmItalic = FontGDI->RequestItalic;
|
|
||||||
TM->tmUnderlined = FontGDI->RequestUnderline;
|
|
||||||
TM->tmStruckOut = FontGDI->RequestStrikeOut;
|
|
||||||
TM->tmCharSet = FontGDI->CharSet;
|
|
||||||
}
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2316,21 +2305,14 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
|
||||||
/* Correct forumla to get the maxcharwidth from unicode and ansi font */
|
/* Correct forumla to get the maxcharwidth from unicode and ansi font */
|
||||||
TM->tmMaxCharWidth = (FT_MulFix(Face->max_advance_width, XScale) + 32) >> 6;
|
TM->tmMaxCharWidth = (FT_MulFix(Face->max_advance_width, XScale) + 32) >> 6;
|
||||||
|
|
||||||
if (RealFont)
|
if (FontGDI->OriginalWeight != FW_DONTCARE &&
|
||||||
|
FontGDI->OriginalWeight != FW_NORMAL)
|
||||||
{
|
{
|
||||||
TM->tmWeight = FontGDI->OriginalWeight;
|
TM->tmWeight = FontGDI->OriginalWeight;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (FontGDI->OriginalWeight != FW_DONTCARE &&
|
TM->tmWeight = FontGDI->RequestWeight;
|
||||||
FontGDI->OriginalWeight != FW_NORMAL)
|
|
||||||
{
|
|
||||||
TM->tmWeight = FontGDI->OriginalWeight;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TM->tmWeight = FontGDI->RequestWeight;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TM->tmOverhang = 0;
|
TM->tmOverhang = 0;
|
||||||
|
@ -2368,25 +2350,16 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
|
||||||
TM->tmDefaultChar = TM->tmBreakChar - 1;
|
TM->tmDefaultChar = TM->tmBreakChar - 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (RealFont)
|
if (FontGDI->OriginalItalic || FontGDI->RequestItalic)
|
||||||
{
|
{
|
||||||
TM->tmItalic = FontGDI->OriginalItalic;
|
TM->tmItalic = 0xFF;
|
||||||
TM->tmUnderlined = FALSE;
|
|
||||||
TM->tmStruckOut = FALSE;
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (FontGDI->OriginalItalic || FontGDI->RequestItalic)
|
TM->tmItalic = 0;
|
||||||
{
|
|
||||||
TM->tmItalic = 0xFF;
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
TM->tmItalic = 0;
|
|
||||||
}
|
|
||||||
TM->tmUnderlined = (FontGDI->RequestUnderline ? 0xFF : 0);
|
|
||||||
TM->tmStruckOut = (FontGDI->RequestStrikeOut ? 0xFF : 0);
|
|
||||||
}
|
}
|
||||||
|
TM->tmUnderlined = (FontGDI->RequestUnderline ? 0xFF : 0);
|
||||||
|
TM->tmStruckOut = (FontGDI->RequestStrikeOut ? 0xFF : 0);
|
||||||
|
|
||||||
if (!FT_IS_FIXED_WIDTH(Face))
|
if (!FT_IS_FIXED_WIDTH(Face))
|
||||||
{
|
{
|
||||||
|
@ -2471,14 +2444,6 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
|
||||||
TM->tmCharSet = FontGDI->CharSet;
|
TM->tmCharSet = FontGDI->CharSet;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void FASTCALL
|
|
||||||
FillTM(TEXTMETRICW *TM, PFONTGDI FontGDI,
|
|
||||||
TT_OS2 *pOS2, TT_HoriHeader *pHori,
|
|
||||||
FT_WinFNT_HeaderRec *pFNT)
|
|
||||||
{
|
|
||||||
FillTMEx(TM, FontGDI, pOS2, pHori, pFNT, FALSE);
|
|
||||||
}
|
|
||||||
|
|
||||||
static NTSTATUS
|
static NTSTATUS
|
||||||
IntGetFontLocalizedName(PUNICODE_STRING pNameW, PSHARED_FACE SharedFace,
|
IntGetFontLocalizedName(PUNICODE_STRING pNameW, PSHARED_FACE SharedFace,
|
||||||
FT_UShort NameID, FT_UShort LangID);
|
FT_UShort NameID, FT_UShort LangID);
|
||||||
|
|
Loading…
Reference in a new issue