6768{
6769
6770
6771
6772
6773
6774
6776 SURFOBJ *SurfObj, *SourceGlyphSurf;
6781 LONGLONG X64, Y64, RealXStart64, RealYStart64, DeltaX64, DeltaY64;
6783 RECTL DestRect, MaskRect;
6794 BOOL use_kerning, bResult, DoBreak;
6799 const DWORD del = 0x7f, nbsp = 0xa0;
6802
6803
6805 {
6808 }
6809
6811 {
6813 XStart, YStart,
6814 fuOptions,
6817 Dx);
6818 }
6819
6821
6822 if (!
dc->dclevel.pSurface)
6823 {
6824
6827 }
6828
6829 pdcattr =
dc->pdcattr;
6831 {
6834 }
6835 else
6836 {
6839 }
6840
6844
6847
6848 psurf =
dc->dclevel.pSurface;
6850
6853 else
6855
6858
6860 {
6866 }
6867
6869 {
6873 &
dc->eboBackground.BrushObject);
6874 fuOptions &= ~ETO_OPAQUE;
6875 }
6876 else
6877 {
6879 {
6881 }
6882 }
6883
6885 if (TextObj ==
NULL)
6886 {
6889 }
6890
6891 FontObj = TextObj->
Font;
6895
6898
6904
6907 else
6909
6911 {
6915 }
6916
6918
6919
6922 else
6924
6925
6929
6930
6931 bNoTransform = ((
mat.xy == 0) && (
mat.yx == 0) &&
6932 (
mat.xx == (1 << 16)) && (
mat.yy == (1 << 16)));
6933
6934
6936 vecAscent64.
y = (FontGDI->
tmAscent << 6);
6941
6942
6943#define VALIGN_MASK (TA_TOP | TA_BASELINE | TA_BOTTOM)
6945 {
6947 }
6949 {
6950 RealXStart64 -= vecDescent64.
x;
6951 RealYStart64 += vecDescent64.
y;
6952 }
6953 else
6954 {
6955 RealXStart64 -= vecAscent64.
x;
6956 RealYStart64 += vecAscent64.
y;
6957 }
6958#undef VALIGN_MASK
6959
6961
6962
6964 {
6966 fuOptions, bNoTransform, &Chain))
6967 {
6972 }
6973
6974
6976 {
6977 RealXStart64 -= DeltaX64 / 2;
6978 RealYStart64 -= DeltaY64 / 2;
6979 }
6981 {
6982 RealXStart64 -= DeltaX64;
6983 RealYStart64 -= DeltaY64;
6984 }
6985
6986
6988 {
6989 INT X0 = (RealXStart64 + vecAscent64.
x + 32) >> 6;
6990 INT Y0 = (RealYStart64 - vecAscent64.
y + 32) >> 6;
6991 INT DX = (DeltaX64 >> 6);
6992 if (
Cache.Hashed.matTransform.xy == 0 &&
Cache.Hashed.matTransform.yx == 0)
6993 {
6994 INT CY = (vecAscent64.
y - vecDescent64.
y + 32) >> 6;
6996 }
6997 else
6998 {
6999 INT DY = (DeltaY64 >> 6);
7000 INT X1 = ((RealXStart64 + vecDescent64.
x + 32) >> 6);
7001 INT Y1 = ((RealYStart64 - vecDescent64.
y + 32) >> 6);
7003 {
7004 { X0, Y0 },
7005 { X0 +
DX, Y0 + DY },
7006 { X1 +
DX, Y1 + DY },
7007 { X1, Y1 },
7008 };
7010 }
7011 }
7012 }
7013
7016
7019
7020
7021
7022
7023 X64 = RealXStart64;
7024 Y64 = RealYStart64;
7025 previous = 0;
7029 {
7032 {
7035 break;
7036
7040 }
7041
7043 (fuOptions & ETO_GLYPH_INDEX));
7044 Cache.Hashed.GlyphIndex = glyph_index;
7045
7047 if (!realglyph)
7048 {
7050 break;
7051 }
7052
7053
7054 if (use_kerning && previous && glyph_index &&
NULL == Dx)
7055 {
7059 }
7060
7061 DPRINT(
"X64, Y64: %I64d, %I64d\n", X64, Y64);
7063
7066
7067
7068 if (ch0 >
L' ' && ch0 !=
del && ch0 != nbsp && bitSize.
cx == 0)
7069 DPRINT1(
"WARNING: WChar 0x%04x has a bitSize.cx of zero\n", ch0);
7070
7071
7072
7074 (ch0 ==
L' ' || ch0 == nbsp))
7075 {
7077
7080 bitSize.
cx = spaceWidth.
cx;
7081 realglyph->
left = 0;
7082 }
7083
7086
7087 DestRect.
left = ((X64 + 32) >> 6) + realglyph->
left;
7089 DestRect.
top = ((Y64 + 32) >> 6) - realglyph->
top;
7091
7092
7093 if ((bitSize.
cx != 0) && (bitSize.
cy != 0))
7094 {
7095
7096
7097
7098
7099
7103 if (!HSourceGlyph)
7104 {
7105 DPRINT1(
"WARNING: EngCreateBitmap() failed!\n");
7107 break;
7108 }
7109
7111 if (!SourceGlyphSurf)
7112 {
7114 DPRINT1(
"WARNING: EngLockSurface() failed!\n");
7116 break;
7117 }
7118
7119
7120
7121
7122
7124 {
7125
7126
7127
7129 {
7132 }
7133
7135 {
7137 }
7138 }
7139
7141 SourceGlyphSurf,
7145 &DestRect,
7147 &
dc->eboText.BrushObject,
7149 {
7150 DPRINT1(
"Failed to MaskBlt a glyph!\n");
7151 }
7152
7155 }
7156
7157 if (DoBreak)
7158 break;
7159
7161 {
7164 }
7166 {
7167 vec.
x = (Dx[2 *
i + 0] << 6);
7168 vec.
y = (Dx[2 *
i + 1] << 6);
7169 if (!bNoTransform)
7173 }
7174 else
7175 {
7176 vec.
x = (Dx[
i] << 6);
7178 if (!bNoTransform)
7182 }
7183
7184 DPRINT(
"New X64, New Y64: %I64d, %I64d\n", X64, Y64);
7185
7186 previous = glyph_index;
7187 }
7188
7191
7193 {
7194
7197
7198 DeltaX64 = X64 - RealXStart64;
7199 DeltaY64 = Y64 - RealYStart64;
7200
7201 if (!
face->units_per_EM)
7202 {
7204 thickness = 1;
7205 }
7206 else
7207 {
7209 face->underline_position *
face->size->metrics.y_ppem /
face->units_per_EM;
7210 thickness =
7211 face->underline_thickness *
face->size->metrics.y_ppem /
face->units_per_EM;
7212 if (thickness <= 0)
7213 thickness = 1;
7214 }
7215
7217 {
7221 vecB64.
y = vecA64.
y + (thickness << 6);
7224 {
7225 INT X0 = (RealXStart64 - vecA64.
x + 32) >> 6;
7226 INT Y0 = (RealYStart64 + vecA64.
y + 32) >> 6;
7227 INT DX = (DeltaX64 >> 6);
7228 if (
Cache.Hashed.matTransform.xy == 0 &&
Cache.Hashed.matTransform.yx == 0)
7229 {
7230 INT CY = (vecB64.
y - vecA64.
y + 32) >> 6;
7232 }
7233 else
7234 {
7235 INT DY = (DeltaY64 >> 6);
7236 INT X1 = X0 + ((vecA64.
x - vecB64.
x + 32) >> 6);
7237 INT Y1 = Y0 + ((vecB64.
y - vecA64.
y + 32) >> 6);
7239 {
7240 { X0, Y0 },
7241 { X0 +
DX, Y0 + DY },
7242 { X1 +
DX, Y1 + DY },
7243 { X1, Y1 },
7244 };
7246 }
7247 }
7248 }
7249
7251 {
7253 vecA64.
y = -(FontGDI->
tmAscent << 6) / 3;
7255 vecB64.
y = vecA64.
y + (thickness << 6);
7258 {
7259 INT X0 = (RealXStart64 - vecA64.
x + 32) >> 6;
7260 INT Y0 = (RealYStart64 + vecA64.
y + 32) >> 6;
7261 INT DX = (DeltaX64 >> 6);
7262 if (
Cache.Hashed.matTransform.xy == 0 &&
Cache.Hashed.matTransform.yx == 0)
7263 {
7264 INT CY = (vecB64.
y - vecA64.
y + 32) >> 6;
7266 }
7267 else
7268 {
7269 INT DY = (DeltaY64 >> 6);
7270 INT X1 = X0 + ((vecA64.
x - vecB64.
x + 32) >> 6);
7271 INT Y1 = Y0 + ((vecB64.
y - vecA64.
y + 32) >> 6);
7273 {
7274 { X0, Y0 },
7275 { X0 +
DX, Y0 + DY },
7276 { X1 +
DX, Y1 + DY },
7277 { X1, Y1 },
7278 };
7280 }
7281 }
7282 }
7283 }
7284
7286
7288
7291
7294
7295 if (TextObj !=
NULL)
7297
7298 return bResult;
7299}
static VOID del(LPHIST_ENTRY item)
FORCEINLINE PMATRIX DC_pmxWorldToDevice(PDC pdc)
static BOOLEAN IntLPtoDP(DC *pdc, PPOINTL ppt, UINT count)
VOID FASTCALL DC_vPrepareDCsForBlit(PDC pdcDest, const RECT *rcDest, PDC pdcSrc, const RECT *rcSrc)
VOID FASTCALL DC_vFinishBlit(PDC pdc1, PDC pdc2)
#define ERROR_INVALID_PARAMETER
static const WCHAR Cleanup[]
#define ObjToGDI(ClipObj, Type)
BOOL FASTCALL TextIntUpdateSize(PDC dc, PTEXTOBJ TextObj, PFONTGDI FontGDI, BOOL bDoLock)
VOID APIENTRY IntEngFillPolygon(IN OUT PDC dc, IN POINTL *pPoints, IN UINT cPoints, IN BRUSHOBJ *BrushObj)
static UINT FontLink_Chain_FindGlyph(_Inout_ PFONTLINK_CHAIN pChain, _Out_ PFONT_CACHE_ENTRY pCache, _Inout_ FT_Face *pFace, _In_ UINT code, _In_ BOOL fCodeAsIndex)
#define IS_HIGH_SURROGATE(ch0)
BOOL FASTCALL TextIntGetTextExtentPoint(PDC dc, PTEXTOBJ TextObj, LPCWSTR String, INT Count, ULONG MaxExtent, LPINT Fit, LPINT Dx, LPSIZE Size, FLONG fl)
static DWORD Utf32FromSurrogatePair(DWORD ch0, DWORD ch1)
#define IS_LOW_SURROGATE(ch1)
#define IntUnLockFreeType()
static VOID FASTCALL IntMatrixFromMx(FT_Matrix *pmat, const MATRIX *pmx)
static VOID FASTCALL IntEscapeMatrix(FT_Matrix *pmat, LONG lfEscapement)
#define IntLockFreeType()
#define EMUBOLD_NEEDED(original, request)
static const FT_Matrix identityMat
static FT_BitmapGlyph IntGetRealGlyph(IN OUT PFONT_CACHE_ENTRY Cache)
BOOL FASTCALL IntIsFontRenderingEnabled(VOID)
#define gmxWorldToDeviceDefault
static VOID FontLink_Chain_Finish(_Inout_ PFONTLINK_CHAIN pChain)
static VOID FontLink_Chain_Init(_Out_ PFONTLINK_CHAIN pChain, _Inout_ PTEXTOBJ pTextObj, _In_ FT_Face face)
FT_Render_Mode FASTCALL IntGetFontRenderMode(LOGFONTW *logfont)
static BOOL IntGetTextDisposition(OUT LONGLONG *pX64, OUT LONGLONG *pY64, IN LPCWSTR String, IN INT Count, IN OPTIONAL LPINT Dx, IN OUT PFONT_CACHE_ENTRY Cache, IN UINT fuOptions, IN BOOL bNoTransform, IN OUT PFONTLINK_CHAIN pChain)
VOID FASTCALL IntEngFillBox(IN OUT PDC dc, IN INT X, IN INT Y, IN INT Width, IN INT Height, IN BRUSHOBJ *BrushObj)
FT_Set_Transform(FT_Face face, FT_Matrix *matrix, FT_Vector *delta)
FT_Vector_Transform(FT_Vector *vec, const FT_Matrix *matrix)
#define FT_IS_SCALABLE(face)
FT_Get_Kerning(FT_Face face, FT_UInt left_glyph, FT_UInt right_glyph, FT_UInt kern_mode, FT_Vector *akerning)
#define FT_HAS_KERNING(face)
FT_Matrix_Multiply(const FT_Matrix *a, FT_Matrix *b)
GLenum GLuint GLint GLenum face
#define PATH_IsPathOpen(dclevel)
struct _PALETTE *const ppal
ENUMLOGFONTEXW elfEnumLogfontEx
T1_FIELD_DICT_FONTDICT T1_FIELD_DICT_FONTDICT T1_FIELD_DICT_FONTDICT underline_position
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
BOOL APIENTRY IntEngMaskBlt(_Inout_ SURFOBJ *psoDest, _In_ SURFOBJ *psoMask, _In_ CLIPOBJ *pco, _In_ XLATEOBJ *pxloDest, _In_ XLATEOBJ *pxloSource, _In_ RECTL *prclDest, _In_ POINTL *pptlMask, _In_ BRUSHOBJ *pbo, _In_ POINTL *pptlBrushOrg)
PTEXTOBJ FASTCALL RealizeFontInit(HFONT hFont)
BOOL FASTCALL PATH_ExtTextOut(PDC dc, INT x, INT y, UINT flags, const RECTL *lprc, LPCWSTR str, UINT count, const INT *dx)
FORCEINLINE VOID TEXTOBJ_UnlockText(PLFONT plfnt)
ENGAPI BOOL APIENTRY EngDeleteSurface(_In_ _Post_ptr_invalid_ HSURF hsurf)
ENGAPI SURFOBJ *APIENTRY EngLockSurface(_In_ HSURF hsurf)
ENGAPI HBITMAP APIENTRY EngCreateBitmap(_In_ SIZEL sizl, _In_ LONG lWidth, _In_ ULONG iFormat, _In_ FLONG fl, _In_opt_ PVOID pvBits)
typedef HSURF(APIENTRY FN_DrvEnableSurface)(_In_ DHPDEV dhpdev)
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
ENGAPI VOID APIENTRY EngUnlockSurface(_In_ _Post_ptr_invalid_ SURFOBJ *pso)
VOID NTAPI EXLATEOBJ_vInitialize(_Out_ PEXLATEOBJ pexlo, _In_opt_ PALETTE *ppalSrc, _In_opt_ PALETTE *ppalDst, _In_ COLORREF crSrcBackColor, _In_ COLORREF crDstBackColor, _In_ COLORREF crDstForeColor)
VOID NTAPI EXLATEOBJ_vCleanup(_Inout_ PEXLATEOBJ pexlo)