ReactOS 0.4.16-dev-1041-g8b6907f
text.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _STRGDI
 
struct  _LFONT
 

Macros

#define TAG_FINF   'FNIF'
 
#define TO_MEM_ALLOCATED   0x0001
 
#define TO_ALL_PTRS_VALID   0x0002
 
#define TO_VALID   0x0004
 
#define TO_ESC_NOT_ORIENT   0x0008
 
#define TO_PWSZ_ALLOCATED   0x0010
 
#define TSIM_UNDERLINE1   0x0020
 
#define TSIM_UNDERLINE2   0x0040
 
#define TSIM_STRIKEOUT   0x0080
 
#define TO_HIGHRESTEXT   0x0100
 
#define TO_BITMAPS   0x0200
 
#define TO_PARTITION_INIT   0x0400
 
#define TO_ALLOC_FACENAME   0x0800
 
#define TO_SYS_PARTITION   0x1000
 
#define TEXTOBJECT_INIT   0x00010000
 
#define LFONT_AllocFontWithHandle()   ((PLFONT)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_FONT, sizeof(TEXTOBJ)))
 
#define LFONT_ShareLockFont(hfont)   (PLFONT)GDIOBJ_ReferenceObjectByHandle(hfont, GDIObjType_LFONT_TYPE)
 
#define LFONT_ShareUnlockFont(plfnt)   GDIOBJ_vDereferenceObject((POBJ)plfnt)
 
#define LFONT_UnlockFont(plfnt)   GDIOBJ_vUnlockObject((POBJ)plfnt)
 
#define AFRX_WRITE_REGISTRY   0x1
 
#define AFRX_ALTERNATIVE_PATH   0x2
 
#define AFRX_DOS_DEVICE_PATH   0x4
 
#define IntLockProcessPrivateFonts(W32Process)    ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&W32Process->PrivateFontListLock)
 
#define IntUnLockProcessPrivateFonts(W32Process)    ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&W32Process->PrivateFontListLock)
 

Typedefs

typedef struct _STRGDI STRGDI
 
typedef struct _STRGDIPSTRGDI
 
typedef struct _LFONT TEXTOBJ
 
typedef struct _LFONTPTEXTOBJ
 
typedef struct _LFONT LFONT
 
typedef struct _LFONTPLFONT
 

Functions

FORCEINLINE PTEXTOBJ TEXTOBJ_LockText (HFONT hfont)
 
FORCEINLINE VOID TEXTOBJ_UnlockText (PLFONT plfnt)
 
PTEXTOBJ FASTCALL RealizeFontInit (HFONT)
 
NTSTATUS FASTCALL TextIntRealizeFont (HFONT, PTEXTOBJ)
 
NTSTATUS FASTCALL TextIntCreateFontIndirect (CONST LPLOGFONTW lf, HFONT *NewFont)
 
BYTE FASTCALL IntCharSetFromCodePage (UINT uCodePage)
 
BOOL FASTCALL InitFontSupport (VOID)
 
VOID FASTCALL FreeFontSupport (VOID)
 
BOOL FASTCALL IntIsFontRenderingEnabled (VOID)
 
VOID FASTCALL IntEnableFontRendering (BOOL Enable)
 
ULONG FASTCALL FontGetObject (PTEXTOBJ TextObj, ULONG Count, PVOID Buffer)
 
VOID FASTCALL IntLoadSystemFonts (VOID)
 
BOOL FASTCALL IntLoadFontsInRegistry (VOID)
 
VOID FASTCALL IntGdiCleanupPrivateFontsForProcess (VOID)
 
INT FASTCALL IntGdiAddFontResourceEx (_In_ PCUNICODE_STRING FileName, _In_ DWORD cFiles, _In_ DWORD Characteristics, _In_ DWORD dwFlags)
 
BOOL FASTCALL IntGdiRemoveFontResource (_In_ PCUNICODE_STRING FileName, _In_ DWORD cFiles, _In_ DWORD dwFlags)
 
HANDLE FASTCALL IntGdiAddFontMemResource (PVOID Buffer, DWORD dwSize, PDWORD pNumAdded)
 
BOOL FASTCALL IntGdiRemoveFontMemResource (HANDLE hMMFont)
 
ULONG FASTCALL ftGdiGetGlyphOutline (PDC, WCHAR, UINT, LPGLYPHMETRICS, ULONG, PVOID, LPMAT2, BOOL)
 
INT FASTCALL IntGetOutlineTextMetrics (PFONTGDI, UINT, OUTLINETEXTMETRICW *, BOOL)
 
BOOL FASTCALL TextIntUpdateSize (PDC, PTEXTOBJ, PFONTGDI, BOOL)
 
BOOL FASTCALL ftGdiGetRasterizerCaps (LPRASTERIZER_STATUS)
 
BOOL FASTCALL TextIntGetTextExtentPoint (PDC, PTEXTOBJ, LPCWSTR, INT, ULONG, LPINT, LPINT, LPSIZE, FLONG)
 
BOOL FASTCALL ftGdiGetTextMetricsW (HDC, PTMW_INTERNAL)
 
DWORD FASTCALL IntGetFontLanguageInfo (PDC)
 
INT FASTCALL ftGdiGetTextCharsetInfo (PDC, PFONTSIGNATURE, DWORD)
 
DWORD FASTCALL ftGetFontUnicodeRanges (PFONTGDI, PGLYPHSET)
 
DWORD FASTCALL ftGdiGetFontData (PFONTGDI, DWORD, DWORD, PVOID, DWORD)
 
BOOL FASTCALL IntGdiGetFontResourceInfo (PUNICODE_STRING, PVOID, DWORD *, DWORD)
 
BOOL FASTCALL ftGdiRealizationInfo (PFONTGDI, PREALIZATION_INFO)
 
DWORD FASTCALL ftGdiGetKerningPairs (PFONTGDI, DWORD, LPKERNINGPAIR)
 
BOOL NTAPI GreExtTextOutW (IN HDC, IN INT, IN INT, IN UINT, IN OPTIONAL RECTL *, IN LPCWSTR, IN INT, IN OPTIONAL LPINT, IN DWORD)
 
DWORD FASTCALL IntGetCharDimensions (HDC, PTEXTMETRICW, PDWORD)
 
BOOL FASTCALL GreGetTextExtentW (HDC, LPCWSTR, INT, LPSIZE, UINT)
 
BOOL FASTCALL GreGetTextExtentExW (HDC, LPCWSTR, ULONG, ULONG, PULONG, PULONG, LPSIZE, FLONG)
 
BOOL FASTCALL GreTextOutW (HDC, int, int, LPCWSTR, int)
 
HFONT FASTCALL GreCreateFontIndirectW (LOGFONTW *)
 
BOOL WINAPI GreGetTextMetricsW (_In_ HDC hdc, _Out_ LPTEXTMETRICW lptm)
 

Macro Definition Documentation

◆ AFRX_ALTERNATIVE_PATH

#define AFRX_ALTERNATIVE_PATH   0x2

Definition at line 105 of file text.h.

◆ AFRX_DOS_DEVICE_PATH

#define AFRX_DOS_DEVICE_PATH   0x4

Definition at line 106 of file text.h.

◆ AFRX_WRITE_REGISTRY

#define AFRX_WRITE_REGISTRY   0x1

Definition at line 104 of file text.h.

◆ IntLockProcessPrivateFonts

#define IntLockProcessPrivateFonts (   W32Process)     ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&W32Process->PrivateFontListLock)

Definition at line 154 of file text.h.

◆ IntUnLockProcessPrivateFonts

#define IntUnLockProcessPrivateFonts (   W32Process)     ExReleaseFastMutexUnsafeAndLeaveCriticalRegion(&W32Process->PrivateFontListLock)

Definition at line 157 of file text.h.

◆ LFONT_AllocFontWithHandle

#define LFONT_AllocFontWithHandle ( )    ((PLFONT)GDIOBJ_AllocObjWithHandle(GDI_OBJECT_TYPE_FONT, sizeof(TEXTOBJ)))

Definition at line 76 of file text.h.

◆ LFONT_ShareLockFont

Definition at line 77 of file text.h.

◆ LFONT_ShareUnlockFont

#define LFONT_ShareUnlockFont (   plfnt)    GDIOBJ_vDereferenceObject((POBJ)plfnt)

Definition at line 78 of file text.h.

◆ LFONT_UnlockFont

#define LFONT_UnlockFont (   plfnt)    GDIOBJ_vUnlockObject((POBJ)plfnt)

Definition at line 79 of file text.h.

◆ TAG_FINF

#define TAG_FINF   'FNIF'

Definition at line 3 of file text.h.

◆ TEXTOBJECT_INIT

#define TEXTOBJECT_INIT   0x00010000

Definition at line 56 of file text.h.

◆ TO_ALL_PTRS_VALID

#define TO_ALL_PTRS_VALID   0x0002

Definition at line 8 of file text.h.

◆ TO_ALLOC_FACENAME

#define TO_ALLOC_FACENAME   0x0800

Definition at line 18 of file text.h.

◆ TO_BITMAPS

#define TO_BITMAPS   0x0200

Definition at line 16 of file text.h.

◆ TO_ESC_NOT_ORIENT

#define TO_ESC_NOT_ORIENT   0x0008

Definition at line 10 of file text.h.

◆ TO_HIGHRESTEXT

#define TO_HIGHRESTEXT   0x0100

Definition at line 15 of file text.h.

◆ TO_MEM_ALLOCATED

#define TO_MEM_ALLOCATED   0x0001

Definition at line 7 of file text.h.

◆ TO_PARTITION_INIT

#define TO_PARTITION_INIT   0x0400

Definition at line 17 of file text.h.

◆ TO_PWSZ_ALLOCATED

#define TO_PWSZ_ALLOCATED   0x0010

Definition at line 11 of file text.h.

◆ TO_SYS_PARTITION

#define TO_SYS_PARTITION   0x1000

Definition at line 19 of file text.h.

◆ TO_VALID

#define TO_VALID   0x0004

Definition at line 9 of file text.h.

◆ TSIM_STRIKEOUT

#define TSIM_STRIKEOUT   0x0080

Definition at line 14 of file text.h.

◆ TSIM_UNDERLINE1

#define TSIM_UNDERLINE1   0x0020

Definition at line 12 of file text.h.

◆ TSIM_UNDERLINE2

#define TSIM_UNDERLINE2   0x0040

Definition at line 13 of file text.h.

Typedef Documentation

◆ LFONT

typedef struct _LFONT LFONT

◆ PLFONT

typedef struct _LFONT * PLFONT

◆ PSTRGDI

typedef struct _STRGDI * PSTRGDI

◆ PTEXTOBJ

typedef struct _LFONT * PTEXTOBJ

◆ STRGDI

◆ TEXTOBJ

Function Documentation

◆ FontGetObject()

ULONG FASTCALL FontGetObject ( PTEXTOBJ  TextObj,
ULONG  Count,
PVOID  Buffer 
)

Definition at line 293 of file font.c.

294{
295 ULONG cjMaxSize;
296 ENUMLOGFONTEXDVW *plf;
297
298 ASSERT(plfont);
299 plf = &plfont->logfont;
300
301 if (!(plfont->fl & TEXTOBJECT_INIT))
302 {
304 DPRINT("FontGetObject font not initialized!\n");
305
306 Status = TextIntRealizeFont(plfont->BaseObject.hHmgr, plfont);
307 if (!NT_SUCCESS(Status))
308 {
309 DPRINT1("FontGetObject(TextIntRealizeFont) Status = 0x%lx\n", Status);
310 }
311 }
312
313 /* If buffer is NULL, only the size is requested */
314 if (pvBuffer == NULL) return sizeof(LOGFONTW);
315
316 /* Calculate the maximum size according to number of axes */
317 cjMaxSize = FIELD_OFFSET(ENUMLOGFONTEXDVW,
318 elfDesignVector.dvValues[plf->elfDesignVector.dvNumAxes]);
319
320 if (cjBuffer > cjMaxSize) cjBuffer = cjMaxSize;
321
322 RtlCopyMemory(pvBuffer, plf, cjBuffer);
323
324 return cjBuffer;
325}
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define NULL
Definition: types.h:112
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
NTSTATUS FASTCALL TextIntRealizeFont(HFONT FontHandle, PTEXTOBJ pTextObj)
Definition: freetype.c:5988
Status
Definition: gdiplustypes.h:25
#define ASSERT(a)
Definition: mode.c:44
_In_ ULONG cjBuffer
Definition: ntgdi.h:2860
#define DPRINT
Definition: sndvol32.h:73
DWORD dvNumAxes
Definition: wingdi.h:2769
DESIGNVECTOR elfDesignVector
Definition: wingdi.h:2780
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define RtlCopyMemory(Destination, Source, Length)
Definition: typedefs.h:263
uint32_t ULONG
Definition: typedefs.h:59
#define TEXTOBJECT_INIT
Definition: text.h:56

Referenced by GreGetObject().

◆ FreeFontSupport()

VOID FASTCALL FreeFontSupport ( VOID  )

Definition at line 1063 of file freetype.c.

1064{
1065 PLIST_ENTRY pHead, pEntry;
1066 PFONT_CACHE_ENTRY pFontCache;
1067 PFONTSUBST_ENTRY pSubstEntry;
1068 PFONT_ENTRY pFontEntry;
1069
1070 // Cleanup the FontLink cache
1072
1073 // Free font cache list
1074 pHead = &g_FontCacheListHead;
1075 while (!IsListEmpty(pHead))
1076 {
1077 pEntry = RemoveHeadList(pHead);
1078 pFontCache = CONTAINING_RECORD(pEntry, FONT_CACHE_ENTRY, ListEntry);
1079 RemoveCachedEntry(pFontCache);
1080 }
1081
1082 // Free font subst list
1083 pHead = &g_FontSubstListHead;
1084 while (!IsListEmpty(pHead))
1085 {
1086 pEntry = RemoveHeadList(pHead);
1087 pSubstEntry = CONTAINING_RECORD(pEntry, FONTSUBST_ENTRY, ListEntry);
1088 ExFreePoolWithTag(pSubstEntry, TAG_FONT);
1089 }
1090
1091 // Free font list
1092 pHead = &g_FontListHead;
1093 while (!IsListEmpty(pHead))
1094 {
1095 pEntry = RemoveHeadList(pHead);
1096 pFontEntry = CONTAINING_RECORD(pEntry, FONT_ENTRY, ListEntry);
1097 CleanupFontEntry(pFontEntry);
1098 }
1099
1101 {
1104 }
1105
1108}
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
static PFAST_MUTEX g_FreeTypeLock
Definition: freetype.c:369
FT_Library g_FreeTypeLibrary
Definition: freetype.c:360
static VOID FontLink_CleanupCache(VOID)
Definition: freetype.c:312
static __inline VOID FASTCALL CleanupFontEntry(PFONT_ENTRY FontEntry)
Definition: freetype.c:722
static void RemoveCachedEntry(PFONT_CACHE_ENTRY Entry)
Definition: freetype.c:617
FT_Done_Library(FT_Library library)
Definition: ftobjs.c:5333
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
Definition: font.h:77
Definition: font.h:56
Definition: font.h:5
Definition: typedefs.h:120
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
#define TAG_INTERNAL_SYNC
Definition: tags.h:18
#define TAG_FONT
Definition: tags.h:12

Referenced by _Function_class_().

◆ ftGdiGetFontData()

DWORD FASTCALL ftGdiGetFontData ( PFONTGDI  FontGdi,
DWORD  Table,
DWORD  Offset,
PVOID  Buffer,
DWORD  Size 
)

Definition at line 5446 of file freetype.c.

5452{
5454 FT_Face Face = FontGdi->SharedFace->Face;
5455
5457
5458 if (FT_IS_SFNT(Face))
5459 {
5460 if (Table)
5461 Table = Table >> 24 | Table << 24 | (Table >> 8 & 0xFF00) |
5462 (Table << 8 & 0xFF0000);
5463
5464 if (!Buffer) Size = 0;
5465
5466 if (Buffer && Size)
5467 {
5469 FT_ULong Needed = 0;
5470
5471 Error = FT_Load_Sfnt_Table(Face, Table, Offset, NULL, &Needed);
5472
5473 if ( !Error && Needed < Size) Size = Needed;
5474 }
5475 if (!FT_Load_Sfnt_Table(Face, Table, Offset, Buffer, &Size))
5476 Result = Size;
5477 }
5478
5480
5481 return Result;
5482}
BOOL Error
Definition: chkdsk.c:66
Definition: bufpool.h:45
unsigned long DWORD
Definition: ntddk_ex.h:95
#define IntUnLockFreeType()
Definition: freetype.c:386
#define IntLockFreeType()
Definition: freetype.c:380
#define FT_IS_SFNT(face)
Definition: freetype.h:1303
unsigned long FT_ULong
Definition: fttypes.h:253
int FT_Error
Definition: fttypes.h:299
ASMGENDATA Table[]
Definition: genincdata.c:61
_In_ ULONG _In_ ULONG Offset
Definition: ntddpcm.h:101
PSHARED_FACE SharedFace
Definition: engobjects.h:145
FT_Face Face
Definition: engobjects.h:132
FT_Load_Sfnt_Table(FT_Face face, FT_ULong tag, FT_Long offset, FT_Byte *buffer, FT_ULong *length)
Definition: ftobjs.c:4177
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533
#define GDI_ERROR
Definition: wingdi.h:1309
_At_(*)(_In_ PWSK_CLIENT Client, _In_opt_ PUNICODE_STRING NodeName, _In_opt_ PUNICODE_STRING ServiceName, _In_opt_ ULONG NameSpace, _In_opt_ GUID *Provider, _In_opt_ PADDRINFOEXW Hints, _Outptr_ PADDRINFOEXW *Result, _In_opt_ PEPROCESS OwningProcess, _In_opt_ PETHREAD OwningThread, _Inout_ PIRP Irp Result)(Mem)) NTSTATUS(WSKAPI *PFN_WSK_GET_ADDRESS_INFO
Definition: wsk.h:409

Referenced by NtGdiGetFontData().

◆ ftGdiGetGlyphOutline()

ULONG FASTCALL ftGdiGetGlyphOutline ( PDC  dc,
WCHAR  wch,
UINT  iFormat,
LPGLYPHMETRICS  pgm,
ULONG  cjBuf,
PVOID  pvBuf,
LPMAT2  pmat2,
BOOL  bIgnoreRotation 
)

Definition at line 4511 of file freetype.c.

4520{
4521 PDC_ATTR pdcattr;
4522 PTEXTOBJ TextObj;
4523 PFONTGDI FontGDI;
4524 HFONT hFont = 0;
4525 GLYPHMETRICS gm;
4526 ULONG Size;
4527 FT_Face ft_face;
4528 FT_UInt glyph_index;
4529 DWORD width, height, pitch, needed = 0;
4530 FT_Bitmap ft_bitmap;
4532 INT left, right, top = 0, bottom = 0;
4534 FLOATOBJ eM11, widthRatio, eTemp;
4535 FT_Matrix mat, transMat = identityMat;
4536 BOOL needsTransform = FALSE;
4537 INT orientation;
4538 LONG aveWidth;
4539 INT adv, lsb, bbx; /* These three hold to widths of the unrotated chars */
4540 OUTLINETEXTMETRICW *potm;
4541 XFORMOBJ xo;
4542 XFORML xform;
4543 LOGFONTW *plf;
4544
4545 DPRINT("%u, %08x, %p, %08lx, %p, %p\n", wch, iFormat, pgm,
4546 cjBuf, pvBuf, pmat2);
4547
4548 pdcattr = dc->pdcattr;
4549
4550 XFORMOBJ_vInit(&xo, &dc->pdcattr->mxWorldToDevice);
4551 XFORMOBJ_iGetXform(&xo, &xform);
4552 FLOATOBJ_SetFloat(&eM11, xform.eM11);
4553
4554 hFont = pdcattr->hlfntNew;
4555 TextObj = RealizeFontInit(hFont);
4556
4557 if (!TextObj)
4558 {
4560 return GDI_ERROR;
4561 }
4562 FontGDI = ObjToGDI(TextObj->Font, FONT);
4563 ft_face = FontGDI->SharedFace->Face;
4564
4565 plf = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
4566 aveWidth = FT_IS_SCALABLE(ft_face) ? abs(plf->lfWidth) : 0;
4567 orientation = FT_IS_SCALABLE(ft_face) ? plf->lfOrientation : 0;
4568
4570 Size = IntGetOutlineTextMetrics(FontGDI, 0, NULL, FALSE);
4571 if (!Size)
4572 {
4573 TEXTOBJ_UnlockText(TextObj);
4575 return GDI_ERROR;
4576 }
4578 if (!potm)
4579 {
4580 TEXTOBJ_UnlockText(TextObj);
4582 return GDI_ERROR;
4583 }
4585 Size = IntGetOutlineTextMetrics(FontGDI, Size, potm, FALSE);
4586 if (!Size)
4587 {
4589 TEXTOBJ_UnlockText(TextObj);
4591 return GDI_ERROR;
4592 }
4593
4595 TextIntUpdateSize(dc, TextObj, FontGDI, FALSE);
4597 FT_Set_Transform(ft_face, &mat, NULL);
4598
4599 TEXTOBJ_UnlockText(TextObj);
4600
4601 glyph_index = get_glyph_index_flagged(ft_face, wch, (iFormat & GGO_GLYPH_INDEX));
4602 iFormat &= ~GGO_GLYPH_INDEX;
4603
4604 if (orientation || (iFormat != GGO_METRICS && iFormat != GGO_BITMAP) || aveWidth || pmat2)
4605 load_flags |= FT_LOAD_NO_BITMAP;
4606
4607 if (iFormat & GGO_UNHINTED)
4608 {
4609 load_flags |= FT_LOAD_NO_HINTING;
4610 iFormat &= ~GGO_UNHINTED;
4611 }
4612
4613 error = FT_Load_Glyph(ft_face, glyph_index, load_flags);
4614 if (error)
4615 {
4616 DPRINT1("WARNING: Failed to load and render glyph! [index: %u]\n", glyph_index);
4618 if (potm) ExFreePoolWithTag(potm, GDITAG_TEXT);
4619 return GDI_ERROR;
4620 }
4622
4623 FLOATOBJ_Set1(&widthRatio);
4624 if (aveWidth && potm)
4625 {
4626 // widthRatio = aveWidth * eM11 / potm->otmTextMetrics.tmAveCharWidth
4627 FLOATOBJ_SetLong(&widthRatio, aveWidth);
4628 FLOATOBJ_Mul(&widthRatio, &eM11);
4630 }
4631
4632 //left = (INT)(ft_face->glyph->metrics.horiBearingX * widthRatio) & -64;
4633 FLOATOBJ_SetLong(&eTemp, ft_face->glyph->metrics.horiBearingX);
4634 FLOATOBJ_Mul(&eTemp, &widthRatio);
4635 left = FLOATOBJ_GetLong(&eTemp) & -64;
4636
4637 //right = (INT)((ft_face->glyph->metrics.horiBearingX +
4638 // ft_face->glyph->metrics.width) * widthRatio + 63) & -64;
4639 FLOATOBJ_SetLong(&eTemp, ft_face->glyph->metrics.horiBearingX * ft_face->glyph->metrics.width);
4640 FLOATOBJ_Mul(&eTemp, &widthRatio);
4641 FLOATOBJ_AddLong(&eTemp, 63);
4642 right = FLOATOBJ_GetLong(&eTemp) & -64;
4643
4644 //adv = (INT)((ft_face->glyph->metrics.horiAdvance * widthRatio) + 63) >> 6;
4645 FLOATOBJ_SetLong(&eTemp, ft_face->glyph->metrics.horiAdvance);
4646 FLOATOBJ_Mul(&eTemp, &widthRatio);
4647 FLOATOBJ_AddLong(&eTemp, 63);
4648 adv = FLOATOBJ_GetLong(&eTemp) >> 6;
4649
4650 lsb = left >> 6;
4651 bbx = (right - left) >> 6;
4652
4653 DPRINT("Advance = %d, lsb = %d, bbx = %d\n",adv, lsb, bbx);
4654
4656
4657 /* Width scaling transform */
4658 if (!FLOATOBJ_Equal1(&widthRatio))
4659 {
4660 FT_Matrix scaleMat;
4661
4662 eTemp = widthRatio;
4663 FLOATOBJ_MulLong(&eTemp, 1 << 16);
4664
4665 scaleMat.xx = FLOATOBJ_GetLong(&eTemp);
4666 scaleMat.xy = 0;
4667 scaleMat.yx = 0;
4668 scaleMat.yy = INT_TO_FIXED(1);
4669 FT_Matrix_Multiply(&scaleMat, &transMat);
4670 needsTransform = TRUE;
4671 }
4672
4673 /* World transform */
4674 {
4675 FT_Matrix ftmatrix;
4677
4678 /* Create a freetype matrix, by converting to 16.16 fixpoint format */
4679 IntMatrixFromMx(&ftmatrix, pmx);
4680
4681 if (memcmp(&ftmatrix, &identityMat, sizeof(identityMat)) != 0)
4682 {
4683 FT_Matrix_Multiply(&ftmatrix, &transMat);
4684 needsTransform = TRUE;
4685 }
4686 }
4687
4688 /* Rotation transform */
4689 if (orientation)
4690 {
4691 FT_Matrix rotationMat;
4692 DPRINT("Rotation Trans!\n");
4693 IntEscapeMatrix(&rotationMat, orientation);
4694 FT_Matrix_Multiply(&rotationMat, &transMat);
4695 needsTransform = TRUE;
4696 }
4697
4698 /* Extra transformation specified by caller */
4699 if (pmat2)
4700 {
4701 FT_Matrix extraMat;
4702 DPRINT("MAT2 Matrix Trans!\n");
4703 extraMat.xx = FT_FixedFromFIXED(pmat2->eM11);
4704 extraMat.xy = FT_FixedFromFIXED(pmat2->eM21);
4705 extraMat.yx = FT_FixedFromFIXED(pmat2->eM12);
4706 extraMat.yy = FT_FixedFromFIXED(pmat2->eM22);
4707 FT_Matrix_Multiply(&extraMat, &transMat);
4708 needsTransform = TRUE;
4709 }
4710
4711 if (potm) ExFreePoolWithTag(potm, GDITAG_TEXT); /* It looks like we are finished with potm ATM. */
4712
4713 if (!needsTransform)
4714 {
4715 DPRINT("No Need to be Transformed!\n");
4716 top = (ft_face->glyph->metrics.horiBearingY + 63) & -64;
4717 bottom = (ft_face->glyph->metrics.horiBearingY -
4718 ft_face->glyph->metrics.height) & -64;
4719 gm.gmCellIncX = adv;
4720 gm.gmCellIncY = 0;
4721 }
4722 else
4723 {
4724 INT xc, yc;
4725 FT_Vector vec;
4726 for (xc = 0; xc < 2; xc++)
4727 {
4728 for (yc = 0; yc < 2; yc++)
4729 {
4730 vec.x = (ft_face->glyph->metrics.horiBearingX +
4731 xc * ft_face->glyph->metrics.width);
4732 vec.y = ft_face->glyph->metrics.horiBearingY -
4733 yc * ft_face->glyph->metrics.height;
4734 DPRINT("Vec %ld,%ld\n", vec.x, vec.y);
4735 FT_Vector_Transform(&vec, &transMat);
4736 if (xc == 0 && yc == 0)
4737 {
4738 left = right = vec.x;
4739 top = bottom = vec.y;
4740 }
4741 else
4742 {
4743 if (vec.x < left) left = vec.x;
4744 else if (vec.x > right) right = vec.x;
4745 if (vec.y < bottom) bottom = vec.y;
4746 else if (vec.y > top) top = vec.y;
4747 }
4748 }
4749 }
4750 left = left & -64;
4751 right = (right + 63) & -64;
4752 bottom = bottom & -64;
4753 top = (top + 63) & -64;
4754
4755 DPRINT("Transformed box: (%d,%d - %d,%d)\n", left, top, right, bottom);
4756 vec.x = ft_face->glyph->metrics.horiAdvance;
4757 vec.y = 0;
4758 FT_Vector_Transform(&vec, &transMat);
4759 gm.gmCellIncX = (vec.x+63) >> 6;
4760 gm.gmCellIncY = -((vec.y+63) >> 6);
4761 }
4762 gm.gmBlackBoxX = (right - left) >> 6;
4763 gm.gmBlackBoxY = (top - bottom) >> 6;
4764 gm.gmptGlyphOrigin.x = left >> 6;
4765 gm.gmptGlyphOrigin.y = top >> 6;
4766
4767 DPRINT("CX %d CY %d BBX %u BBY %u GOX %d GOY %d\n",
4768 gm.gmCellIncX, gm.gmCellIncY,
4769 gm.gmBlackBoxX, gm.gmBlackBoxY,
4771
4773
4774 if (iFormat == GGO_METRICS)
4775 {
4776 DPRINT("GGO_METRICS Exit!\n");
4777 *pgm = gm;
4778 return 1; /* FIXME */
4779 }
4780
4781 if (ft_face->glyph->format != ft_glyph_format_outline && iFormat != GGO_BITMAP)
4782 {
4783 DPRINT1("Loaded a bitmap\n");
4784 return GDI_ERROR;
4785 }
4786
4787 switch (iFormat)
4788 {
4789 case GGO_BITMAP:
4790 {
4791 width = gm.gmBlackBoxX;
4792 height = gm.gmBlackBoxY;
4793 pitch = ((width + 31) >> 5) << 2;
4794 needed = pitch * height;
4795
4796 if (!pvBuf || !cjBuf) break;
4797 if (!needed) return GDI_ERROR; /* empty glyph */
4798 if (needed > cjBuf)
4799 return GDI_ERROR;
4800
4801 switch (ft_face->glyph->format)
4802 {
4804 {
4805 BYTE *src = ft_face->glyph->bitmap.buffer, *dst = pvBuf;
4806 INT w = min( pitch, (ft_face->glyph->bitmap.width + 7) >> 3 );
4807 INT h = min( height, ft_face->glyph->bitmap.rows );
4808 while (h--)
4809 {
4811 src += ft_face->glyph->bitmap.pitch;
4812 dst += pitch;
4813 }
4814 break;
4815 }
4816
4818 {
4819 ft_bitmap.width = width;
4820 ft_bitmap.rows = height;
4821 ft_bitmap.pitch = pitch;
4822 ft_bitmap.pixel_mode = FT_PIXEL_MODE_MONO;
4823 ft_bitmap.buffer = pvBuf;
4824
4826 if (needsTransform)
4827 {
4828 FT_Outline_Transform(&ft_face->glyph->outline, &transMat);
4829 }
4830 FT_Outline_Translate(&ft_face->glyph->outline, -left, -bottom );
4831 /* Note: FreeType will only set 'black' bits for us. */
4832 RtlZeroMemory(pvBuf, needed);
4833 FT_Outline_Get_Bitmap(g_FreeTypeLibrary, &ft_face->glyph->outline, &ft_bitmap);
4835 break;
4836 }
4837
4838 default:
4839 DPRINT1("Loaded glyph format %x\n", ft_face->glyph->format);
4840 return GDI_ERROR;
4841 }
4842
4843 break;
4844 }
4845
4846 case GGO_GRAY2_BITMAP:
4847 case GGO_GRAY4_BITMAP:
4848 case GGO_GRAY8_BITMAP:
4849 {
4850 unsigned int mult, row, col;
4851 BYTE *start, *ptr;
4852
4853 width = gm.gmBlackBoxX;
4854 height = gm.gmBlackBoxY;
4855 pitch = (width + 3) / 4 * 4;
4856 needed = pitch * height;
4857
4858 if (!pvBuf || !cjBuf) break;
4859 if (!needed) return GDI_ERROR; /* empty glyph */
4860 if (needed > cjBuf)
4861 return GDI_ERROR;
4862
4863 switch (ft_face->glyph->format)
4864 {
4866 {
4867 BYTE *src = ft_face->glyph->bitmap.buffer, *dst = pvBuf;
4868 INT h = min( height, ft_face->glyph->bitmap.rows );
4869 INT x;
4870 while (h--)
4871 {
4872 for (x = 0; (UINT)x < pitch; x++)
4873 {
4874 if (x < ft_face->glyph->bitmap.width)
4875 dst[x] = (src[x / 8] & (1 << ( (7 - (x % 8))))) ? 0xff : 0;
4876 else
4877 dst[x] = 0;
4878 }
4879 src += ft_face->glyph->bitmap.pitch;
4880 dst += pitch;
4881 }
4882 break;
4883 }
4885 {
4886 ft_bitmap.width = width;
4887 ft_bitmap.rows = height;
4888 ft_bitmap.pitch = pitch;
4889 ft_bitmap.pixel_mode = FT_PIXEL_MODE_GRAY;
4890 ft_bitmap.buffer = pvBuf;
4891
4893 if (needsTransform)
4894 {
4895 FT_Outline_Transform(&ft_face->glyph->outline, &transMat);
4896 }
4897 FT_Outline_Translate(&ft_face->glyph->outline, -left, -bottom );
4898 RtlZeroMemory(ft_bitmap.buffer, cjBuf);
4899 FT_Outline_Get_Bitmap(g_FreeTypeLibrary, &ft_face->glyph->outline, &ft_bitmap);
4901
4903 mult = 4;
4904 else if (iFormat == GGO_GRAY4_BITMAP)
4905 mult = 16;
4906 else if (iFormat == GGO_GRAY8_BITMAP)
4907 mult = 64;
4908 else
4909 {
4910 return GDI_ERROR;
4911 }
4912
4913 start = pvBuf;
4914 for (row = 0; row < height; row++)
4915 {
4916 ptr = start;
4917 for (col = 0; col < width; col++, ptr++)
4918 {
4919 *ptr = (((int)*ptr) * mult + 128) / 256;
4920 }
4921 start += pitch;
4922 }
4923
4924 break;
4925 }
4926 default:
4927 DPRINT1("Loaded glyph format %x\n", ft_face->glyph->format);
4928 return GDI_ERROR;
4929 }
4930
4931 break;
4932 }
4933
4934 case GGO_NATIVE:
4935 {
4936 FT_Outline *outline = &ft_face->glyph->outline;
4937
4938 if (cjBuf == 0) pvBuf = NULL; /* This is okay, need cjBuf to allocate. */
4939
4941 if (needsTransform && pvBuf) FT_Outline_Transform(outline, &transMat);
4942
4944
4945 if (!pvBuf || !cjBuf)
4946 {
4948 break;
4949 }
4950 if (needed > cjBuf)
4951 {
4953 return GDI_ERROR;
4954 }
4957 break;
4958 }
4959
4960 case GGO_BEZIER:
4961 {
4962 FT_Outline *outline = &ft_face->glyph->outline;
4963 if (cjBuf == 0) pvBuf = NULL;
4964
4965 if (needsTransform && pvBuf)
4966 {
4968 FT_Outline_Transform(outline, &transMat);
4970 }
4972
4973 if (!pvBuf || !cjBuf)
4974 break;
4975 if (needed > cjBuf)
4976 return GDI_ERROR;
4977
4979 break;
4980 }
4981
4982 default:
4983 DPRINT1("Unsupported format %u\n", iFormat);
4984 return GDI_ERROR;
4985 }
4986
4987 DPRINT("ftGdiGetGlyphOutline END and needed %lu\n", needed);
4988
4989 if (gm.gmBlackBoxX == 0)
4990 gm.gmBlackBoxX = 1;
4991 if (gm.gmBlackBoxY == 0)
4992 gm.gmBlackBoxY = 1;
4993
4994 *pgm = gm;
4995 return needed;
4996}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
HFONT hFont
Definition: main.c:53
FORCEINLINE PMATRIX DC_pmxWorldToDevice(PDC pdc)
Definition: coord.h:135
HDC dc
Definition: cylfrac.c:34
#define ERROR_NOT_ENOUGH_MEMORY
Definition: dderror.h:7
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define ERROR_INVALID_HANDLE
Definition: compat.h:98
struct png_info_def *typedef unsigned char **typedef struct png_info_def *typedef struct png_info_def *typedef struct png_info_def *typedef unsigned char ** row
Definition: typeof.h:78
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
Definition: typeof.h:31
#define ObjToGDI(ClipObj, Type)
Definition: engobjects.h:184
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
#define abs(i)
Definition: fconv.c:206
unsigned int BOOL
Definition: ntddk_ex.h:94
#define FLOATOBJ_Set1(fo)
Definition: floatobj.h:119
#define FLOATOBJ_Equal1(pf)
Definition: floatobj.h:105
BOOL FASTCALL TextIntUpdateSize(PDC dc, PTEXTOBJ TextObj, PFONTGDI FontGDI, BOOL bDoLock)
Definition: freetype.c:4302
static FT_UInt FASTCALL get_glyph_index_flagged(FT_Face face, FT_ULong code, BOOL fCodeAsIndex)
Definition: freetype.c:4420
#define ASSERT_FREETYPE_LOCK_NOT_HELD()
Definition: freetype.c:377
static unsigned int get_bezier_glyph_outline(FT_Outline *outline, unsigned int buflen, char *buf)
Definition: freetype.c:4037
static unsigned int get_native_glyph_outline(FT_Outline *outline, unsigned int buflen, char *buf)
Definition: freetype.c:3964
static VOID FASTCALL IntMatrixFromMx(FT_Matrix *pmat, const MATRIX *pmx)
Definition: freetype.c:1131
static VOID FASTCALL IntEscapeMatrix(FT_Matrix *pmat, LONG lfEscapement)
Definition: freetype.c:1118
static const FT_Matrix identityMat
Definition: freetype.c:354
static __inline FT_Fixed FT_FixedFromFIXED(FIXED f)
Definition: freetype.c:742
INT FASTCALL IntGetOutlineTextMetrics(PFONTGDI FontGDI, UINT Size, OUTLINETEXTMETRICW *Otm, BOOL bLocked)
Definition: freetype.c:3149
FT_Load_Glyph(FT_Face face, FT_UInt glyph_index, FT_Int32 load_flags)
Definition: ftobjs.c:797
#define FT_LOAD_NO_BITMAP
Definition: freetype.h:3030
FT_Set_Transform(FT_Face face, FT_Matrix *matrix, FT_Vector *delta)
Definition: ftobjs.c:690
#define FT_LOAD_NO_HINTING
Definition: freetype.h:3028
#define FT_IS_SCALABLE(face)
Definition: freetype.h:1284
#define FT_LOAD_DEFAULT
Definition: freetype.h:3026
#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH
Definition: freetype.h:3035
FT_Vector_Transform(FT_Vector *vector, const FT_Matrix *matrix)
Definition: ftoutln.c:675
FT_Vector * vec
Definition: ftbbox.c:470
#define INT_TO_FIXED(x)
Definition: ftcalc.h:448
FT_Matrix_Multiply(const FT_Matrix *a, FT_Matrix *b)
Definition: ftcalc.c:661
#define ft_glyph_format_bitmap
Definition: ftimage.h:752
@ FT_PIXEL_MODE_MONO
Definition: ftimage.h:184
@ FT_PIXEL_MODE_GRAY
Definition: ftimage.h:185
#define ft_glyph_format_outline
Definition: ftimage.h:753
FT_Outline_Translate(const FT_Outline *outline, FT_Pos xOffset, FT_Pos yOffset)
Definition: ftoutln.c:509
FT_Outline_Get_Bitmap(FT_Library library, FT_Outline *outline, const FT_Bitmap *abitmap)
Definition: ftoutln.c:648
FT_Outline_Transform(const FT_Outline *outline, const FT_Matrix *matrix)
Definition: ftoutln.c:698
unsigned int FT_UInt
Definition: fttypes.h:231
signed int FT_Int
Definition: fttypes.h:220
GLuint start
Definition: gl.h:1545
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLenum src
Definition: glext.h:6340
GLdouble GLdouble GLdouble GLdouble top
Definition: glext.h:10859
GLdouble GLdouble right
Definition: glext.h:10859
GLint left
Definition: glext.h:7726
GLenum GLenum dst
Definition: glext.h:6340
GLint GLint bottom
Definition: glext.h:7726
GLubyte GLubyte GLubyte GLubyte w
Definition: glext.h:6102
GLfloat GLfloat GLfloat GLfloat h
Definition: glext.h:7723
#define error(str)
Definition: mkdosfs.c:1605
static PVOID ptr
Definition: dispmode.c:27
static const MAT2 mat
Definition: font.c:66
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
#define min(a, b)
Definition: monoChain.cc:55
unsigned int UINT
Definition: ndis.h:50
long LONG
Definition: pedump.c:60
unsigned int width
Definition: ftimage.h:264
unsigned char * buffer
Definition: ftimage.h:266
unsigned char pixel_mode
Definition: ftimage.h:268
unsigned int rows
Definition: ftimage.h:263
int pitch
Definition: ftimage.h:265
FT_GlyphSlot glyph
Definition: freetype.h:1078
FT_Bitmap bitmap
Definition: freetype.h:1892
FT_Outline outline
Definition: freetype.h:1896
FT_Glyph_Metrics metrics
Definition: freetype.h:1885
FT_Glyph_Format format
Definition: freetype.h:1890
FT_Fixed xx
Definition: fttypes.h:392
FT_Fixed yx
Definition: fttypes.h:393
FT_Fixed yy
Definition: fttypes.h:393
FT_Fixed xy
Definition: fttypes.h:392
FT_Pos x
Definition: ftimage.h:78
FT_Pos y
Definition: ftimage.h:79
LONG lfOrientation
Definition: dimm.idl:62
LONG lfWidth
Definition: dimm.idl:60
HANDLE hlfntNew
Definition: ntgdihdl.h:330
short gmCellIncX
Definition: wingdi.h:2445
UINT gmBlackBoxY
Definition: wingdi.h:2443
UINT gmBlackBoxX
Definition: wingdi.h:2442
short gmCellIncY
Definition: wingdi.h:2446
POINT gmptGlyphOrigin
Definition: wingdi.h:2444
Definition: text.h:60
ENUMLOGFONTEXDVW logfont
Definition: text.h:70
FONTOBJ * Font
Definition: text.h:66
FIXED eM22
Definition: wingdi.h:2476
FIXED eM21
Definition: wingdi.h:2475
FIXED eM11
Definition: wingdi.h:2473
FIXED eM12
Definition: wingdi.h:2474
TEXTMETRICW otmTextMetrics
Definition: wingdi.h:2514
FLOATL eM11
Definition: winddi.h:1234
Definition: mesh.c:5330
ENUMLOGFONTEXW elfEnumLogfontEx
Definition: wingdi.h:2779
LOGFONTW elfLogFont
Definition: wingdi.h:2702
long y
Definition: polytest.cpp:48
long x
Definition: polytest.cpp:48
LONG tmAveCharWidth
Definition: wingdi.h:2388
int32_t INT
Definition: typedefs.h:58
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
PTEXTOBJ FASTCALL RealizeFontInit(HFONT hFont)
Definition: font.c:422
FORCEINLINE VOID TEXTOBJ_UnlockText(PLFONT plfnt)
Definition: text.h:96
#define GDITAG_TEXT
Definition: tags.h:172
#define FLOATOBJ_DivLong(pf, l)
Definition: winddi.h:2829
_In_ DWORD cjBuf
Definition: winddi.h:3827
FLOAT FLOATOBJ
Definition: winddi.h:677
#define FLOATOBJ_Mul(pf, pf1)
Definition: winddi.h:2824
#define FLOATOBJ_MulLong(pf, l)
Definition: winddi.h:2826
#define FLOATOBJ_GetLong(pf)
Definition: winddi.h:2817
#define FLOATOBJ_SetFloat(pf, f)
Definition: winddi.h:2814
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:22
#define FLOATOBJ_SetLong(pf, l)
Definition: winddi.h:2815
_In_ SIZEL _In_ ULONG iFormat
Definition: winddi.h:3468
#define FLOATOBJ_AddLong(pf, l)
Definition: winddi.h:2820
#define ERROR_GEN_FAILURE
Definition: winerror.h:134
#define GGO_GRAY2_BITMAP
Definition: wingdi.h:852
#define GGO_GLYPH_INDEX
Definition: wingdi.h:855
#define GGO_UNHINTED
Definition: wingdi.h:856
#define GGO_GRAY8_BITMAP
Definition: wingdi.h:854
#define GGO_BITMAP
Definition: wingdi.h:849
#define GGO_GRAY4_BITMAP
Definition: wingdi.h:853
#define GGO_NATIVE
Definition: wingdi.h:850
#define GGO_METRICS
Definition: wingdi.h:848
#define GGO_BEZIER
Definition: wingdi.h:851
#define XFORMOBJ_vInit
Definition: xformobj.h:12
#define XFORMOBJ_iGetXform
Definition: xformobj.h:9
unsigned char BYTE
Definition: xxhash.c:193

Referenced by NtGdiGetGlyphOutline(), and PATH_ExtTextOut().

◆ ftGdiGetKerningPairs()

DWORD FASTCALL ftGdiGetKerningPairs ( PFONTGDI  Font,
DWORD  cPairs,
LPKERNINGPAIR  pKerningPair 
)

Definition at line 6465 of file freetype.c.

6468{
6469 DWORD Count = 0;
6470 INT i = 0;
6471 FT_Face face = Font->SharedFace->Face;
6472
6473 if (FT_HAS_KERNING(face) && face->charmap->encoding == FT_ENCODING_UNICODE)
6474 {
6475 FT_UInt previous_index = 0, glyph_index = 0;
6476 FT_ULong char_code, char_previous;
6477 FT_Vector delta;
6478
6479 char_previous = char_code = FT_Get_First_Char(face, &glyph_index);
6480
6482
6483 while (glyph_index)
6484 {
6485 if (previous_index && glyph_index)
6486 {
6487 FT_Get_Kerning(face, previous_index, glyph_index, FT_KERNING_DEFAULT, &delta);
6488
6489 if (pKerningPair && cPairs)
6490 {
6491 pKerningPair[i].wFirst = char_previous;
6492 pKerningPair[i].wSecond = char_code;
6493 pKerningPair[i].iKernAmount = delta.x;
6494 i++;
6495 if (i == cPairs) break;
6496 }
6497 Count++;
6498 }
6499 previous_index = glyph_index;
6500 char_previous = char_code;
6501 char_code = FT_Get_Next_Char(face, char_code, &glyph_index);
6502 }
6504 }
6505 return Count;
6506}
FT_Get_First_Char(FT_Face face, FT_UInt *agindex)
Definition: ftobjs.c:3740
FT_Get_Next_Char(FT_Face face, FT_ULong char_code, FT_UInt *agindex)
Definition: ftobjs.c:3765
FT_Get_Kerning(FT_Face face, FT_UInt left_glyph, FT_UInt right_glyph, FT_UInt kern_mode, FT_Vector *akerning)
Definition: ftobjs.c:3391
@ FT_KERNING_DEFAULT
Definition: freetype.h:3413
#define FT_HAS_KERNING(face)
Definition: freetype.h:1269
GLenum GLuint GLint GLenum face
Definition: glext.h:7025
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
int Count
Definition: noreturn.cpp:7
WORD wSecond
Definition: wingdi.h:2465
int iKernAmount
Definition: wingdi.h:2466

Referenced by GreGetKerningPairs(), and NtGdiGetKerningPairs().

◆ ftGdiGetRasterizerCaps()

BOOL FASTCALL ftGdiGetRasterizerCaps ( LPRASTERIZER_STATUS  lprs)

Definition at line 3833 of file freetype.c.

3834{
3835 if ( lprs )
3836 {
3837 lprs->nSize = sizeof(RASTERIZER_STATUS);
3838 lprs->wFlags = TT_AVAILABLE | TT_ENABLED;
3839 lprs->nLanguageID = gusLanguageID;
3840 return TRUE;
3841 }
3843 return FALSE;
3844}
#define ERROR_INVALID_PARAMETER
Definition: compat.h:101
USHORT gusLanguageID
Definition: init.c:12
#define TT_ENABLED
Definition: wingdi.h:889
struct _RASTERIZER_STATUS RASTERIZER_STATUS
#define TT_AVAILABLE
Definition: wingdi.h:888

Referenced by NtGdiGetRasterizerCaps().

◆ ftGdiGetTextCharsetInfo()

INT FASTCALL ftGdiGetTextCharsetInfo ( PDC  Dc,
PFONTSIGNATURE  lpSig,
DWORD  dwFlags 
)

Definition at line 5161 of file freetype.c.

5165{
5166 PDC_ATTR pdcattr;
5167 UINT Ret = DEFAULT_CHARSET;
5168 INT i;
5169 HFONT hFont;
5170 PTEXTOBJ TextObj;
5171 PFONTGDI FontGdi;
5173 TT_OS2 *pOS2;
5174 FT_Face Face;
5175 CHARSETINFO csi;
5176 DWORD cp, fs0;
5177 USHORT usACP, usOEM;
5178
5179 pdcattr = Dc->pdcattr;
5180 hFont = pdcattr->hlfntNew;
5181 TextObj = RealizeFontInit(hFont);
5182
5183 if (!TextObj)
5184 {
5186 return Ret;
5187 }
5188 FontGdi = ObjToGDI(TextObj->Font, FONT);
5189 Face = FontGdi->SharedFace->Face;
5190 TEXTOBJ_UnlockText(TextObj);
5191
5192 memset(&fs, 0, sizeof(FONTSIGNATURE));
5194 pOS2 = FT_Get_Sfnt_Table(Face, ft_sfnt_os2);
5195 if (NULL != pOS2)
5196 {
5197 fs.fsCsb[0] = pOS2->ulCodePageRange1;
5198 fs.fsCsb[1] = pOS2->ulCodePageRange2;
5199 fs.fsUsb[0] = pOS2->ulUnicodeRange1;
5200 fs.fsUsb[1] = pOS2->ulUnicodeRange2;
5201 fs.fsUsb[2] = pOS2->ulUnicodeRange3;
5202 fs.fsUsb[3] = pOS2->ulUnicodeRange4;
5203 if (pOS2->version == 0)
5204 {
5205 FT_UInt dummy;
5206
5207 if (FT_Get_First_Char( Face, &dummy ) < 0x100)
5208 fs.fsCsb[0] |= FS_LATIN1;
5209 else
5210 fs.fsCsb[0] |= FS_SYMBOL;
5211 }
5212 }
5213 pOS2 = NULL;
5215 DPRINT("Csb 1=%x 0=%x\n", fs.fsCsb[1],fs.fsCsb[0]);
5216 if (fs.fsCsb[0] == 0)
5217 { /* Let's see if we can find any interesting cmaps */
5218 for (i = 0; i < Face->num_charmaps; i++)
5219 {
5220 switch (Face->charmaps[i]->encoding)
5221 {
5222 case FT_ENCODING_UNICODE:
5223 case FT_ENCODING_APPLE_ROMAN:
5224 fs.fsCsb[0] |= FS_LATIN1;
5225 break;
5226 case FT_ENCODING_MS_SYMBOL:
5227 fs.fsCsb[0] |= FS_SYMBOL;
5228 break;
5229 default:
5230 break;
5231 }
5232 }
5233 }
5234 if (lpSig)
5235 {
5236 RtlCopyMemory(lpSig, &fs, sizeof(FONTSIGNATURE));
5237 }
5238
5239 RtlGetDefaultCodePage(&usACP, &usOEM);
5240 cp = usACP;
5241
5243 if (csi.fs.fsCsb[0] & fs.fsCsb[0])
5244 {
5245 DPRINT("Hit 1\n");
5246 Ret = csi.ciCharset;
5247 goto Exit;
5248 }
5249
5250 for (i = 0; i < MAXTCIINDEX; i++)
5251 {
5252 fs0 = 1L << i;
5253 if (fs.fsCsb[0] & fs0)
5254 {
5255 if (IntTranslateCharsetInfo(&fs0, &csi, TCI_SRCFONTSIG))
5256 {
5257 // *cp = csi.ciACP;
5258 DPRINT("Hit 2\n");
5259 Ret = csi.ciCharset;
5260 goto Exit;
5261 }
5262 else
5263 DPRINT1("TCI failing on %x\n", fs0);
5264 }
5265 }
5266Exit:
5267 DPRINT("CharSet %u CodePage %u\n", csi.ciCharset, csi.ciACP);
5268 return (MAKELONG(csi.ciACP, csi.ciCharset));
5269}
#define MAXTCIINDEX
Definition: freetype.c:424
static BOOLEAN IntTranslateCharsetInfo(PDWORD Src, LPCHARSETINFO Cs, DWORD Flags)
Definition: freetype.c:2784
#define fs
Definition: i386-dis.c:444
POINT cp
Definition: magnifier.c:59
NTSYSAPI VOID NTAPI RtlGetDefaultCodePage(_Out_ PUSHORT AnsiCodePage, _Out_ PUSHORT OemCodePage)
unsigned short USHORT
Definition: pedump.c:61
#define memset(x, y, z)
Definition: compat.h:39
static void Exit(void)
Definition: sock.c:1330
FT_Encoding encoding
Definition: freetype.h:836
FT_Int num_charmaps
Definition: freetype.h:1057
FT_CharMap * charmaps
Definition: freetype.h:1058
FT_UShort version
Definition: tttables.h:378
FT_ULong ulUnicodeRange1
Definition: tttables.h:397
FT_ULong ulCodePageRange1
Definition: tttables.h:415
FT_ULong ulUnicodeRange3
Definition: tttables.h:399
FT_ULong ulUnicodeRange2
Definition: tttables.h:398
FT_ULong ulCodePageRange2
Definition: tttables.h:416
FT_ULong ulUnicodeRange4
Definition: tttables.h:400
Definition: ffs.h:70
FONTSIGNATURE fs
Definition: wingdi.h:1548
UINT ciCharset
Definition: wingdi.h:1546
DWORD fsCsb[2]
Definition: wingdi.h:1543
FT_Get_Sfnt_Table(FT_Face face, FT_Sfnt_Tag tag)
Definition: ftobjs.c:4156
#define ft_sfnt_os2
Definition: tttables.h:639
#define MAKELONG(a, b)
Definition: typedefs.h:249
#define DEFAULT_CHARSET
Definition: wingdi.h:384
#define FS_SYMBOL
Definition: wingdi.h:575
#define FS_LATIN1
Definition: wingdi.h:560
#define TCI_SRCFONTSIG
Definition: wingdi.h:963
#define TCI_SRCCODEPAGE
Definition: wingdi.h:962

Referenced by DC_InitHack(), IntGetFontLanguageInfo(), NtGdiGetCharSet(), and NtGdiGetTextCharsetInfo().

◆ ftGdiGetTextMetricsW()

BOOL FASTCALL ftGdiGetTextMetricsW ( HDC  hDC,
PTMW_INTERNAL  ptmwi 
)

Definition at line 5348 of file freetype.c.

5351{
5352 PDC dc;
5353 PDC_ATTR pdcattr;
5354 PTEXTOBJ TextObj;
5355 PFONTGDI FontGDI;
5356 FT_Face Face;
5357 TT_OS2 *pOS2;
5358 TT_HoriHeader *pHori;
5360 ULONG Error;
5362 LOGFONTW *plf;
5363
5364 if (!ptmwi)
5365 {
5367 return FALSE;
5368 }
5369 RtlZeroMemory(ptmwi, sizeof(TMW_INTERNAL));
5370
5371 if (!(dc = DC_LockDc(hDC)))
5372 {
5374 return FALSE;
5375 }
5376 pdcattr = dc->pdcattr;
5377 TextObj = RealizeFontInit(pdcattr->hlfntNew);
5378 if (NULL != TextObj)
5379 {
5380 plf = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
5381 FontGDI = ObjToGDI(TextObj->Font, FONT);
5382
5383 Face = FontGDI->SharedFace->Face;
5384
5385 // NOTE: GetTextMetrics simply ignores lfEscapement and XFORM.
5387 Error = IntRequestFontSize(dc, FontGDI, plf->lfWidth, plf->lfHeight);
5388 FT_Set_Transform(Face, NULL, NULL);
5389
5391
5392 if (0 != Error)
5393 {
5394 DPRINT1("Error in setting pixel sizes: %u\n", Error);
5396 }
5397 else
5398 {
5400
5402
5403 Error = FT_Get_WinFNT_Header(Face, &Win);
5404 pOS2 = FT_Get_Sfnt_Table(Face, ft_sfnt_os2);
5405 pHori = FT_Get_Sfnt_Table(Face, ft_sfnt_hhea);
5406
5407 if (!pOS2 && Error)
5408 {
5409 DPRINT1("Can't find OS/2 table - not TT font?\n");
5411 }
5412
5413 if (!pHori && Error)
5414 {
5415 DPRINT1("Can't find HHEA table - not TT font?\n");
5417 }
5418
5419 if (NT_SUCCESS(Status))
5420 {
5421 FillTM(&ptmwi->TextMetric, FontGDI, pOS2, pHori, (Error ? NULL : &Win));
5422
5423 /* FIXME: Fill Diff member */
5424 }
5425
5427 }
5428 TEXTOBJ_UnlockText(TextObj);
5429 }
5430 else
5431 {
5433 }
5434 DC_UnlockDc(dc);
5435
5436 if (!NT_SUCCESS(Status))
5437 {
5439 return FALSE;
5440 }
5441 return TRUE;
5442}
static HDC hDC
Definition: 3dtext.c:33
#define STATUS_INVALID_HANDLE
Definition: d3dkmdt.h:40
FORCEINLINE VOID DC_UnlockDc(PDC pdc)
Definition: dc.h:238
FORCEINLINE PDC DC_LockDc(HDC hdc)
Definition: dc.h:220
static FT_Error IntRequestFontSize(PDC dc, PFONTGDI FontGDI, LONG lfWidth, LONG lfHeight)
Definition: freetype.c:4162
static void FASTCALL FillTM(TEXTMETRICW *TM, PFONTGDI FontGDI, TT_OS2 *pOS2, TT_HoriHeader *pHori, FT_WinFNT_HeaderRec *pFNT)
Definition: freetype.c:2847
FT_Get_WinFNT_Header(FT_Face face, FT_WinFNT_HeaderRec *aheader)
Definition: ftwinfnt.c:29
#define STATUS_INTERNAL_ERROR
Definition: ntstatus.h:465
#define STATUS_SUCCESS
Definition: shellext.h:65
Definition: polytest.cpp:41
LONG lfHeight
Definition: dimm.idl:59
TEXTMETRICW TextMetric
Definition: ntgdityp.h:370
#define ft_sfnt_hhea
Definition: tttables.h:640
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
VOID FASTCALL SetLastNtError(_In_ NTSTATUS Status)
Definition: error.c:31

Referenced by GreGetTextMetricsW(), IntGetCharDimensions(), and NtGdiGetTextMetricsW().

◆ ftGdiRealizationInfo()

BOOL FASTCALL ftGdiRealizationInfo ( PFONTGDI  Font,
PREALIZATION_INFO  Info 
)

Definition at line 6446 of file freetype.c.

6447{
6448 if (FT_HAS_FIXED_SIZES(Font->SharedFace->Face))
6449 Info->iTechnology = RI_TECH_BITMAP;
6450 else
6451 {
6452 if (FT_IS_SCALABLE(Font->SharedFace->Face))
6453 Info->iTechnology = RI_TECH_SCALABLE;
6454 else
6455 Info->iTechnology = RI_TECH_FIXED;
6456 }
6457 Info->iUniq = Font->FontObj.iUniq;
6458 Info->dwUnknown = -1;
6459 return TRUE;
6460}
#define FT_HAS_FIXED_SIZES(face)
Definition: freetype.h:1333
#define RI_TECH_SCALABLE
Definition: ntgdityp.h:273
#define RI_TECH_FIXED
Definition: ntgdityp.h:272
#define RI_TECH_BITMAP
Definition: ntgdityp.h:271
_Must_inspect_result_ _In_ WDFCHILDLIST _In_ PWDF_CHILD_LIST_ITERATOR _Out_ WDFDEVICE _Inout_opt_ PWDF_CHILD_RETRIEVE_INFO Info
Definition: wdfchildlist.h:690

Referenced by NtGdiGetRealizationInfo().

◆ ftGetFontUnicodeRanges()

DWORD FASTCALL ftGetFontUnicodeRanges ( PFONTGDI  Font,
PGLYPHSET  glyphset 
)

Definition at line 5274 of file freetype.c.

5275{
5276 DWORD size = 0;
5277 DWORD num_ranges = 0;
5278 FT_Face face = Font->SharedFace->Face;
5279
5280 if (face->charmap == NULL)
5281 {
5282 DPRINT1("FIXME: No charmap selected! This is a BUG!\n");
5283 return 0;
5284 }
5285
5286 if (face->charmap->encoding == FT_ENCODING_UNICODE)
5287 {
5288 FT_UInt glyph_code = 0;
5289 FT_ULong char_code, char_code_prev;
5290
5291 char_code_prev = char_code = FT_Get_First_Char(face, &glyph_code);
5292
5293 DPRINT("Face encoding FT_ENCODING_UNICODE, number of glyphs %ld, first glyph %u, first char %04lx\n",
5294 face->num_glyphs, glyph_code, char_code);
5295
5296 if (!glyph_code) return 0;
5297
5298 if (glyphset)
5299 {
5300 glyphset->ranges[0].wcLow = (USHORT)char_code;
5301 glyphset->ranges[0].cGlyphs = 0;
5302 glyphset->cGlyphsSupported = 0;
5303 }
5304
5305 num_ranges = 1;
5306 while (glyph_code)
5307 {
5308 if (char_code < char_code_prev)
5309 {
5310 DPRINT1("Expected increasing char code from FT_Get_Next_Char\n");
5311 return 0;
5312 }
5313 if (char_code - char_code_prev > 1)
5314 {
5315 num_ranges++;
5316 if (glyphset)
5317 {
5318 glyphset->ranges[num_ranges - 1].wcLow = (USHORT)char_code;
5319 glyphset->ranges[num_ranges - 1].cGlyphs = 1;
5320 glyphset->cGlyphsSupported++;
5321 }
5322 }
5323 else if (glyphset)
5324 {
5325 glyphset->ranges[num_ranges - 1].cGlyphs++;
5326 glyphset->cGlyphsSupported++;
5327 }
5328 char_code_prev = char_code;
5329 char_code = FT_Get_Next_Char(face, char_code, &glyph_code);
5330 }
5331 }
5332 else
5333 DPRINT1("Encoding %i not supported\n", face->charmap->encoding);
5334
5335 size = sizeof(GLYPHSET) + sizeof(WCRANGE) * (num_ranges - 1);
5336 if (glyphset)
5337 {
5338 glyphset->cbThis = size;
5339 glyphset->cRanges = num_ranges;
5340 glyphset->flAccel = 0;
5341 }
5342 return size;
5343}
GLsizeiptr size
Definition: glext.h:5919

Referenced by NtGdiGetFontUnicodeRanges().

◆ GreCreateFontIndirectW()

HFONT FASTCALL GreCreateFontIndirectW ( LOGFONTW lplf)

Internal

Definition at line 23 of file font.c.

24{
25 if (lplf)
26 {
27 ENUMLOGFONTEXDVW Logfont;
28
29 RtlCopyMemory( &Logfont.elfEnumLogfontEx.elfLogFont, lplf, sizeof(LOGFONTW));
31 sizeof(Logfont.elfEnumLogfontEx.elfFullName));
33 sizeof(Logfont.elfEnumLogfontEx.elfStyle));
35 sizeof(Logfont.elfEnumLogfontEx.elfScript));
36
37 Logfont.elfDesignVector.dvNumAxes = 0;
38
39 RtlZeroMemory( &Logfont.elfDesignVector, sizeof(DESIGNVECTOR));
40
41 return HfontCreate((PENUMLOGFONTEXDVW)&Logfont, 0, 0, 0, NULL );
42 }
43 else return NULL;
44}
WCHAR elfStyle[LF_FACESIZE]
Definition: wingdi.h:2704
WCHAR elfFullName[LF_FULLFACESIZE]
Definition: wingdi.h:2703
WCHAR elfScript[LF_FACESIZE]
Definition: wingdi.h:2705
HFONT APIENTRY HfontCreate(IN PENUMLOGFONTEXDVW pelfw, IN ULONG cjElfw, IN LFTYPE lft, IN FLONG fl, IN PVOID pvCliData)
Definition: font.c:1215

Referenced by IntPaintDesktop(), MENU_DrawPopupGlyph(), MenuInit(), UITOOLS95_DFC_ButtonCheckRadio(), UITOOLS95_DrawFrameCaption(), UITOOLS95_DrawFrameMenu(), and UITOOLS95_DrawFrameScroll().

◆ GreExtTextOutW()

BOOL NTAPI GreExtTextOutW ( IN  HDC,
IN  INT,
IN  INT,
IN  UINT,
IN OPTIONAL RECTL ,
IN  LPCWSTR,
IN  INT,
IN OPTIONAL  LPINT,
IN  DWORD 
)

◆ GreGetTextExtentExW()

BOOL FASTCALL GreGetTextExtentExW ( HDC  hDC,
LPCWSTR  String,
ULONG  Count,
ULONG  MaxExtent,
PULONG  Fit,
PULONG  Dx,
LPSIZE  pSize,
FLONG  fl 
)

Definition at line 135 of file text.c.

144{
145 PDC pdc;
146 PDC_ATTR pdcattr;
147 BOOL Result;
148 PTEXTOBJ TextObj;
149
150 if ( (!String && Count ) || !pSize )
151 {
153 return FALSE;
154 }
155
156 if ( !Count )
157 {
158 if ( Fit ) Fit = 0;
159 return TRUE;
160 }
161
162 pdc = DC_LockDc(hDC);
163 if (NULL == pdc)
164 {
166 return FALSE;
167 }
168 pdcattr = pdc->pdcattr;
169
170 TextObj = RealizeFontInit(pdcattr->hlfntNew);
171 if ( TextObj )
172 {
174 TextObj,
175 String,
176 Count,
177 MaxExtent,
178 (LPINT)Fit,
179 (LPINT)Dx,
180 pSize,
181 fl);
182 TEXTOBJ_UnlockText(TextObj);
183 }
184 else
185 Result = FALSE;
186
187 DC_UnlockDc(pdc);
188 return Result;
189}
BOOL FASTCALL TextIntGetTextExtentPoint(PDC dc, PTEXTOBJ TextObj, LPCWSTR String, INT Count, ULONG MaxExtent, LPINT Fit, LPINT Dx, LPSIZE Size, FLONG fl)
Definition: freetype.c:5039
_Must_inspect_result_ _In_ WDFDEVICE _In_ WDFSTRING String
Definition: wdfdevice.h:2433
_In_ FLONG fl
Definition: winddi.h:1279
int * LPINT
Definition: windef.h:178

Referenced by TEXT_Ellipsify(), TEXT_NextLineW(), TEXT_PathEllipsify(), TEXT_WordBreak(), and UserDrawCaptionText().

◆ GreGetTextExtentW()

BOOL FASTCALL GreGetTextExtentW ( HDC  hDC,
LPCWSTR  lpwsz,
INT  cwc,
LPSIZE  psize,
UINT  flOpts 
)

Definition at line 78 of file text.c.

84{
85 PDC pdc;
86 PDC_ATTR pdcattr;
88 PTEXTOBJ TextObj;
89
90 if (!cwc)
91 {
92 psize->cx = 0;
93 psize->cy = 0;
94 return TRUE;
95 }
96
97 pdc = DC_LockDc(hDC);
98 if (!pdc)
99 {
101 return FALSE;
102 }
103
104 pdcattr = pdc->pdcattr;
105
106 TextObj = RealizeFontInit(pdcattr->hlfntNew);
107 if ( TextObj )
108 {
110 TextObj,
111 lpwsz,
112 cwc,
113 0,
114 NULL,
115 0,
116 psize,
117 flOpts);
118 TEXTOBJ_UnlockText(TextObj);
119 }
120 else
121 Result = FALSE;
122
123 DC_UnlockDc(pdc);
124 return Result;
125}
_Must_inspect_result_ _Out_ LPSIZE psize
Definition: ntgdi.h:1569
LONG cx
Definition: windef.h:334
LONG cy
Definition: windef.h:335

Referenced by DrawTextExWorker(), IntPaintDesktop(), and TEXT_DrawUnderscore().

◆ GreGetTextMetricsW()

BOOL WINAPI GreGetTextMetricsW ( _In_ HDC  hdc,
_Out_ LPTEXTMETRICW  lptm 
)

Definition at line 193 of file text.c.

196{
197 TMW_INTERNAL tmwi;
198 if (!ftGdiGetTextMetricsW(hdc, &tmwi)) return FALSE;
199 IntTMWFixUp(hdc, &tmwi);
200 *lptm = tmwi.TextMetric;
201 return TRUE;
202}
BOOL FASTCALL ftGdiGetTextMetricsW(HDC hDC, PTMW_INTERNAL ptmwi)
Definition: freetype.c:5348
HDC hdc
Definition: main.c:9
static LPTEXTMETRICW lptm
Definition: font.c:42
VOID FASTCALL IntTMWFixUp(HDC hDC, TMW_INTERNAL *ptm)
Definition: text.c:30

Referenced by DrawTextExWorker().

◆ GreTextOutW()

BOOL FASTCALL GreTextOutW ( HDC  hdc,
int  nXStart,
int  nYStart,
LPCWSTR  lpString,
int  cchString 
)

Functions

Definition at line 61 of file text.c.

67{
68 return GreExtTextOutW(hdc, nXStart, nYStart, 0, NULL, lpString, cchString, NULL, 0);
69}
BOOL APIENTRY GreExtTextOutW(IN HDC hDC, IN INT XStart, IN INT YStart, IN UINT fuOptions, IN OPTIONAL PRECTL lprc, IN LPCWSTR String, IN INT Count, IN OPTIONAL LPINT Dx, IN DWORD dwCodePage)
Definition: freetype.c:7387

Referenced by MENU_DrawPopupGlyph(), UITOOLS95_DFC_ButtonCheckRadio(), UITOOLS95_DrawFrameCaption(), UITOOLS95_DrawFrameMenu(), and UITOOLS95_DrawFrameScroll().

◆ InitFontSupport()

BOOL FASTCALL InitFontSupport ( VOID  )

Definition at line 1021 of file freetype.c.

1022{
1023 ULONG ulError;
1024
1026
1028 if (g_FreeTypeLock == NULL)
1029 {
1030 return FALSE;
1031 }
1033
1035 if (ulError)
1036 {
1037 DPRINT1("FT_Init_FreeType failed with error code 0x%x\n", ulError);
1038 return FALSE;
1039 }
1040
1042 {
1043 DPRINT1("Fonts registry is empty.\n");
1044
1045 /* Load font(s) with writing registry */
1047 }
1048
1049 IntLoadFontSubstList(&g_FontSubstListHead);
1050
1051#if 0
1052 DumpFontInfo(TRUE);
1053#endif
1054
1058
1059 return TRUE;
1060}
#define NonPagedPool
Definition: env_spec_w32.h:307
BOOL FASTCALL IntLoadFontSubstList(PLIST_ENTRY pHead)
Definition: freetype.c:874
static UINT g_FontCacheNumEntries
Definition: freetype.c:395
VOID FASTCALL IntLoadSystemFonts(VOID)
Definition: freetype.c:1564
static NTSTATUS FontLink_LoadDefaultCharset(VOID)
Definition: freetype.c:156
static NTSTATUS FontLink_LoadSettings(VOID)
Definition: freetype.c:92
static NTSTATUS FontLink_LoadDefaultFonts(VOID)
Definition: freetype.c:118
BOOL FASTCALL IntLoadFontsInRegistry(VOID)
Definition: freetype.c:2384
FT_Init_FreeType(FT_Library *alibrary)
Definition: ftinit.c:196
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
FAST_MUTEX
Definition: extypes.h:17

Referenced by InitializeGreCSRSS().

◆ IntCharSetFromCodePage()

BYTE FASTCALL IntCharSetFromCodePage ( UINT  uCodePage)

Definition at line 473 of file freetype.c.

474{
475 UINT i;
476
477 if (uCodePage == CP_OEMCP)
478 return OEM_CHARSET;
479
480 if (uCodePage == CP_MACCP)
481 return MAC_CHARSET;
482
483 for (i = 0; i < MAXTCIINDEX; ++i)
484 {
485 if (g_FontTci[i].ciACP == 0)
486 continue;
487
488 if (g_FontTci[i].ciACP == uCodePage)
489 return g_FontTci[i].ciCharset;
490 }
491
492 return DEFAULT_CHARSET;
493}
#define CP_OEMCP
Definition: freetype.c:467
static const CHARSETINFO g_FontTci[MAXTCIINDEX]
Definition: freetype.c:425
#define CP_MACCP
Definition: freetype.c:468
#define OEM_CHARSET
Definition: wingdi.h:400
#define MAC_CHARSET
Definition: wingdi.h:403

Referenced by CreateStockFonts().

◆ IntEnableFontRendering()

VOID FASTCALL IntEnableFontRendering ( BOOL  Enable)

Definition at line 2714 of file freetype.c.

2715{
2717}
static BOOL g_RenderingEnabled
Definition: freetype.c:372
_In_ ULONGLONG _In_ ULONGLONG _In_ BOOLEAN Enable
Definition: ntddpcm.h:142

◆ IntGdiAddFontMemResource()

HANDLE FASTCALL IntGdiAddFontMemResource ( PVOID  Buffer,
DWORD  dwSize,
PDWORD  pNumAdded 
)

Definition at line 2536 of file freetype.c.

2537{
2538 HANDLE Ret = NULL;
2540 PFONT_ENTRY_COLL_MEM EntryCollection;
2541 INT FaceCount;
2542
2544 if (!BufferCopy)
2545 {
2546 *pNumAdded = 0;
2547 return NULL;
2548 }
2549 RtlCopyMemory(BufferCopy, Buffer, dwSize);
2550
2551 RtlZeroMemory(&LoadFont, sizeof(LoadFont));
2552 LoadFont.Memory = SharedMem_Create(BufferCopy, dwSize, FALSE);
2553 LoadFont.Characteristics = FR_PRIVATE | FR_NOT_ENUM;
2554 RtlInitUnicodeString(&LoadFont.RegValueName, NULL);
2556
2557 RtlFreeUnicodeString(&LoadFont.RegValueName);
2558
2559 /* Release our copy */
2563
2564 if (FaceCount > 0)
2565 {
2566 EntryCollection = ExAllocatePoolWithTag(PagedPool, sizeof(FONT_ENTRY_COLL_MEM), TAG_FONT);
2567 if (EntryCollection)
2568 {
2570 EntryCollection->Entry = LoadFont.PrivateEntry;
2572 IntLockProcessPrivateFonts(Win32Process);
2573 EntryCollection->Handle = ULongToHandle(++Win32Process->PrivateMemFontHandleCount);
2574 InsertTailList(&Win32Process->PrivateMemFontListHead, &EntryCollection->ListEntry);
2575 IntUnLockProcessPrivateFonts(Win32Process);
2577 Ret = EntryCollection->Handle;
2578 }
2579 }
2580 *pNumAdded = FaceCount;
2581
2582 return Ret;
2583}
#define ULongToHandle(h)
Definition: basetsd.h:81
#define InsertTailList(ListHead, Entry)
BOOL LoadFont(LPWSTR lpCmdLine)
static INT FASTCALL IntGdiLoadFontByIndexFromMemory(PGDI_LOAD_FONT pLoadFont, FT_Long FontIndex)
Definition: freetype.c:2011
static PSHARED_MEM SharedMem_Create(PBYTE Buffer, ULONG BufferSize, BOOL IsMapping)
Definition: freetype.c:593
static void SharedMem_Release(PSHARED_MEM Ptr)
Definition: freetype.c:650
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:56
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSYSAPI VOID NTAPI RtlFreeUnicodeString(PUNICODE_STRING UnicodeString)
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
Definition: font.h:20
FONT_ENTRY_MEM * Entry
Definition: font.h:23
LIST_ENTRY ListEntry
Definition: font.h:21
HANDLE Handle
Definition: font.h:22
LIST_ENTRY PrivateMemFontListHead
Definition: win32.h:286
UINT PrivateMemFontHandleCount
Definition: win32.h:287
#define IntLockProcessPrivateFonts(W32Process)
Definition: text.h:154
#define IntUnLockProcessPrivateFonts(W32Process)
Definition: text.h:157

Referenced by NtGdiAddFontMemResourceEx().

◆ IntGdiAddFontResourceEx()

INT FASTCALL IntGdiAddFontResourceEx ( _In_ PCUNICODE_STRING  FileName,
_In_ DWORD  cFiles,
_In_ DWORD  Characteristics,
_In_ DWORD  dwFlags 
)

Definition at line 2291 of file freetype.c.

2296{
2297 PWSTR pchFile = FileName->Buffer;
2298 SIZE_T cchFile;
2299 INT ret = 0;
2300
2301 while (cFiles--)
2302 {
2303 _SEH2_TRY
2304 {
2305 cchFile = wcslen(pchFile);
2306 }
2308 {
2309 _SEH2_YIELD(return FALSE);
2310 }
2311 _SEH2_END;
2312
2313 UNICODE_STRING ustrPathName;
2314 ustrPathName.Length = (USHORT)(cchFile * sizeof(WCHAR));
2315 ustrPathName.MaximumLength = ustrPathName.Length + sizeof(WCHAR);
2316 ustrPathName.Buffer = pchFile;
2317
2318 INT count = IntGdiAddFontResourceSingle(&ustrPathName, Characteristics, dwFlags);
2319 if (!count)
2320 return 0;
2321 ret += count;
2322
2323 pchFile += cchFile + 1;
2324 }
2325
2326 return ret;
2327}
static INT FASTCALL IntGdiAddFontResourceSingle(_In_ PCUNICODE_STRING FileName, _In_ DWORD Characteristics, _In_ DWORD dwFlags)
Definition: freetype.c:2091
GLuint GLuint GLsizei count
Definition: gl.h:1545
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:90
#define _SEH2_EXCEPT(...)
Definition: pseh2_64.h:82
#define _SEH2_END
Definition: pseh2_64.h:171
#define _SEH2_TRY
Definition: pseh2_64.h:71
#define _SEH2_YIELD(__stmt)
Definition: pseh2_64.h:184
USHORT MaximumLength
Definition: env_spec_w32.h:370
uint16_t * PWSTR
Definition: typedefs.h:56
ULONG_PTR SIZE_T
Definition: typedefs.h:80
int ret
_In_ PCCERT_CONTEXT _In_ DWORD dwFlags
Definition: wincrypt.h:1176
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by IntLoadFontsInRegistry(), IntLoadSystemFonts(), and NtGdiAddFontResourceW().

◆ IntGdiCleanupPrivateFontsForProcess()

VOID FASTCALL IntGdiCleanupPrivateFontsForProcess ( VOID  )

Definition at line 2658 of file freetype.c.

2659{
2662 PFONT_ENTRY_COLL_MEM EntryCollection;
2663
2664 DPRINT("IntGdiCleanupPrivateFontsForProcess()\n");
2665 do {
2666 Entry = NULL;
2667 EntryCollection = NULL;
2668
2670 IntLockProcessPrivateFonts(Win32Process);
2671 if (!IsListEmpty(&Win32Process->PrivateMemFontListHead))
2672 {
2673 Entry = Win32Process->PrivateMemFontListHead.Flink;
2674 EntryCollection = CONTAINING_RECORD(Entry, FONT_ENTRY_COLL_MEM, ListEntry);
2675 UnlinkFontMemCollection(EntryCollection);
2676 }
2677 IntUnLockProcessPrivateFonts(Win32Process);
2679
2680 if (EntryCollection)
2681 {
2682 IntGdiCleanupMemEntry(EntryCollection->Entry);
2683 ExFreePoolWithTag(EntryCollection, TAG_FONT);
2684 }
2685 else
2686 {
2687 /* No Mem fonts anymore, see if we have any other private fonts left */
2688 Entry = NULL;
2690 IntLockProcessPrivateFonts(Win32Process);
2691 if (!IsListEmpty(&Win32Process->PrivateFontListHead))
2692 {
2693 Entry = RemoveHeadList(&Win32Process->PrivateFontListHead);
2694 }
2695 IntUnLockProcessPrivateFonts(Win32Process);
2697
2698 if (Entry)
2699 {
2701 }
2702 }
2703
2704 } while (Entry);
2705}
VOID FASTCALL IntGdiCleanupMemEntry(PFONT_ENTRY_MEM Head)
Definition: freetype.c:2586
static VOID FASTCALL UnlinkFontMemCollection(PFONT_ENTRY_COLL_MEM Collection)
Definition: freetype.c:2605
base of all file and directory entries
Definition: entries.h:83
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
LIST_ENTRY PrivateFontListHead
Definition: win32.h:285

Referenced by GdiProcessDestroy().

◆ IntGdiGetFontResourceInfo()

BOOL FASTCALL IntGdiGetFontResourceInfo ( PUNICODE_STRING  FileName,
PVOID  pBuffer,
DWORD pdwBytes,
DWORD  dwType 
)

Definition at line 6178 of file freetype.c.

6183{
6184 UNICODE_STRING EntryFileName;
6185 POBJECT_NAME_INFORMATION NameInfo1 = NULL, NameInfo2 = NULL;
6186 PLIST_ENTRY ListEntry;
6187 PFONT_ENTRY FontEntry;
6188 ULONG Size, i, Count;
6189 LPBYTE pbBuffer;
6190 BOOL IsEqual;
6191 FONTFAMILYINFO *FamInfo;
6192 const ULONG MaxFamInfo = 64;
6193 const ULONG MAX_FAM_INFO_BYTES = sizeof(FONTFAMILYINFO) * MaxFamInfo;
6194 BOOL bSuccess;
6195 const ULONG NAMEINFO_SIZE = sizeof(OBJECT_NAME_INFORMATION) + MAX_PATH * sizeof(WCHAR);
6196
6197 DPRINT("IntGdiGetFontResourceInfo: dwType == %lu\n", dwType);
6198
6199 do
6200 {
6201 /* Create buffer for full path name */
6202 NameInfo1 = ExAllocatePoolWithTag(PagedPool, NAMEINFO_SIZE, TAG_FINF);
6203 if (!NameInfo1)
6204 break;
6205
6206 /* Get the full path name */
6207 if (!IntGetFullFileName(NameInfo1, NAMEINFO_SIZE, FileName))
6208 break;
6209
6210 /* Create a buffer for the entries' names */
6211 NameInfo2 = ExAllocatePoolWithTag(PagedPool, NAMEINFO_SIZE, TAG_FINF);
6212 if (!NameInfo2)
6213 break;
6214
6215 FamInfo = ExAllocatePoolWithTag(PagedPool, MAX_FAM_INFO_BYTES, TAG_FINF);
6216 } while (0);
6217
6218 if (!NameInfo1 || !NameInfo2 || !FamInfo)
6219 {
6220 if (NameInfo2)
6221 ExFreePoolWithTag(NameInfo2, TAG_FINF);
6222
6223 if (NameInfo1)
6224 ExFreePoolWithTag(NameInfo1, TAG_FINF);
6225
6227 return FALSE;
6228 }
6229
6230 Count = 0;
6231
6232 /* Try to find the pathname in the global font list */
6234 for (ListEntry = g_FontListHead.Flink; ListEntry != &g_FontListHead;
6235 ListEntry = ListEntry->Flink)
6236 {
6237 FontEntry = CONTAINING_RECORD(ListEntry, FONT_ENTRY, ListEntry);
6238 if (FontEntry->Font->Filename == NULL)
6239 continue;
6240
6241 RtlInitUnicodeString(&EntryFileName , FontEntry->Font->Filename);
6242 if (!IntGetFullFileName(NameInfo2, NAMEINFO_SIZE, &EntryFileName))
6243 continue;
6244
6245 if (!RtlEqualUnicodeString(&NameInfo1->Name, &NameInfo2->Name, FALSE))
6246 continue;
6247
6248 IsEqual = FALSE;
6249 FontFamilyFillInfo(&FamInfo[Count], FontEntry->FaceName.Buffer,
6250 NULL, FontEntry->Font);
6251 for (i = 0; i < Count; ++i)
6252 {
6253 if (EqualFamilyInfo(&FamInfo[i], &FamInfo[Count]))
6254 {
6255 IsEqual = TRUE;
6256 break;
6257 }
6258 }
6259 if (!IsEqual)
6260 {
6261 /* Found */
6262 ++Count;
6263 if (Count >= MaxFamInfo)
6264 break;
6265 }
6266 }
6268
6269 /* Free the buffers */
6270 ExFreePoolWithTag(NameInfo1, TAG_FINF);
6271 ExFreePoolWithTag(NameInfo2, TAG_FINF);
6272
6273 if (Count == 0 && dwType != 5)
6274 {
6275 /* Font could not be found in system table
6276 dwType == 5 will still handle this */
6277 ExFreePoolWithTag(FamInfo, TAG_FINF);
6278 return FALSE;
6279 }
6280
6281 bSuccess = FALSE;
6282 switch (dwType)
6283 {
6284 case 0: /* FIXME: Returns 1 or 2, don't know what this is atm */
6285 Size = sizeof(DWORD);
6286 if (*pdwBytes == 0)
6287 {
6288 *pdwBytes = Size;
6289 bSuccess = TRUE;
6290 }
6291 else if (pBuffer)
6292 {
6293 if (*pdwBytes >= Size)
6294 {
6295 *(DWORD*)pBuffer = Count;
6296 }
6297 *pdwBytes = Size;
6298 bSuccess = TRUE;
6299 }
6300 break;
6301
6302 case 1: /* copy the font title */
6303 /* calculate the required size */
6304 Size = 0;
6305 for (i = 0; i < Count; ++i)
6306 {
6307 if (i > 0)
6308 Size += 3; /* " & " */
6309 Size += wcslen(FamInfo[i].EnumLogFontEx.elfLogFont.lfFaceName);
6310 if (FamInfo[i].EnumLogFontEx.elfStyle[0] &&
6311 _wcsicmp(FamInfo[i].EnumLogFontEx.elfStyle, L"Regular") != 0)
6312 {
6313 Size += 1 + wcslen(FamInfo[i].EnumLogFontEx.elfStyle);
6314 }
6315 }
6316 Size += 2; /* "\0\0" */
6317 Size *= sizeof(WCHAR);
6318
6319 if (*pdwBytes == 0)
6320 {
6321 *pdwBytes = Size;
6322 bSuccess = TRUE;
6323 }
6324 else if (pBuffer)
6325 {
6326 if (*pdwBytes >= Size)
6327 {
6328 /* store font title to buffer */
6329 WCHAR *psz = pBuffer;
6330 *psz = 0;
6331 for (i = 0; i < Count; ++i)
6332 {
6333 if (i > 0)
6334 wcscat(psz, L" & ");
6335 IntAddNameFromFamInfo(psz, &FamInfo[i]);
6336 }
6337 psz[wcslen(psz) + 1] = UNICODE_NULL;
6338 *pdwBytes = Size;
6339 bSuccess = TRUE;
6340 }
6341 else
6342 {
6343 *pdwBytes = 1024; /* this is confirmed value */
6344 }
6345 }
6346 break;
6347
6348 case 2: /* Copy an array of LOGFONTW */
6349 Size = Count * sizeof(LOGFONTW);
6350 if (*pdwBytes == 0)
6351 {
6352 *pdwBytes = Size;
6353 bSuccess = TRUE;
6354 }
6355 else if (pBuffer)
6356 {
6357 if (*pdwBytes >= Size)
6358 {
6359 pbBuffer = (LPBYTE)pBuffer;
6360 for (i = 0; i < Count; ++i)
6361 {
6362 FamInfo[i].EnumLogFontEx.elfLogFont.lfWidth = 0;
6363 RtlCopyMemory(pbBuffer, &FamInfo[i].EnumLogFontEx.elfLogFont, sizeof(LOGFONTW));
6364 pbBuffer += sizeof(LOGFONTW);
6365 }
6366 }
6367 *pdwBytes = Size;
6368 bSuccess = TRUE;
6369 }
6370 else
6371 {
6372 *pdwBytes = 1024; /* this is confirmed value */
6373 }
6374 break;
6375
6376 case 3:
6377 Size = sizeof(DWORD);
6378 if (*pdwBytes == 0)
6379 {
6380 *pdwBytes = Size;
6381 bSuccess = TRUE;
6382 }
6383 else if (pBuffer)
6384 {
6385 if (*pdwBytes >= Size)
6386 {
6387 /* FIXME: What exactly is copied here? */
6388 *(DWORD*)pBuffer = 1;
6389 }
6390 *pdwBytes = Size;
6391 bSuccess = TRUE;
6392 }
6393 break;
6394
6395 case 4: /* full file path */
6396 if (FileName->Length >= 4 * sizeof(WCHAR))
6397 {
6398 /* The beginning of FileName is \??\ */
6399 LPWSTR pch = FileName->Buffer + 4;
6400 DWORD Length = FileName->Length - 4 * sizeof(WCHAR);
6401
6402 Size = Length + sizeof(WCHAR);
6403 if (*pdwBytes == 0)
6404 {
6405 *pdwBytes = Size;
6406 bSuccess = TRUE;
6407 }
6408 else if (pBuffer)
6409 {
6410 if (*pdwBytes >= Size)
6411 {
6413 }
6414 *pdwBytes = Size;
6415 bSuccess = TRUE;
6416 }
6417 }
6418 break;
6419
6420 case 5: /* Looks like a BOOL that is copied, TRUE, if the font was not found */
6421 Size = sizeof(BOOL);
6422 if (*pdwBytes == 0)
6423 {
6424 *pdwBytes = Size;
6425 bSuccess = TRUE;
6426 }
6427 else if (pBuffer)
6428 {
6429 if (*pdwBytes >= Size)
6430 {
6431 *(BOOL*)pBuffer = Count == 0;
6432 }
6433 *pdwBytes = Size;
6434 bSuccess = TRUE;
6435 }
6436 break;
6437 }
6438 ExFreePoolWithTag(FamInfo, TAG_FINF);
6439
6440 return bSuccess;
6441}
wcscat
#define MAX_PATH
Definition: compat.h:34
@ IsEqual
Definition: fatprocs.h:1887
static BOOL FASTCALL IntGetFullFileName(POBJECT_NAME_INFORMATION NameInfo, ULONG Size, PUNICODE_STRING FileName)
Definition: freetype.c:6101
static BOOL EqualFamilyInfo(const FONTFAMILYINFO *pInfo1, const FONTFAMILYINFO *pInfo2)
Definition: freetype.c:6144
static void FASTCALL FontFamilyFillInfo(PFONTFAMILYINFO Info, LPCWSTR FaceName, LPCWSTR FullName, PFONTGDI FontGDI)
Definition: freetype.c:3524
static VOID IntAddNameFromFamInfo(LPWSTR psz, FONTFAMILYINFO *FamInfo)
Definition: freetype.c:6165
static PWSTR PDWORD pdwBytes
Definition: layerapi.c:35
#define pch(ap)
Definition: match.c:418
#define BOOL
Definition: nt_native.h:43
NTSYSAPI BOOLEAN NTAPI RtlEqualUnicodeString(PUNICODE_STRING String1, PUNICODE_STRING String2, BOOLEAN CaseInSensitive)
struct _OBJECT_NAME_INFORMATION OBJECT_NAME_INFORMATION
#define DWORD
Definition: nt_native.h:44
#define UNICODE_NULL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
struct tagFONTFAMILYINFO FONTFAMILYINFO
#define L(x)
Definition: ntvdm.h:50
PVOID pBuffer
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
LPWSTR Filename
Definition: engobjects.h:151
FONTGDI * Font
Definition: font.h:7
UNICODE_STRING FaceName
Definition: font.h:8
UNICODE_STRING Name
Definition: nt_native.h:1270
ENUMLOGFONTEXW EnumLogFontEx
Definition: ntgdibad.h:47
LONG lfWidth
Definition: wingdi.h:1898
unsigned char * LPBYTE
Definition: typedefs.h:53
#define TAG_FINF
Definition: text.h:3
WCHAR * LPWSTR
Definition: xmlstorage.h:184

Referenced by NtGdiGetFontResourceInfoInternalW().

◆ IntGdiRemoveFontMemResource()

BOOL FASTCALL IntGdiRemoveFontMemResource ( HANDLE  hMMFont)

Definition at line 2622 of file freetype.c.

2623{
2625 PFONT_ENTRY_COLL_MEM CurrentEntry;
2626 PFONT_ENTRY_COLL_MEM EntryCollection = NULL;
2628
2630 IntLockProcessPrivateFonts(Win32Process);
2631 for (Entry = Win32Process->PrivateMemFontListHead.Flink;
2632 Entry != &Win32Process->PrivateMemFontListHead;
2633 Entry = Entry->Flink)
2634 {
2635 CurrentEntry = CONTAINING_RECORD(Entry, FONT_ENTRY_COLL_MEM, ListEntry);
2636
2637 if (CurrentEntry->Handle == hMMFont)
2638 {
2639 EntryCollection = CurrentEntry;
2640 UnlinkFontMemCollection(CurrentEntry);
2641 break;
2642 }
2643 }
2644 IntUnLockProcessPrivateFonts(Win32Process);
2646
2647 if (EntryCollection)
2648 {
2649 IntGdiCleanupMemEntry(EntryCollection->Entry);
2650 ExFreePoolWithTag(EntryCollection, TAG_FONT);
2651 return TRUE;
2652 }
2653 return FALSE;
2654}

Referenced by NtGdiRemoveFontMemResourceEx().

◆ IntGdiRemoveFontResource()

BOOL FASTCALL IntGdiRemoveFontResource ( _In_ PCUNICODE_STRING  FileName,
_In_ DWORD  cFiles,
_In_ DWORD  dwFlags 
)

Definition at line 2338 of file freetype.c.

2342{
2343 PWSTR pchFile = FileName->Buffer;
2344 SIZE_T cchFile;
2345
2346 while (cFiles--)
2347 {
2348 _SEH2_TRY
2349 {
2350 cchFile = wcslen(pchFile);
2351 }
2353 {
2354 _SEH2_YIELD(return FALSE);
2355 }
2356 _SEH2_END;
2357
2358 UNICODE_STRING ustrPathName;
2359 ustrPathName.Length = (USHORT)(cchFile * sizeof(WCHAR));
2360 ustrPathName.MaximumLength = ustrPathName.Length + sizeof(WCHAR);
2361 ustrPathName.Buffer = pchFile;
2362
2364 if (!ret)
2365 return FALSE;
2366
2367 pchFile += cchFile + 1;
2368 }
2369
2370 return TRUE;
2371}
static BOOL FASTCALL IntGdiRemoveFontResourceSingle(_In_ PCUNICODE_STRING FileName, _In_ DWORD dwFlags)
Definition: freetype.c:2330

Referenced by NtGdiRemoveFontResourceW().

◆ IntGetCharDimensions()

DWORD FASTCALL IntGetCharDimensions ( HDC  hdc,
PTEXTMETRICW  ptm,
PDWORD  height 
)

Definition at line 329 of file font.c.

330{
331 PDC pdc;
332 PDC_ATTR pdcattr;
333 PTEXTOBJ TextObj;
334 SIZE sz;
335 TMW_INTERNAL tmwi;
336 BOOL Good;
337
338 static const WCHAR alphabet[] = {
339 'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q',
340 'r','s','t','u','v','w','x','y','z','A','B','C','D','E','F','G','H',
341 'I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z',0};
342
343 if(!ftGdiGetTextMetricsW(hdc, &tmwi)) return 0;
344
345 pdc = DC_LockDc(hdc);
346
347 if (!pdc) return 0;
348
349 pdcattr = pdc->pdcattr;
350
351 TextObj = RealizeFontInit(pdcattr->hlfntNew);
352 if ( !TextObj )
353 {
354 DC_UnlockDc(pdc);
355 return 0;
356 }
357 Good = TextIntGetTextExtentPoint(pdc, TextObj, alphabet, 52, 0, NULL, 0, &sz, 0);
358 TEXTOBJ_UnlockText(TextObj);
359 DC_UnlockDc(pdc);
360
361 if (!Good) return 0;
362 if (ptm) *ptm = tmwi.TextMetric;
363 if (height) *height = tmwi.TextMetric.tmHeight;
364
365 return (sz.cx / 26 + 1) / 2;
366}
LONG cx
Definition: kdterminal.h:27
LONG tmHeight
Definition: wingdi.h:2383

Referenced by co_IntInitializeDesktopGraphics(), IntGetDialogBaseUnits(), MENU_CalcItemSize(), and UserChangeDisplaySettings().

◆ IntGetFontLanguageInfo()

DWORD FASTCALL IntGetFontLanguageInfo ( PDC  Dc)

Definition at line 371 of file font.c.

372{
373 PDC_ATTR pdcattr;
374 FONTSIGNATURE fontsig;
375 static const DWORD GCP_DBCS_MASK=0x003F0000,
376 GCP_DIACRITIC_MASK=0x00000000,
377 FLI_GLYPHS_MASK=0x00000000,
378 GCP_GLYPHSHAPE_MASK=0x00000040,
379 GCP_KASHIDA_MASK=0x00000000,
380 GCP_LIGATE_MASK=0x00000000,
381 GCP_USEKERNING_MASK=0x00000000,
382 GCP_REORDER_MASK=0x00000060;
383
384 DWORD result=0;
385
386 ftGdiGetTextCharsetInfo( Dc, &fontsig, 0 );
387
388 /* We detect each flag we return using a bitmask on the Codepage Bitfields */
389 if( (fontsig.fsCsb[0]&GCP_DBCS_MASK)!=0 )
391
392 if( (fontsig.fsCsb[0]&GCP_DIACRITIC_MASK)!=0 )
394
395 if( (fontsig.fsCsb[0]&FLI_GLYPHS_MASK)!=0 )
397
398 if( (fontsig.fsCsb[0]&GCP_GLYPHSHAPE_MASK)!=0 )
400
401 if( (fontsig.fsCsb[0]&GCP_KASHIDA_MASK)!=0 )
403
404 if( (fontsig.fsCsb[0]&GCP_LIGATE_MASK)!=0 )
406
407 if( (fontsig.fsCsb[0]&GCP_USEKERNING_MASK)!=0 )
409
410 pdcattr = Dc->pdcattr;
411
412 /* This might need a test for a HEBREW- or ARABIC_CHARSET as well */
413 if ( pdcattr->flTextAlign & TA_RTLREADING )
414 if( (fontsig.fsCsb[0]&GCP_REORDER_MASK)!=0 )
416
417 return result;
418}
INT FASTCALL ftGdiGetTextCharsetInfo(PDC Dc, LPFONTSIGNATURE lpSig, DWORD dwFlags)
Definition: freetype.c:5161
GLuint64EXT * result
Definition: glext.h:11304
FLONG flTextAlign
Definition: ntgdihdl.h:324
#define GCP_GLYPHSHAPE
Definition: wingdi.h:833
#define GCP_DIACRITIC
Definition: wingdi.h:831
#define GCP_LIGATE
Definition: wingdi.h:837
#define GCP_USEKERNING
Definition: wingdi.h:845
#define GCP_KASHIDA
Definition: wingdi.h:836
#define FLI_GLYPHS
Definition: wingdi.h:846
#define TA_RTLREADING
Definition: wingdi.h:934
#define GCP_REORDER
Definition: wingdi.h:843
#define GCP_DBCS
Definition: wingdi.h:828

Referenced by NtGdiGetDCDword().

◆ IntGetOutlineTextMetrics()

INT FASTCALL IntGetOutlineTextMetrics ( PFONTGDI  FontGDI,
UINT  Size,
OUTLINETEXTMETRICW Otm,
BOOL  bLocked 
)

Definition at line 3149 of file freetype.c.

3153{
3154 TT_OS2 *pOS2;
3155 TT_HoriHeader *pHori;
3156 TT_Postscript *pPost;
3157 FT_Fixed XScale, YScale;
3158 FT_WinFNT_HeaderRec WinFNT;
3160 BYTE *pb;
3161 FONT_NAMES FontNames;
3162 PSHARED_FACE SharedFace = FontGDI->SharedFace;
3164 FT_Face Face = SharedFace->Face;
3165
3166 if (bLocked)
3168 else
3170
3172 {
3173 Cache = &SharedFace->EnglishUS;
3174 }
3175 else
3176 {
3177 Cache = &SharedFace->UserLanguage;
3178 }
3179
3180 if (Size == 0 && Cache->OutlineRequiredSize > 0)
3181 {
3182 ASSERT(Otm == NULL);
3183 return Cache->OutlineRequiredSize;
3184 }
3185
3186 if (!bLocked)
3188
3189 IntInitFontNames(&FontNames, SharedFace);
3190 Cache->OutlineRequiredSize = FontNames.OtmSize;
3191
3192 if (Size == 0)
3193 {
3194 ASSERT(Otm == NULL);
3195 IntFreeFontNames(&FontNames);
3196 if (!bLocked)
3198 return Cache->OutlineRequiredSize;
3199 }
3200
3201 ASSERT(Otm != NULL);
3202
3203 if (Size < Cache->OutlineRequiredSize)
3204 {
3205 DPRINT1("Size %u < OutlineRequiredSize %u\n", Size,
3206 Cache->OutlineRequiredSize);
3207 IntFreeFontNames(&FontNames);
3208 if (!bLocked)
3210 return 0; /* failure */
3211 }
3212
3213 XScale = Face->size->metrics.x_scale;
3214 YScale = Face->size->metrics.y_scale;
3215
3216 pOS2 = FT_Get_Sfnt_Table(Face, FT_SFNT_OS2);
3217 pHori = FT_Get_Sfnt_Table(Face, FT_SFNT_HHEA);
3218 pPost = FT_Get_Sfnt_Table(Face, FT_SFNT_POST); /* We can live with this failing */
3219 Error = FT_Get_WinFNT_Header(Face, &WinFNT);
3220
3221 if (pOS2 == NULL && Error)
3222 {
3223 if (!bLocked)
3225 DPRINT1("Can't find OS/2 table - not TT font?\n");
3226 IntFreeFontNames(&FontNames);
3227 return 0;
3228 }
3229
3230 if (pHori == NULL && Error)
3231 {
3232 if (!bLocked)
3234 DPRINT1("Can't find HHEA table - not TT font?\n");
3235 IntFreeFontNames(&FontNames);
3236 return 0;
3237 }
3238
3239 Otm->otmSize = Cache->OutlineRequiredSize;
3240
3241 FillTM(&Otm->otmTextMetrics, FontGDI, pOS2, pHori, (Error ? NULL : &WinFNT));
3242
3243 if (!pOS2)
3244 goto skip_os2;
3245
3246 Otm->otmFiller = 0;
3248 Otm->otmfsSelection = pOS2->fsSelection;
3249 Otm->otmfsType = pOS2->fsType;
3250 Otm->otmsCharSlopeRise = pHori->caret_Slope_Rise;
3251 Otm->otmsCharSlopeRun = pHori->caret_Slope_Run;
3252 Otm->otmItalicAngle = 0; /* POST table */
3253 Otm->otmEMSquare = Face->units_per_EM;
3254
3255#define SCALE_X(value) ((FT_MulFix((value), XScale) + 32) >> 6)
3256#define SCALE_Y(value) ((FT_MulFix((value), YScale) + 32) >> 6)
3257
3258 Otm->otmAscent = SCALE_Y(pOS2->sTypoAscender);
3259 Otm->otmDescent = SCALE_Y(pOS2->sTypoDescender);
3260 Otm->otmLineGap = SCALE_Y(pOS2->sTypoLineGap);
3261 Otm->otmsCapEmHeight = SCALE_Y(pOS2->sCapHeight);
3262 Otm->otmsXHeight = SCALE_Y(pOS2->sxHeight);
3263 Otm->otmrcFontBox.left = SCALE_X(Face->bbox.xMin);
3264 Otm->otmrcFontBox.right = SCALE_X(Face->bbox.xMax);
3265 Otm->otmrcFontBox.top = SCALE_Y(Face->bbox.yMax);
3266 Otm->otmrcFontBox.bottom = SCALE_Y(Face->bbox.yMin);
3269 Otm->otmMacLineGap = Otm->otmLineGap;
3270 Otm->otmusMinimumPPEM = 0; /* TT Header */
3281
3282 if (!pPost)
3283 {
3284 Otm->otmsUnderscoreSize = 0;
3285 Otm->otmsUnderscorePosition = 0;
3286 }
3287 else
3288 {
3291 }
3292
3293#undef SCALE_X
3294#undef SCALE_Y
3295
3296skip_os2:
3297 if (!bLocked)
3299
3300 pb = IntStoreFontNames(&FontNames, Otm);
3301 ASSERT(pb - (BYTE*)Otm == Cache->OutlineRequiredSize);
3302
3303 IntFreeFontNames(&FontNames);
3304
3305 return Cache->OutlineRequiredSize;
3306}
BOOLEAN bLocked
Definition: Mke2fs.c:19
#define SCALE_Y(value)
static __inline void FASTCALL IntInitFontNames(FONT_NAMES *Names, PSHARED_FACE SharedFace)
Definition: freetype.c:3076
static __inline BYTE *FASTCALL IntStoreFontNames(const FONT_NAMES *Names, OUTLINETEXTMETRICW *Otm)
Definition: freetype.c:3112
#define SCALE_X(value)
#define ASSERT_FREETYPE_LOCK_HELD()
Definition: freetype.c:374
static __inline void FASTCALL IntFreeFontNames(FONT_NAMES *Names)
Definition: freetype.c:3136
signed long FT_Fixed
Definition: fttypes.h:287
#define LANG_ENGLISH
Definition: nls.h:52
#define PRIMARYLANGID(l)
Definition: nls.h:16
Definition: fatfs.h:173
ULONG OtmSize
Definition: freetype.c:3072
FT_Pos xMin
Definition: ftimage.h:121
FT_Pos yMax
Definition: ftimage.h:122
FT_Pos yMin
Definition: ftimage.h:121
FT_Pos xMax
Definition: ftimage.h:122
FT_Size size
Definition: freetype.h:1079
FT_BBox bbox
Definition: freetype.h:1065
FT_UShort units_per_EM
Definition: freetype.h:1067
FT_Size_Metrics metrics
Definition: freetype.h:1649
FT_Fixed y_scale
Definition: freetype.h:1614
FT_Fixed x_scale
Definition: freetype.h:1613
FT_Short caret_Slope_Run
Definition: tttables.h:214
FT_Short caret_Slope_Rise
Definition: tttables.h:213
FT_Short sTypoDescender
Definition: tttables.h:408
FT_UShort fsSelection
Definition: tttables.h:404
FT_Short ySuperscriptYSize
Definition: tttables.h:388
FT_Short sxHeight
Definition: tttables.h:420
FT_Short yStrikeoutSize
Definition: tttables.h:391
FT_Byte panose[10]
Definition: tttables.h:395
FT_Short ySubscriptXSize
Definition: tttables.h:383
FT_Short sTypoLineGap
Definition: tttables.h:409
FT_Short sTypoAscender
Definition: tttables.h:407
FT_Short ySuperscriptXSize
Definition: tttables.h:387
FT_Short ySubscriptYOffset
Definition: tttables.h:386
FT_Short ySuperscriptYOffset
Definition: tttables.h:390
FT_Short ySubscriptXOffset
Definition: tttables.h:385
FT_Short yStrikeoutPosition
Definition: tttables.h:392
FT_Short sCapHeight
Definition: tttables.h:421
FT_UShort fsType
Definition: tttables.h:382
FT_Short ySuperscriptXOffset
Definition: tttables.h:389
FT_Short ySubscriptYSize
Definition: tttables.h:384
FT_Short underlineThickness
Definition: tttables.h:456
FT_Short underlinePosition
Definition: tttables.h:455
PANOSE otmPanoseNumber
Definition: wingdi.h:2516
POINT otmptSuperscriptOffset
Definition: wingdi.h:2536
POINT otmptSuperscriptSize
Definition: wingdi.h:2535
POINT otmptSubscriptSize
Definition: wingdi.h:2533
int otmsStrikeoutPosition
Definition: wingdi.h:2538
int otmsUnderscorePosition
Definition: wingdi.h:2540
POINT otmptSubscriptOffset
Definition: wingdi.h:2534
UINT otmsStrikeoutSize
Definition: wingdi.h:2537
SHARED_FACE_CACHE UserLanguage
Definition: engobjects.h:136
SHARED_FACE_CACHE EnglishUS
Definition: engobjects.h:135
LONG right
Definition: windef.h:308
LONG bottom
Definition: windef.h:309
LONG top
Definition: windef.h:307
LONG left
Definition: windef.h:306
LONG tmAscent
Definition: wingdi.h:2384
LONG tmDescent
Definition: wingdi.h:2385
@ FT_SFNT_HHEA
Definition: tttables.h:626
@ FT_SFNT_POST
Definition: tttables.h:628
@ FT_SFNT_OS2
Definition: tttables.h:625
#define PANOSE_COUNT
Definition: wingdi.h:453

Referenced by FindBestFontFromList(), FontFamilyFillInfo(), ftGdiGetGlyphOutline(), NtGdiGetGlyphIndicesW(), and NtGdiGetOutlineTextMetricsInternalW().

◆ IntIsFontRenderingEnabled()

BOOL FASTCALL IntIsFontRenderingEnabled ( VOID  )

Definition at line 2708 of file freetype.c.

2709{
2710 return (gpsi->BitsPixel > 8) && g_RenderingEnabled;
2711}
PSERVERINFO gpsi
Definition: imm.c:18

Referenced by IntExtTextOutW(), and TextIntGetTextExtentPoint().

◆ IntLoadFontsInRegistry()

BOOL FASTCALL IntLoadFontsInRegistry ( VOID  )

Definition at line 2384 of file freetype.c.

2385{
2389 KEY_FULL_INFORMATION KeyFullInfo;
2390 ULONG i, Length;
2391 UNICODE_STRING FontTitleW, FileNameW;
2392 SIZE_T InfoSize;
2393 LPBYTE InfoBuffer;
2395 LPWSTR pchPath;
2397 INT nFontCount = 0;
2398 DWORD dwFlags;
2399
2400 /* open registry key */
2403 NULL, NULL);
2404 Status = ZwOpenKey(&KeyHandle, KEY_READ, &ObjectAttributes);
2405 if (!NT_SUCCESS(Status))
2406 {
2407 DPRINT1("ZwOpenKey failed: 0x%08X\n", Status);
2408 return FALSE; /* failure */
2409 }
2410
2411 /* query count of values */
2412 Status = ZwQueryKey(KeyHandle, KeyFullInformation,
2413 &KeyFullInfo, sizeof(KeyFullInfo), &Length);
2414 if (!NT_SUCCESS(Status))
2415 {
2416 DPRINT1("ZwQueryKey failed: 0x%08X\n", Status);
2418 return FALSE; /* failure */
2419 }
2420
2421 /* allocate buffer */
2422 InfoSize = (MAX_PATH + 256) * sizeof(WCHAR);
2423 InfoBuffer = ExAllocatePoolWithTag(PagedPool, InfoSize, TAG_FONT);
2424 if (!InfoBuffer)
2425 {
2426 DPRINT1("ExAllocatePoolWithTag failed\n");
2428 return FALSE;
2429 }
2430
2431 /* for each value */
2432 for (i = 0; i < KeyFullInfo.Values; ++i)
2433 {
2434 /* get value name */
2435 Status = ZwEnumerateValueKey(KeyHandle, i, KeyValueFullInformation,
2436 InfoBuffer, InfoSize, &Length);
2438 {
2439 /* too short buffer */
2440 ExFreePoolWithTag(InfoBuffer, TAG_FONT);
2441 InfoSize *= 2;
2442 InfoBuffer = ExAllocatePoolWithTag(PagedPool, InfoSize, TAG_FONT);
2443 if (!InfoBuffer)
2444 {
2445 DPRINT1("ExAllocatePoolWithTag failed\n");
2446 break;
2447 }
2448 /* try again */
2449 Status = ZwEnumerateValueKey(KeyHandle, i, KeyValueFullInformation,
2450 InfoBuffer, InfoSize, &Length);
2451 }
2452 if (!NT_SUCCESS(Status))
2453 {
2454 DPRINT1("ZwEnumerateValueKey failed: 0x%08X\n", Status);
2455 break; /* failure */
2456 }
2457
2458 /* create FontTitleW string */
2459 pInfo = (PKEY_VALUE_FULL_INFORMATION)InfoBuffer;
2460 Length = pInfo->NameLength / sizeof(WCHAR);
2461 pInfo->Name[Length] = UNICODE_NULL; /* truncate */
2462 if (!RtlCreateUnicodeString(&FontTitleW, pInfo->Name))
2463 {
2465 DPRINT1("RtlCreateUnicodeString failed\n");
2466 break; /* failure */
2467 }
2468
2469 /* query value */
2470 Status = ZwQueryValueKey(KeyHandle, &FontTitleW, KeyValueFullInformation,
2471 InfoBuffer, InfoSize, &Length);
2473 {
2474 /* too short buffer */
2475 ExFreePoolWithTag(InfoBuffer, TAG_FONT);
2476 InfoSize *= 2;
2477 InfoBuffer = ExAllocatePoolWithTag(PagedPool, InfoSize, TAG_FONT);
2478 if (!InfoBuffer)
2479 {
2480 DPRINT1("ExAllocatePoolWithTag failed\n");
2481 break;
2482 }
2483 /* try again */
2484 Status = ZwQueryValueKey(KeyHandle, &FontTitleW, KeyValueFullInformation,
2485 InfoBuffer, InfoSize, &Length);
2486 }
2487 pInfo = (PKEY_VALUE_FULL_INFORMATION)InfoBuffer;
2488 if (!NT_SUCCESS(Status) || !pInfo->DataLength)
2489 {
2490 DPRINT1("ZwQueryValueKey failed: 0x%08X\n", Status);
2491 RtlFreeUnicodeString(&FontTitleW);
2492 break; /* failure */
2493 }
2494
2495 /* Build pchPath */
2496 pchPath = (LPWSTR)((PUCHAR)pInfo + pInfo->DataOffset);
2497 Length = pInfo->DataLength / sizeof(WCHAR);
2498 pchPath[Length] = UNICODE_NULL; /* truncate */
2499
2500 /* Load font(s) without writing registry */
2501 if (PathIsRelativeW(pchPath))
2502 {
2503 dwFlags = 0;
2505 L"\\SystemRoot\\Fonts\\%s", pchPath);
2506 }
2507 else
2508 {
2510 Status = RtlStringCbCopyW(szPath, sizeof(szPath), pchPath);
2511 }
2512
2513 if (NT_SUCCESS(Status))
2514 {
2515 RtlCreateUnicodeString(&FileNameW, szPath);
2516 nFontCount += IntGdiAddFontResourceEx(&FileNameW, 1, 0, dwFlags);
2517 RtlFreeUnicodeString(&FileNameW);
2518 }
2519
2520 RtlFreeUnicodeString(&FontTitleW);
2521 }
2522
2523 /* close now */
2525
2526 /* free memory block */
2527 if (InfoBuffer)
2528 {
2529 ExFreePoolWithTag(InfoBuffer, TAG_FONT);
2530 }
2531
2532 return (KeyFullInfo.Values != 0 && nFontCount != 0);
2533}
NTSYSAPI BOOLEAN NTAPI RtlCreateUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
static UNICODE_STRING g_FontRegPath
Definition: freetype.c:363
INT FASTCALL IntGdiAddFontResourceEx(_In_ PCUNICODE_STRING FileName, _In_ DWORD cFiles, _In_ DWORD Characteristics, _In_ DWORD dwFlags)
Definition: freetype.c:2291
BOOL WINAPI PathIsRelativeW(LPCWSTR lpszPath)
Definition: freetype.c:2374
#define OBJ_KERNEL_HANDLE
Definition: winternl.h:231
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
LPCWSTR szPath
Definition: env.c:37
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
NTSYSAPI NTSTATUS NTAPI ZwClose(_In_ HANDLE Handle)
@ KeyFullInformation
Definition: nt_native.h:1133
@ KeyValueFullInformation
Definition: nt_native.h:1181
#define KEY_READ
Definition: nt_native.h:1023
struct _KEY_VALUE_FULL_INFORMATION * PKEY_VALUE_FULL_INFORMATION
NTSTRSAFEAPI RtlStringCbCopyW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
Definition: ntstrsafe.h:174
NTSTRSAFEVAPI RtlStringCbPrintfW(_Out_writes_bytes_(cbDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cbDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1173
#define STATUS_BUFFER_TOO_SMALL
Definition: shellext.h:69
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
unsigned char * PUCHAR
Definition: typedefs.h:53
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define AFRX_DOS_DEVICE_PATH
Definition: text.h:106
#define AFRX_ALTERNATIVE_PATH
Definition: text.h:105

Referenced by InitFontSupport().

◆ IntLoadSystemFonts()

VOID FASTCALL IntLoadSystemFonts ( VOID  )

Definition at line 1564 of file freetype.c.

1565{
1567 UNICODE_STRING Directory, FileName, TempString;
1569 HANDLE hDirectory;
1570 BYTE *DirInfoBuffer;
1572 BOOLEAN bRestartScan = TRUE;
1574 INT i;
1575 static UNICODE_STRING SearchPatterns[] =
1576 {
1577 RTL_CONSTANT_STRING(L"*.ttf"),
1578 RTL_CONSTANT_STRING(L"*.ttc"),
1579 RTL_CONSTANT_STRING(L"*.otf"),
1580 RTL_CONSTANT_STRING(L"*.otc"),
1581 RTL_CONSTANT_STRING(L"*.fon"),
1582 RTL_CONSTANT_STRING(L"*.fnt")
1583 };
1584 static UNICODE_STRING IgnoreFiles[] =
1585 {
1588 };
1589
1590 RtlInitUnicodeString(&Directory, L"\\SystemRoot\\Fonts\\");
1591
1594 &Directory,
1596 NULL,
1597 NULL);
1598
1600 &hDirectory,
1603 &Iosb,
1606
1607 if (NT_SUCCESS(Status))
1608 {
1609 for (i = 0; i < _countof(SearchPatterns); ++i)
1610 {
1611 DirInfoBuffer = ExAllocatePoolWithTag(PagedPool, 0x4000, TAG_FONT);
1612 if (DirInfoBuffer == NULL)
1613 {
1614 ZwClose(hDirectory);
1615 return;
1616 }
1617
1619 if (FileName.Buffer == NULL)
1620 {
1621 ExFreePoolWithTag(DirInfoBuffer, TAG_FONT);
1622 ZwClose(hDirectory);
1623 return;
1624 }
1625 FileName.Length = 0;
1626 FileName.MaximumLength = MAX_PATH * sizeof(WCHAR);
1627
1628 while (1)
1629 {
1630 Status = ZwQueryDirectoryFile(
1631 hDirectory,
1632 NULL,
1633 NULL,
1634 NULL,
1635 &Iosb,
1636 DirInfoBuffer,
1637 0x4000,
1639 FALSE,
1640 &SearchPatterns[i],
1641 bRestartScan);
1642
1644 {
1645 break;
1646 }
1647
1648 DirInfo = (PFILE_DIRECTORY_INFORMATION)DirInfoBuffer;
1649 while (1)
1650 {
1651 SIZE_T ign;
1652
1653 TempString.Buffer = DirInfo->FileName;
1654 TempString.Length = TempString.MaximumLength = DirInfo->FileNameLength;
1655
1656 /* Should we ignore this file? */
1657 for (ign = 0; ign < _countof(IgnoreFiles); ++ign)
1658 {
1659 /* Yes.. */
1660 if (RtlEqualUnicodeString(IgnoreFiles + ign, &TempString, FALSE))
1661 break;
1662 }
1663
1664 /* If we tried all Ignore patterns and there was no match, try to create a font */
1665 if (ign == _countof(IgnoreFiles))
1666 {
1670 DPRINT1("ERR: Failed to load %wZ\n", &FileName);
1671 }
1672
1673 if (DirInfo->NextEntryOffset == 0)
1674 break;
1675
1676 DirInfo = (PFILE_DIRECTORY_INFORMATION)((ULONG_PTR)DirInfo + DirInfo->NextEntryOffset);
1677 }
1678
1679 bRestartScan = FALSE;
1680 }
1681
1683 ExFreePoolWithTag(DirInfoBuffer, TAG_FONT);
1684 }
1685 ZwClose(hDirectory);
1686 }
1687}
@ IgnoreFiles
Definition: ACListISF.cpp:75
unsigned char BOOLEAN
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
#define FILE_SHARE_READ
Definition: compat.h:136
return Iosb
Definition: create.c:4403
struct _FileName FileName
Definition: fatprocs.h:897
@ FileDirectoryInformation
Definition: from_kernel.h:62
#define FILE_SYNCHRONOUS_IO_NONALERT
Definition: from_kernel.h:31
struct _FILE_DIRECTORY_INFORMATION * PFILE_DIRECTORY_INFORMATION
NTSYSAPI NTSTATUS NTAPI ZwOpenFile(_Out_ PHANDLE FileHandle, _In_ ACCESS_MASK DesiredAccess, _In_ POBJECT_ATTRIBUTES ObjectAttributes, _Out_ PIO_STATUS_BLOCK IoStatusBlock, _In_ ULONG ShareAccess, _In_ ULONG OpenOptions)
NTSYSAPI VOID NTAPI RtlCopyUnicodeString(PUNICODE_STRING DestinationString, PUNICODE_STRING SourceString)
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define SYNCHRONIZE
Definition: nt_native.h:61
NTSYSAPI NTSTATUS NTAPI RtlAppendUnicodeStringToString(PUNICODE_STRING Destination, PUNICODE_STRING Source)
#define FILE_LIST_DIRECTORY
Definition: nt_native.h:629
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define _countof(array)
Definition: sndvol32.h:70
base for all directory entries
Definition: entries.h:138
WCHAR FileName[ANYSIZE_ARRAY]
Definition: winternl.h:524
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STATUS_NO_MORE_FILES
Definition: udferr_usr.h:128
#define AFRX_WRITE_REGISTRY
Definition: text.h:104

Referenced by InitFontSupport().

◆ RealizeFontInit()

◆ TextIntCreateFontIndirect()

NTSTATUS FASTCALL TextIntCreateFontIndirect ( CONST LPLOGFONTW  lf,
HFONT NewFont 
)

Definition at line 2742 of file freetype.c.

2743{
2744 PLFONT plfont;
2745 LOGFONTW *plf;
2746
2747 ASSERT(lf);
2748 plfont = LFONT_AllocFontWithHandle();
2749 if (!plfont)
2750 {
2751 return STATUS_NO_MEMORY;
2752 }
2753
2754 ExInitializePushLock(&plfont->lock);
2755 *NewFont = plfont->BaseObject.hHmgr;
2756 plf = &plfont->logfont.elfEnumLogfontEx.elfLogFont;
2757 RtlCopyMemory(plf, lf, sizeof(LOGFONTW));
2758 if (lf->lfEscapement != lf->lfOrientation)
2759 {
2760 /* This should really depend on whether GM_ADVANCED is set */
2761 plf->lfOrientation = plf->lfEscapement;
2762 }
2763 LFONT_UnlockFont(plfont);
2764
2765 return STATUS_SUCCESS;
2766}
HGDIOBJ hHmgr(VOID)
Definition: baseobj.hpp:95
#define STATUS_NO_MEMORY
Definition: d3dkmdt.h:51
#define ExInitializePushLock
Definition: ex.h:1016
LONG lfEscapement
Definition: dimm.idl:61
BASEOBJECT BaseObject
Definition: text.h:63
EX_PUSH_LOCK lock
Definition: text.h:71
#define LFONT_UnlockFont(plfnt)
Definition: text.h:79
#define LFONT_AllocFontWithHandle()
Definition: text.h:76

Referenced by CreateStockFonts(), and UserDrawCaptionText().

◆ TextIntGetTextExtentPoint()

BOOL FASTCALL TextIntGetTextExtentPoint ( PDC  dc,
PTEXTOBJ  TextObj,
LPCWSTR  String,
INT  Count,
ULONG  MaxExtent,
LPINT  Fit,
LPINT  Dx,
LPSIZE  Size,
FLONG  fl 
)

Definition at line 5039 of file freetype.c.

5048{
5049 PFONTGDI FontGDI;
5050 FT_BitmapGlyph realglyph;
5051 INT glyph_index, i, previous, nTenthsOfDegrees;
5052 ULONGLONG TotalWidth64 = 0;
5053 LOGFONTW *plf;
5054 BOOL use_kerning, bVerticalWriting;
5055 LONG ascender, descender;
5057 DWORD ch0, ch1;
5058 FONTLINK_CHAIN Chain;
5059
5060 FontGDI = ObjToGDI(TextObj->Font, FONT);
5061
5062 Cache.Hashed.Face = FontGDI->SharedFace->Face;
5063 if (NULL != Fit)
5064 {
5065 *Fit = 0;
5066 }
5067
5068 plf = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
5069 Cache.Hashed.lfHeight = plf->lfHeight;
5070 Cache.Hashed.lfWidth = plf->lfWidth;
5071 Cache.Hashed.Aspect.Emu.Bold = EMUBOLD_NEEDED(FontGDI->OriginalWeight, plf->lfWeight);
5072 Cache.Hashed.Aspect.Emu.Italic = (plf->lfItalic && !FontGDI->OriginalItalic);
5073
5074 // Check vertical writing (tategaki)
5075 nTenthsOfDegrees = IntNormalizeAngle(plf->lfEscapement - plf->lfOrientation);
5076 bVerticalWriting = ((nTenthsOfDegrees == 90 * 10) || (nTenthsOfDegrees == 270 * 10));
5077
5079 Cache.Hashed.Aspect.RenderMode = (BYTE)IntGetFontRenderMode(plf);
5080 else
5081 Cache.Hashed.Aspect.RenderMode = (BYTE)FT_RENDER_MODE_MONO;
5082
5083 // NOTE: GetTextExtentPoint32 simply ignores lfEscapement and XFORM.
5085 TextIntUpdateSize(dc, TextObj, FontGDI, FALSE);
5086 Cache.Hashed.matTransform = identityMat;
5087 FT_Set_Transform(Cache.Hashed.Face, NULL, NULL);
5088
5089 FontLink_Chain_Init(&Chain, TextObj, Cache.Hashed.Face);
5090
5091 use_kerning = FT_HAS_KERNING(Cache.Hashed.Face);
5092 previous = 0;
5093
5094 for (i = 0; i < Count; i++)
5095 {
5096 ch0 = *String++;
5097 if (IS_HIGH_SURROGATE(ch0))
5098 {
5099 ++i;
5100 if (i >= Count)
5101 break;
5102
5103 ch1 = *String++;
5104 if (IS_LOW_SURROGATE(ch1))
5105 ch0 = Utf32FromSurrogatePair(ch0, ch1);
5106 }
5107
5108 glyph_index = FontLink_Chain_FindGlyph(&Chain, &Cache, &Cache.Hashed.Face, ch0,
5109 (fl & GTEF_INDICES));
5110 Cache.Hashed.GlyphIndex = glyph_index;
5111
5112 realglyph = IntGetRealGlyph(&Cache);
5113 if (!realglyph)
5114 break;
5115
5116 /* Retrieve kerning distance */
5117 if (use_kerning && previous && glyph_index)
5118 {
5119 FT_Vector delta;
5120 FT_Get_Kerning(Cache.Hashed.Face, previous, glyph_index, 0, &delta);
5121 TotalWidth64 += delta.x;
5122 }
5123
5124 TotalWidth64 += realglyph->root.advance.x >> 10;
5125
5126 if (((TotalWidth64 + 32) >> 6) <= MaxExtent && NULL != Fit)
5127 {
5128 *Fit = i + 1;
5129 }
5130 if (NULL != Dx)
5131 {
5132 Dx[i] = (TotalWidth64 + 32) >> 6;
5133 }
5134
5135 previous = glyph_index;
5136 }
5137 ASSERT(FontGDI->Magic == FONTGDI_MAGIC);
5138 ascender = FontGDI->tmAscent; /* Units above baseline */
5139 descender = FontGDI->tmDescent; /* Units below baseline */
5141
5142 if (bVerticalWriting)
5143 {
5144 Size->cx = ascender + descender;
5145 Size->cy = (TotalWidth64 + 32) >> 6;
5146 }
5147 else
5148 {
5149 Size->cx = (TotalWidth64 + 32) >> 6;
5150 Size->cy = ascender + descender;
5151 }
5152
5153 FontLink_Chain_Finish(&Chain);
5154
5155 return TRUE;
5156}
#define FONTGDI_MAGIC
Definition: engobjects.h:171
static UINT FontLink_Chain_FindGlyph(_Inout_ PFONTLINK_CHAIN pChain, _Out_ PFONT_CACHE_ENTRY pCache, _Inout_ FT_Face *pFace, _In_ UINT code, _In_ BOOL fCodeAsIndex)
Definition: freetype.c:4451
#define IS_HIGH_SURROGATE(ch0)
Definition: freetype.c:334
static DWORD Utf32FromSurrogatePair(DWORD ch0, DWORD ch1)
Definition: freetype.c:338
#define IS_LOW_SURROGATE(ch1)
Definition: freetype.c:335
#define EMUBOLD_NEEDED(original, request)
Definition: freetype.c:349
static LONG IntNormalizeAngle(LONG nTenthsOfDegrees)
Definition: freetype.c:1110
static FT_BitmapGlyph IntGetRealGlyph(IN OUT PFONT_CACHE_ENTRY Cache)
Definition: freetype.c:4999
BOOL FASTCALL IntIsFontRenderingEnabled(VOID)
Definition: freetype.c:2708
static VOID FontLink_Chain_Finish(_Inout_ PFONTLINK_CHAIN pChain)
Definition: freetype.c:277
static VOID FontLink_Chain_Init(_Out_ PFONTLINK_CHAIN pChain, _Inout_ PTEXTOBJ pTextObj, _In_ FT_Face face)
Definition: freetype.c:1297
FT_Render_Mode FASTCALL IntGetFontRenderMode(LOGFONTW *logfont)
Definition: freetype.c:2720
@ FT_RENDER_MODE_MONO
Definition: freetype.h:3258
#define GTEF_INDICES
Definition: ntgdityp.h:213
FT_GlyphRec root
Definition: ftglyph.h:170
FT_Vector advance
Definition: ftglyph.h:118
BYTE lfItalic
Definition: dimm.idl:64
LONG lfWeight
Definition: dimm.idl:63
LONG tmAscent
Definition: engobjects.h:162
LONG tmDescent
Definition: engobjects.h:163
BYTE OriginalItalic
Definition: engobjects.h:156
LONG OriginalWeight
Definition: engobjects.h:157
LONG Magic
Definition: engobjects.h:165
uint64_t ULONGLONG
Definition: typedefs.h:67

Referenced by GreGetTextExtentExW(), GreGetTextExtentW(), IntExtTextOutW(), IntGetCharDimensions(), and NtGdiGetTextExtentExW().

◆ TextIntRealizeFont()

NTSTATUS FASTCALL TextIntRealizeFont ( HFONT  FontHandle,
PTEXTOBJ  pTextObj 
)

Definition at line 5988 of file freetype.c.

5989{
5991 PTEXTOBJ TextObj;
5992 PPROCESSINFO Win32Process;
5993 ULONG MatchPenalty;
5994 LOGFONTW *pLogFont;
5995 LOGFONTW SubstitutedLogFont;
5996
5997 if (!pTextObj)
5998 {
5999 TextObj = TEXTOBJ_LockText(FontHandle);
6000 if (NULL == TextObj)
6001 {
6002 return STATUS_INVALID_HANDLE;
6003 }
6004
6005 if (TextObj->fl & TEXTOBJECT_INIT)
6006 {
6007 TEXTOBJ_UnlockText(TextObj);
6008 return STATUS_SUCCESS;
6009 }
6010 }
6011 else
6012 {
6013 TextObj = pTextObj;
6014 }
6015
6016 pLogFont = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
6017
6018 /* substitute */
6019 SubstitutedLogFont = *pLogFont;
6020 SubstituteFontRecurse(&SubstitutedLogFont);
6021 DPRINT("Font '%S,%u' is substituted by '%S,%u'.\n",
6022 pLogFont->lfFaceName, pLogFont->lfCharSet,
6023 SubstitutedLogFont.lfFaceName, SubstitutedLogFont.lfCharSet);
6024
6025 MatchPenalty = 0xFFFFFFFF;
6026 TextObj->Font = NULL;
6027
6028 Win32Process = PsGetCurrentProcessWin32Process();
6029
6030 /* Search private fonts */
6032 IntLockProcessPrivateFonts(Win32Process);
6033 FindBestFontFromList(&TextObj->Font, &MatchPenalty, &SubstitutedLogFont,
6034 &Win32Process->PrivateFontListHead);
6035 IntUnLockProcessPrivateFonts(Win32Process);
6036
6037 /* Search system fonts */
6038 FindBestFontFromList(&TextObj->Font, &MatchPenalty, &SubstitutedLogFont,
6039 &g_FontListHead);
6041
6042 if (NULL == TextObj->Font)
6043 {
6044 DPRINT1("Request font %S not found, no fonts loaded at all\n",
6045 pLogFont->lfFaceName);
6047 }
6048 else
6049 {
6051 PFONTGDI FontGdi = ObjToGDI(TextObj->Font, FONT);
6052 PSHARED_FACE SharedFace = FontGdi->SharedFace;
6053
6054 TextObj->TextFace[0] = UNICODE_NULL;
6056 if (MatchFontNames(SharedFace, SubstitutedLogFont.lfFaceName))
6057 {
6059 RtlStringCchCopyW(TextObj->TextFace, _countof(TextObj->TextFace), pLogFont->lfFaceName);
6060 }
6061 else
6062 {
6066 if (NT_SUCCESS(Status))
6067 {
6068 /* truncated copy */
6069 IntUnicodeStringToBuffer(TextObj->TextFace, sizeof(TextObj->TextFace), &Name);
6071 }
6072 }
6073
6074 // Need hdev, when freetype is loaded need to create DEVOBJ for
6075 // Consumer and Producer.
6076 TextObj->Font->iUniq = 1; // Now it can be cached.
6077 IntFontType(FontGdi);
6078 FontGdi->flType = TextObj->Font->flFontType;
6079 FontGdi->RequestUnderline = pLogFont->lfUnderline ? 0xFF : 0;
6080 FontGdi->RequestStrikeOut = pLogFont->lfStrikeOut ? 0xFF : 0;
6081 FontGdi->RequestItalic = pLogFont->lfItalic ? 0xFF : 0;
6082 if (pLogFont->lfWeight != FW_DONTCARE)
6083 FontGdi->RequestWeight = pLogFont->lfWeight;
6084 else
6085 FontGdi->RequestWeight = FW_NORMAL;
6086
6087 TextObj->fl |= TEXTOBJECT_INIT;
6089 }
6090
6091 if (!pTextObj) TEXTOBJ_UnlockText(TextObj);
6092
6093 ASSERT((NT_SUCCESS(Status) ^ (NULL == TextObj->Font)) != 0);
6094
6095 return Status;
6096}
LPWSTR Name
Definition: desk.c:124
static VOID FASTCALL IntFontType(PFONTGDI Font)
Definition: freetype.c:5903
static __inline VOID FindBestFontFromList(FONTOBJ **FontObj, ULONG *MatchPenalty, const LOGFONTW *LogFont, const PLIST_ENTRY Head)
Definition: freetype.c:5834
static VOID IntUnicodeStringToBuffer(LPWSTR pszBuffer, SIZE_T cbBuffer, const UNICODE_STRING *pString)
Definition: freetype.c:1221
static BOOL MatchFontNames(PSHARED_FACE SharedFace, LPCWSTR lfFaceName)
Definition: freetype.c:5961
static NTSTATUS IntGetFontLocalizedName(PUNICODE_STRING pNameW, PSHARED_FACE SharedFace, FT_UShort NameID, FT_UShort LangID)
Definition: freetype.c:3368
static BOOL SubstituteFontRecurse(PLOGFONTW pLogFont)
Definition: freetype.c:1261
#define TT_NAME_ID_FONT_FAMILY
Definition: font.c:3536
NTSTRSAFEAPI RtlStringCchCopyW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
Definition: ntstrsafe.h:127
#define STATUS_NOT_FOUND
Definition: shellext.h:72
BYTE lfStrikeOut
Definition: dimm.idl:66
WCHAR lfFaceName[LF_FACESIZE]
Definition: dimm.idl:72
BYTE lfUnderline
Definition: dimm.idl:65
BYTE lfCharSet
Definition: dimm.idl:67
BYTE RequestItalic
Definition: engobjects.h:154
LONG RequestWeight
Definition: engobjects.h:155
BYTE RequestStrikeOut
Definition: engobjects.h:153
FLONG flType
Definition: engobjects.h:142
BYTE RequestUnderline
Definition: engobjects.h:152
ULONG iUniq
Definition: winddi.h:762
FLONG flFontType
Definition: winddi.h:765
WCHAR TextFace[LF_FACESIZE]
Definition: text.h:67
#define FW_DONTCARE
Definition: wingdi.h:368
#define FW_NORMAL
Definition: wingdi.h:373

Referenced by DC_hSelectFont(), DC_InitHack(), FontGetObject(), and RealizeFontInit().

◆ TextIntUpdateSize()

BOOL FASTCALL TextIntUpdateSize ( PDC  dc,
PTEXTOBJ  TextObj,
PFONTGDI  FontGDI,
BOOL  bDoLock 
)

Definition at line 4302 of file freetype.c.

4306{
4307 FT_Face face;
4308 INT error, n;
4309 FT_CharMap charmap, found;
4310 LOGFONTW *plf;
4311
4312 if (bDoLock)
4314
4315 face = FontGDI->SharedFace->Face;
4316 if (face->charmap == NULL)
4317 {
4318 DPRINT("WARNING: No charmap selected!\n");
4319 DPRINT("This font face has %d charmaps\n", face->num_charmaps);
4320
4321 found = NULL;
4322 for (n = 0; n < face->num_charmaps; n++)
4323 {
4324 charmap = face->charmaps[n];
4325 if (charmap->encoding == FT_ENCODING_UNICODE)
4326 {
4327 found = charmap;
4328 break;
4329 }
4330 }
4331 if (!found)
4332 {
4333 for (n = 0; n < face->num_charmaps; n++)
4334 {
4335 charmap = face->charmaps[n];
4336 if (charmap->platform_id == TT_PLATFORM_APPLE_UNICODE)
4337 {
4338 found = charmap;
4339 break;
4340 }
4341 }
4342 }
4343 if (!found)
4344 {
4345 for (n = 0; n < face->num_charmaps; n++)
4346 {
4347 charmap = face->charmaps[n];
4348 if (charmap->encoding == FT_ENCODING_MS_SYMBOL)
4349 {
4350 found = charmap;
4351 break;
4352 }
4353 }
4354 }
4355 if (!found && face->num_charmaps > 0)
4356 {
4357 found = face->charmaps[0];
4358 }
4359 if (!found)
4360 {
4361 DPRINT1("WARNING: Could not find desired charmap!\n");
4362 }
4363 else
4364 {
4365 DPRINT("Found charmap encoding: %i\n", found->encoding);
4366 error = FT_Set_Charmap(face, found);
4367 if (error)
4368 {
4369 DPRINT1("WARNING: Could not set the charmap!\n");
4370 }
4371 }
4372 }
4373
4374 plf = &TextObj->logfont.elfEnumLogfontEx.elfLogFont;
4375
4376 error = IntRequestFontSize(dc, FontGDI, plf->lfWidth, plf->lfHeight);
4377
4378 if (bDoLock)
4380
4381 if (error)
4382 {
4383 DPRINT1("Error in setting pixel sizes: %d\n", error);
4384 return FALSE;
4385 }
4386
4387 return TRUE;
4388}
WORD face[3]
Definition: mesh.c:4747
#define TT_PLATFORM_APPLE_UNICODE
Definition: font.c:1172
FT_Set_Charmap(FT_Face face, FT_CharMap charmap)
Definition: ftobjs.c:3544
GLdouble n
Definition: glext.h:7729
FT_UShort platform_id
Definition: freetype.h:837

Referenced by ftGdiGetGlyphOutline(), IntExtTextOutW(), NtGdiGetOutlineTextMetricsInternalW(), and TextIntGetTextExtentPoint().

◆ TEXTOBJ_LockText()

FORCEINLINE PTEXTOBJ TEXTOBJ_LockText ( HFONT  hfont)

Definition at line 83 of file text.h.

84{
86 if (plfnt != 0)
87 {
90 }
91 return plfnt;
92}
static HFONT hfont
FORCEINLINE VOID ExAcquirePushLockExclusive(PEX_PUSH_LOCK PushLock)
Definition: ex.h:1039
#define KeEnterCriticalRegion()
Definition: ke_x.h:88
#define LFONT_ShareLockFont(hfont)
Definition: text.h:77

Referenced by RealizeFontInit(), and TextIntRealizeFont().

◆ TEXTOBJ_UnlockText()