https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ebfb62b420009fc3a827f…
commit ebfb62b420009fc3a827f41d3534f9c3ba995e3e
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Nov 21 17:01:25 2019 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Thu Nov 21 17:01:25 2019 +0900
[NTGDI][FONT] Delete FillTMEx function and simplify codes
---
win32ss/gdi/ntgdi/freetype.c | 67 +++++++++++---------------------------------
1 file changed, 16 insertions(+), 51 deletions(-)
diff --git a/win32ss/gdi/ntgdi/freetype.c b/win32ss/gdi/ntgdi/freetype.c
index 31bbf37fc7b..7ddf52fca1f 100644
--- a/win32ss/gdi/ntgdi/freetype.c
+++ b/win32ss/gdi/ntgdi/freetype.c
@@ -2234,9 +2234,9 @@ static BOOL face_has_symbol_charmap(FT_Face ft_face)
}
static void FASTCALL
-FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
- TT_OS2 *pOS2, TT_HoriHeader *pHori,
- FT_WinFNT_HeaderRec *pFNT, BOOL RealFont)
+FillTM(TEXTMETRICW *TM, PFONTGDI FontGDI,
+ TT_OS2 *pOS2, TT_HoriHeader *pHori,
+ FT_WinFNT_HeaderRec *pFNT)
{
FT_Fixed XScale, YScale;
int Ascent, Descent;
@@ -2264,22 +2264,11 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
TM->tmDefaultChar = pFNT->default_char + pFNT->first_char;
TM->tmBreakChar = pFNT->break_char + pFNT->first_char;
TM->tmPitchAndFamily = pFNT->pitch_and_family;
- if (RealFont)
- {
- TM->tmWeight = FontGDI->OriginalWeight;
- TM->tmItalic = FontGDI->OriginalItalic;
- TM->tmUnderlined = pFNT->underline;
- 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;
- }
+ TM->tmWeight = FontGDI->RequestWeight;
+ TM->tmItalic = FontGDI->RequestItalic;
+ TM->tmUnderlined = FontGDI->RequestUnderline;
+ TM->tmStruckOut = FontGDI->RequestStrikeOut;
+ TM->tmCharSet = FontGDI->CharSet;
return;
}
@@ -2316,21 +2305,14 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
/* Correct forumla to get the maxcharwidth from unicode and ansi font */
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;
}
else
{
- if (FontGDI->OriginalWeight != FW_DONTCARE &&
- FontGDI->OriginalWeight != FW_NORMAL)
- {
- TM->tmWeight = FontGDI->OriginalWeight;
- }
- else
- {
- TM->tmWeight = FontGDI->RequestWeight;
- }
+ TM->tmWeight = FontGDI->RequestWeight;
}
TM->tmOverhang = 0;
@@ -2368,25 +2350,16 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
TM->tmDefaultChar = TM->tmBreakChar - 1;
}
- if (RealFont)
+ if (FontGDI->OriginalItalic || FontGDI->RequestItalic)
{
- TM->tmItalic = FontGDI->OriginalItalic;
- TM->tmUnderlined = FALSE;
- TM->tmStruckOut = FALSE;
+ TM->tmItalic = 0xFF;
}
else
{
- if (FontGDI->OriginalItalic || FontGDI->RequestItalic)
- {
- TM->tmItalic = 0xFF;
- }
- else
- {
- TM->tmItalic = 0;
- }
- TM->tmUnderlined = (FontGDI->RequestUnderline ? 0xFF : 0);
- TM->tmStruckOut = (FontGDI->RequestStrikeOut ? 0xFF : 0);
+ TM->tmItalic = 0;
}
+ TM->tmUnderlined = (FontGDI->RequestUnderline ? 0xFF : 0);
+ TM->tmStruckOut = (FontGDI->RequestStrikeOut ? 0xFF : 0);
if (!FT_IS_FIXED_WIDTH(Face))
{
@@ -2471,14 +2444,6 @@ FillTMEx(TEXTMETRICW *TM, PFONTGDI FontGDI,
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
IntGetFontLocalizedName(PUNICODE_STRING pNameW, PSHARED_FACE SharedFace,
FT_UShort NameID, FT_UShort LangID);