ReactOS 0.4.16-dev-125-g798ea90
ftfd.h File Reference
#include <stdarg.h>
#include <windef.h>
#include <wingdi.h>
#include <winddi.h>
#include <ft2build.h>
Include dependency graph for ftfd.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  FTFD_CHARPAIR
 
struct  FTFD_FILE
 
struct  FTFD_IFIMETRICS
 

Macros

#define TAG_GLYPHSET   'GlSt'
 
#define TAG_IFIMETRICS   'Ifim'
 
#define MAX_STYLESIZE   35
 

Typedefs

typedef struct FTFD_FILEPFTFD_FILE
 
typedef struct FTFD_IFIMETRICSPFTFD_IFIMETRICS
 

Functions

ULONG DbgPrint (IN PCCH Format, IN ...)
 
DHPDEV APIENTRY FtfdEnablePDEV (IN DEVMODEW *pdm, IN LPWSTR pwszLogAddress, IN ULONG cPat, OUT HSURF *phsurfPatterns, IN ULONG cjCaps, OUT ULONG *pdevcaps, IN ULONG cjDevInfo, OUT DEVINFO *pdi, IN HDEV hdev, IN LPWSTR pwszDeviceName, IN HANDLE hDriver)
 
VOID APIENTRY FtfdCompletePDEV (IN DHPDEV dhpdev, IN HDEV hdev)
 
VOID APIENTRY FtfdDisablePDEV (IN DHPDEV dhpdev)
 
ULONG_PTR APIENTRY FtfdLoadFontFile (ULONG cFiles, ULONG_PTR *piFile, PVOID *ppvView, ULONG *pcjView, DESIGNVECTOR *pdv, ULONG ulLangID, ULONG ulFastCheckSum)
 
BOOL APIENTRY FtfdUnloadFontFile (IN ULONG_PTR iFile)
 
LONG APIENTRY FtfdQueryFontFile (ULONG_PTR iFile, ULONG ulMode, ULONG cjBuf, ULONG *pulBuf)
 
LONG APIENTRY FtfdQueryFontCaps (ULONG culCaps, ULONG *pulCaps)
 
PVOID APIENTRY FtfdQueryFontTree (DHPDEV dhpdev, ULONG_PTR iFile, ULONG iFace, ULONG iMode, ULONG_PTR *pid)
 
PIFIMETRICS APIENTRY FtfdQueryFont (IN DHPDEV dhpdev, IN ULONG_PTR iFile, IN ULONG iFace, IN ULONG_PTR *pid)
 
VOID APIENTRY FtfdFree (PVOID pv, ULONG_PTR id)
 
PFD_GLYPHATTR APIENTRY FtfdQueryGlyphAttrs (FONTOBJ *pfo, ULONG iMode)
 
LONG APIENTRY FtfdQueryFontData (DHPDEV dhpdev, FONTOBJ *pfo, ULONG iMode, HGLYPH hg, OUT GLYPHDATA *pgd, PVOID pv, ULONG cjSize)
 

Variables

FT_Library gftlibrary
 

Macro Definition Documentation

◆ MAX_STYLESIZE

#define MAX_STYLESIZE   35

Definition at line 42 of file ftfd.h.

◆ TAG_GLYPHSET

#define TAG_GLYPHSET   'GlSt'

Definition at line 21 of file ftfd.h.

◆ TAG_IFIMETRICS

#define TAG_IFIMETRICS   'Ifim'

Definition at line 22 of file ftfd.h.

Typedef Documentation

◆ PFTFD_FILE

◆ PFTFD_IFIMETRICS

Function Documentation

◆ DbgPrint()

ULONG DbgPrint ( IN PCCH  Format,
IN ...   
)

Function prototypes

Definition at line 22 of file rosglue.c.

23{
25
27 EngDebugPrint("ft2: ", (PCHAR)Format, args);
28 va_end(args);
29 return 0;
30}
char * va_list
Definition: acmsvcex.h:78
#define va_end(ap)
Definition: acmsvcex.h:90
#define va_start(ap, A)
Definition: acmsvcex.h:91
#define args
Definition: format.c:66
Definition: match.c:390
char * PCHAR
Definition: typedefs.h:51
ENGAPI VOID APIENTRY EngDebugPrint(_In_z_ PCHAR StandardPrefix, _In_z_ PCHAR DebugMessage, _In_ va_list ap)
Definition: debug.c:19

◆ FtfdCompletePDEV()

VOID APIENTRY FtfdCompletePDEV ( IN DHPDEV  dhpdev,
IN HDEV  hdev 
)

Definition at line 90 of file enable.c.

93{
94 DbgPrint("FtfdCompletePDEV()\n");
95 /* Nothing to do */
96}
#define DbgPrint
Definition: hal.h:12

◆ FtfdDisablePDEV()

VOID APIENTRY FtfdDisablePDEV ( IN DHPDEV  dhpdev)

Definition at line 101 of file enable.c.

103{
104 DbgPrint("FtfdDisablePDEV()\n");
105 /* Nothing to do */
106}

◆ FtfdEnablePDEV()

DHPDEV APIENTRY FtfdEnablePDEV ( IN DEVMODEW pdm,
IN LPWSTR  pwszLogAddress,
IN ULONG  cPat,
OUT HSURF phsurfPatterns,
IN ULONG  cjCaps,
OUT ULONG pdevcaps,
IN ULONG  cjDevInfo,
OUT DEVINFO pdi,
IN HDEV  hdev,
IN LPWSTR  pwszDeviceName,
IN HANDLE  hDriver 
)

Definition at line 66 of file enable.c.

78{
79 DbgPrint("FtfdEnablePDEV(hdev=%p)\n", hdev);
81
82
83 /* Return a dummy DHPDEV */
84 return (PVOID)1;
85}
void __cdecl __debugbreak(void)
Definition: intrin_ppc.h:698
_In_ HDEV hdev
Definition: winddi.h:3449

◆ FtfdFree()

VOID APIENTRY FtfdFree ( PVOID  pv,
ULONG_PTR  id 
)

Definition at line 480 of file font.c.

483{
484 DbgPrint("FtfdFree()\n");
485 if (id)
486 {
487 EngFreeMem((PVOID)id);
488 }
489}
#define EngFreeMem
Definition: polytest.cpp:56

◆ FtfdLoadFontFile()

ULONG_PTR APIENTRY FtfdLoadFontFile ( ULONG  cFiles,
ULONG_PTR piFile,
PVOID ppvView,
ULONG pcjView,
DESIGNVECTOR pdv,
ULONG  ulLangID,
ULONG  ulFastCheckSum 
)

Public Interface

Definition at line 29 of file font.c.

37{
38 PVOID pvView;
39 ULONG cjView, i;
40 FT_Error fterror;
41 FT_Face ftface;
42 PFTFD_FILE pfile;
43 ULONG cjSize, cNumFaces;
44
45 DbgPrint("FtfdLoadFontFile()\n");
46
47 /* Check parameters */
48 if (cFiles != 1)
49 {
50 DbgPrint("Only 1 File is allowed, got %ld!\n", cFiles);
51 return HFF_INVALID;
52 }
53
54 /* Map the font file */
55 if (!EngMapFontFileFD(*piFile, (PULONG*)&pvView, &cjView))
56 {
57 DbgPrint("Could not map font file!\n");
58 return HFF_INVALID;
59 }
60
61 // HACK!!!
62 pvView = HackFixup(pvView, cjView);
63
64 fterror = FT_New_Memory_Face(gftlibrary, pvView, cjView, 0, &ftface);
65 if (fterror)
66 {
67 DbgPrint("No faces found in file\n");
68
69 /* Unmap the file */
71
72 /* Failure! */
73 return HFF_INVALID;
74 }
75
76 /* Get number of faces from the first face */
77 cNumFaces = ftface->num_faces;
78
79 cjSize = sizeof(FTFD_FILE) + cNumFaces * sizeof(FT_Face);
80 pfile = EngAllocMem(0, cjSize, 'dftF');
81 if (!pfile)
82 {
83 DbgPrint("EngAllocMem() failed.\n");
84
85 /* Unmap the file */
87
88 /* Failure! */
89 return HFF_INVALID;
90 }
91
92 pfile->cNumFaces = cNumFaces;
93 pfile->iFile = *piFile;
94 pfile->pvView = pvView;
95 pfile->cjView = cjView;
96
97 for (i = 0; i < pfile->cNumFaces; i++)
98 {
99 pfile->aftface[i] = ftface;
100 FT_Select_Charmap(ftface, FT_ENCODING_UNICODE);
101 }
102
103 DbgPrint("Success! Returning %ld faces\n", cNumFaces);
104
105 return (ULONG_PTR)pfile;
106}
FT_Select_Charmap(FT_Face face, FT_Encoding encoding)
Definition: ftobjs.c:3457
FT_New_Memory_Face(FT_Library library, const FT_Byte *file_base, FT_Long file_size, FT_Long face_index, FT_Face *aface)
Definition: ftobjs.c:1431
int FT_Error
Definition: fttypes.h:300
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
void * EngAllocMem(int zero, unsigned long size, int tag=0)
Definition: polytest.cpp:70
Definition: ftfd.h:33
ULONG_PTR iFile
Definition: ftfd.h:36
ULONG cNumFaces
Definition: ftfd.h:37
ULONG cjView
Definition: ftfd.h:35
PVOID pvView
Definition: ftfd.h:34
FT_Face aftface[1]
Definition: ftfd.h:38
FT_Long num_faces
Definition: freetype.h:1070
uint32_t * PULONG
Definition: typedefs.h:59
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
FT_Library gftlibrary
Definition: enable.c:26
PVOID HackFixup(PVOID pvView, ULONG cjView)
Definition: font.c:11
#define HFF_INVALID
Definition: winddi.h:156
ENGAPI VOID APIENTRY EngUnmapFontFileFD(_In_ ULONG_PTR iFile)
Definition: mapping.c:564
_In_ ULONG cjSize
Definition: winddi.h:3634
_In_ ULONG_PTR * piFile
Definition: winddi.h:3720

◆ FtfdQueryFont()

PIFIMETRICS APIENTRY FtfdQueryFont ( IN DHPDEV  dhpdev,
IN ULONG_PTR  iFile,
IN ULONG  iFace,
IN ULONG_PTR pid 
)

Definition at line 169 of file font.c.

174{
175 PFTFD_FILE pfile = (PFTFD_FILE)iFile;
176 PFTFD_IFIMETRICS pifiX;
177 PIFIMETRICS pifi;
178 FT_Face ftface;
179 FT_Error fterror;
180 ULONG i;
181
182 DbgPrint("FtfdQueryFont()\n");
183
184 /* Validate parameters */
185 if (iFace > pfile->cNumFaces || !pid)
186 {
187 DbgPrint("iFace > pfile->cNumFaces || !pid\n");
188 return NULL;
189 }
190
192 pfile->pvView,
193 pfile->cjView,
194 iFace - 1,
195 &ftface);
196 if (fterror)
197 {
198 DbgPrint("FT_New_Memory_Face failed\n");
199 return NULL;
200 }
201
202 /* Allocate the ifi metrics structure */
204 if (!pifiX)
205 {
206 DbgPrint("EngAllocMem() failed.\n");
207 FT_Done_Face(ftface);
208 return NULL;
209 }
210
211 /* Fill IFIMETRICS */
212 pifi = &pifiX->ifim;
213 pifi->cjThis = sizeof(FTFD_IFIMETRICS);
214 pifi->cjIfiExtra = 0;
215
216 /* Relative offsets */
217 pifi->dpwszFamilyName = FIELD_OFFSET(FTFD_IFIMETRICS, wszFamilyName);
218 pifi->dpwszStyleName = FIELD_OFFSET(FTFD_IFIMETRICS, wszStyleName);
219 pifi->dpwszFaceName = FIELD_OFFSET(FTFD_IFIMETRICS, wszFaceName);
220 pifi->dpwszUniqueName = FIELD_OFFSET(FTFD_IFIMETRICS, wszFaceName);
221 pifi->dpCharSets = FIELD_OFFSET(FTFD_IFIMETRICS, ajCharSet);
222 pifi->dpFontSim = 0;
223
224 /* Charsets */
226 pifiX->ajCharSet[0] = pifi->jWinCharSet;
227 for (i = 1; i < 16; i++)
228 {
229 pifiX->ajCharSet[i] = DEFAULT_CHARSET;
230 }
231
232 pifi->lEmbedId = 0;
233 pifi->lItalicAngle = 0;
234 pifi->lCharBias = 0;
236 pifi->usWinWeight = FW_MEDIUM; // FIXME
242 pifi->fsSelection = 0;
243 pifi->fsType = 0;
244
245 /* Font resolution */
246 pifi->fwdUnitsPerEm = ftface->units_per_EM;
247 pifi->fwdLowestPPEm = 8; // FIXME
248
249 /* Font metrics */
250 pifi->fwdWinAscender = ftface->ascender;
251 pifi->fwdWinDescender = - ftface->descender;
252 pifi->fwdMacAscender = pifi->fwdWinAscender;
253 pifi->fwdMacDescender = - pifi->fwdWinDescender;
254 pifi->fwdMacLineGap = 0;
255 pifi->fwdTypoAscender = pifi->fwdWinAscender;
256 pifi->fwdTypoDescender = 0; // FIXME!!! - pifi->fwdWinDescender;
257 pifi->fwdTypoLineGap = 0;
258 pifi->fwdAveCharWidth = 1085; // FIXME
259 pifi->fwdMaxCharInc = ftface->max_advance_width;
260 pifi->fwdCapHeight = pifi->fwdUnitsPerEm / 2;
261 pifi->fwdXHeight = pifi->fwdUnitsPerEm / 4;
262 pifi->fwdSubscriptXSize = 0;
263 pifi->fwdSubscriptYSize = 0;
264 pifi->fwdSubscriptXOffset = 0;
265 pifi->fwdSubscriptYOffset = 0;
266 pifi->fwdSuperscriptXSize = 0;
267 pifi->fwdSuperscriptYSize = 0;
268 pifi->fwdSuperscriptXOffset = 0;
269 pifi->fwdSuperscriptYOffset = 0;
270 pifi->fwdUnderscoreSize = 1;
271 pifi->fwdUnderscorePosition = -1;
272 pifi->fwdStrikeoutSize = 1;
273 pifi->fwdStrikeoutPosition = pifi->fwdXHeight + 1;
274
275 pifi->ptlBaseline.x = 1;
276 pifi->ptlBaseline.y = 0;
277 pifi->ptlAspect.x = 1;
278 pifi->ptlAspect.y = 1;
279 pifi->ptlCaret.x = 0;
280 pifi->ptlCaret.y = 1;
281
282 /* Set the biggest characters bounding box */
283 pifi->rclFontBox.left = ftface->bbox.xMin;
284 pifi->rclFontBox.right = ftface->bbox.xMax;
285 pifi->rclFontBox.top = ftface->bbox.yMax;
286 pifi->rclFontBox.bottom = ftface->bbox.yMin;
287
288 /* Special characters */
289 pifi->chFirstChar = 0x1c; // FIXME
290 pifi->chLastChar = 0x79;
291 pifi->chDefaultChar = 0x1d;
292 pifi->chBreakChar = 0x1e;
293 pifi->wcFirstChar = 0x1e;
294 pifi->wcLastChar = 0x79;
295 pifi->wcDefaultChar = 0x1d;
296 pifi->wcBreakChar = 0x1e;
297
298
299 *(DWORD*)&pifi->achVendId = 0x30303030; // FIXME
300 pifi->cKerningPairs = 0;
302// pifi->panose = panose;
303
306 NULL,
307 ftface->family_name,
308 strnlen(ftface->family_name, MAX_PATH));
309
312 NULL,
313 ftface->style_name,
314 strnlen(ftface->style_name, MAX_PATH));
315
318 NULL,
319 ftface->family_name,
320 strnlen(ftface->family_name, MAX_PATH));
321
322 FT_Done_Face(ftface);
323
324 DbgPrint("Finished with the ifi: %p\n", pifiX);
325 __debugbreak();
326
327 return pifi;
328}
#define TAG_IFIMETRICS
Definition: bmfd.h:43
#define LF_FACESIZE
Definition: dimm.idl:39
#define NULL
Definition: types.h:112
#define MAX_PATH
Definition: compat.h:34
unsigned long DWORD
Definition: ntddk_ex.h:95
FT_Done_Face(FT_Face face)
Definition: ftobjs.c:2721
struct FTFD_FILE * PFTFD_FILE
#define FL_ZERO_MEMORY
Definition: polytest.cpp:58
WCHAR wszFamilyName[LF_FACESIZE]
Definition: ftfd.h:48
IFIMETRICS ifim
Definition: ftfd.h:45
WCHAR wszStyleName[MAX_STYLESIZE]
Definition: ftfd.h:50
BYTE ajCharSet[16]
Definition: ftfd.h:46
WCHAR wszFaceName[LF_FACESIZE]
Definition: ftfd.h:49
FT_Pos xMin
Definition: ftimage.h:117
FT_Pos yMax
Definition: ftimage.h:118
FT_Pos yMin
Definition: ftimage.h:117
FT_Pos xMax
Definition: ftimage.h:118
FT_Short descender
Definition: freetype.h:1096
FT_BBox bbox
Definition: freetype.h:1092
FT_UShort units_per_EM
Definition: freetype.h:1094
FT_String * style_name
Definition: freetype.h:1079
FT_Short max_advance_width
Definition: freetype.h:1099
FT_String * family_name
Definition: freetype.h:1078
FT_Short ascender
Definition: freetype.h:1095
long bottom
Definition: polytest.cpp:53
long right
Definition: polytest.cpp:53
long top
Definition: polytest.cpp:53
long left
Definition: polytest.cpp:53
FWORD fwdWinDescender
Definition: winddi.h:1067
PTRDIFF dpCharSets
Definition: winddi.h:1057
ULONG cjThis
Definition: winddi.h:1047
FWORD fwdUnderscoreSize
Definition: winddi.h:1086
BYTE chDefaultChar
Definition: winddi.h:1092
BYTE chFirstChar
Definition: winddi.h:1090
ULONG cjIfiExtra
Definition: winddi.h:1048
BYTE chBreakChar
Definition: winddi.h:1093
FWORD fwdTypoAscender
Definition: winddi.h:1071
ULONG ulPanoseCulture
Definition: winddi.h:1104
USHORT fsSelection
Definition: winddi.h:1062
PTRDIFF dpwszUniqueName
Definition: winddi.h:1052
PTRDIFF dpwszFamilyName
Definition: winddi.h:1049
FWORD fwdStrikeoutPosition
Definition: winddi.h:1089
PTRDIFF dpwszStyleName
Definition: winddi.h:1050
FWORD fwdSubscriptYSize
Definition: winddi.h:1079
FWORD fwdSubscriptXSize
Definition: winddi.h:1078
FWORD fwdSuperscriptYSize
Definition: winddi.h:1083
POINTL ptlAspect
Definition: winddi.h:1099
WCHAR wcLastChar
Definition: winddi.h:1095
FWORD fwdMacDescender
Definition: winddi.h:1069
LONG lCharBias
Definition: winddi.h:1056
FWORD fwdUnitsPerEm
Definition: winddi.h:1064
FWORD fwdAveCharWidth
Definition: winddi.h:1074
ULONG flInfo
Definition: winddi.h:1061
FWORD fwdCapHeight
Definition: winddi.h:1076
FWORD fwdTypoDescender
Definition: winddi.h:1072
FWORD fwdUnderscorePosition
Definition: winddi.h:1087
POINTL ptlBaseline
Definition: winddi.h:1098
FWORD fwdMacAscender
Definition: winddi.h:1068
FWORD fwdSubscriptYOffset
Definition: winddi.h:1081
BYTE jWinPitchAndFamily
Definition: winddi.h:1059
FWORD fwdTypoLineGap
Definition: winddi.h:1073
FWORD fwdSuperscriptXSize
Definition: winddi.h:1082
FWORD fwdXHeight
Definition: winddi.h:1077
FWORD fwdSuperscriptYOffset
Definition: winddi.h:1085
FWORD fwdMacLineGap
Definition: winddi.h:1070
BYTE chLastChar
Definition: winddi.h:1091
BYTE jWinCharSet
Definition: winddi.h:1058
LONG lItalicAngle
Definition: winddi.h:1055
USHORT usWinWeight
Definition: winddi.h:1060
FWORD fwdLowestPPEm
Definition: winddi.h:1065
PTRDIFF dpwszFaceName
Definition: winddi.h:1051
BYTE achVendId[4]
Definition: winddi.h:1102
RECTL rclFontBox
Definition: winddi.h:1101
WCHAR wcBreakChar
Definition: winddi.h:1097
FWORD fwdMaxCharInc
Definition: winddi.h:1075
USHORT fsType
Definition: winddi.h:1063
FWORD fwdStrikeoutSize
Definition: winddi.h:1088
LONG lEmbedId
Definition: winddi.h:1054
FWORD fwdSubscriptXOffset
Definition: winddi.h:1080
PTRDIFF dpFontSim
Definition: winddi.h:1053
ULONG cKerningPairs
Definition: winddi.h:1103
WCHAR wcFirstChar
Definition: winddi.h:1094
FWORD fwdWinAscender
Definition: winddi.h:1066
POINTL ptlCaret
Definition: winddi.h:1100
FWORD fwdSuperscriptXOffset
Definition: winddi.h:1084
WCHAR wcDefaultChar
Definition: winddi.h:1096
LONG y
Definition: windef.h:330
LONG x
Definition: windef.h:329
#define FIELD_OFFSET(t, f)
Definition: typedefs.h:255
#define FM_INFO_4BPP
Definition: winddi.h:1014
_In_ ULONG_PTR _In_ ULONG iFace
Definition: winddi.h:3836
ENGAPI VOID APIENTRY EngMultiByteToUnicodeN(_Out_writes_bytes_to_(MaxBytesInUnicodeString, *BytesInUnicodeString) LPWSTR UnicodeString, _In_ ULONG MaxBytesInUnicodeString, _Out_opt_ PULONG BytesInUnicodeString, _In_reads_bytes_(BytesInMultiByteString) PCHAR MultiByteString, _In_ ULONG BytesInMultiByteString)
#define FM_INFO_1BPP
Definition: winddi.h:1013
#define FM_INFO_RETURNS_OUTLINES
Definition: winddi.h:1023
#define FM_INFO_RIGHT_HANDED
Definition: winddi.h:1027
_In_ ULONG_PTR _In_ ULONG _Out_ ULONG_PTR * pid
Definition: winddi.h:3837
_In_ ULONG_PTR iFile
Definition: winddi.h:3835
#define FM_INFO_TECH_TRUETYPE
Definition: winddi.h:1008
#define FM_PANOSE_CULTURE_LATIN
Definition: winddi.h:1044
#define FM_INFO_ARB_XFORMS
Definition: winddi.h:1012
#define FM_INFO_RETURNS_BITMAPS
Definition: winddi.h:1025
#define VARIABLE_PITCH
Definition: wingdi.h:445
#define FF_DONTCARE
Definition: wingdi.h:448
#define DEFAULT_CHARSET
Definition: wingdi.h:384
#define ANSI_CHARSET
Definition: wingdi.h:383
#define FW_MEDIUM
Definition: wingdi.h:375

◆ FtfdQueryFontCaps()

LONG APIENTRY FtfdQueryFontCaps ( ULONG  culCaps,
ULONG pulCaps 
)

Definition at line 333 of file font.c.

336{
337 DbgPrint("FtfdQueryFontCaps()\n");
338
339 /* We need room for 2 ULONGs */
340 if (culCaps < 2)
341 {
342 return FD_ERROR;
343 }
344
345 /* We only support 1 bpp */
346 pulCaps[0] = 2;
347 pulCaps[1] = QC_1BIT;
348
349 return 2;
350}
#define FD_ERROR
Definition: winddi.h:153
#define QC_1BIT
Definition: winddi.h:3843

◆ FtfdQueryFontData()

LONG APIENTRY FtfdQueryFontData ( DHPDEV  dhpdev,
FONTOBJ pfo,
ULONG  iMode,
HGLYPH  hg,
OUT GLYPHDATA pgd,
PVOID  pv,
ULONG  cjSize 
)

Definition at line 24 of file glyph.c.

32{
33 return FD_ERROR;
34}

◆ FtfdQueryFontFile()

LONG APIENTRY FtfdQueryFontFile ( ULONG_PTR  iFile,
ULONG  ulMode,
ULONG  cjBuf,
ULONG pulBuf 
)

Definition at line 139 of file font.c.

144{
145 PFTFD_FILE pfile = (PFTFD_FILE)iFile;
146
147 DbgPrint("FtfdQueryFontFile(ulMode=%ld)\n", ulMode);
148// __debugbreak();
149
150 switch (ulMode)
151 {
152 case QFF_DESCRIPTION:
153 {
154 return 0;
155 }
156
157 case QFF_NUMFACES:
158 /* return the number of faces in the file */
159 return pfile->cNumFaces;
160
161 }
162
163 return FD_ERROR;
164}
#define QFF_DESCRIPTION
Definition: winddi.h:3879
_In_ CLIPOBJ _In_opt_ XLATEOBJ _In_ TRIVERTEX _In_ ULONG _In_ PVOID _In_ ULONG _In_ RECTL _In_ POINTL _In_ ULONG ulMode
Definition: winddi.h:3657
#define QFF_NUMFACES
Definition: winddi.h:3880

◆ FtfdQueryFontTree()

PVOID APIENTRY FtfdQueryFontTree ( DHPDEV  dhpdev,
ULONG_PTR  iFile,
ULONG  iFace,
ULONG  iMode,
ULONG_PTR pid 
)

Definition at line 355 of file font.c.

361{
362 PFTFD_FILE pfile = (PFTFD_FILE)iFile;
363 FT_Face ftface;
364 FT_Error fterror;
365 FTFD_CHARPAIR *pcp;
366 FD_GLYPHSET *pGlyphSet;
367 FT_ULong charcode;
368 ULONG i, j, cGlyphs, cRuns, cjSize;
369 WCRUN *pwcrun;
370 HGLYPH * phglyphs;
371
372 DbgPrint("FtfdQueryFontTree()\n");
373
375 pfile->pvView,
376 pfile->cjView,
377 iFace - 1,
378 &ftface);
379 if (fterror)
380 {
381 DbgPrint("FT_New_Memory_Face() failed.\n");
382 return NULL;
383 }
384
385 /* Get initial value for cGlyphs from ftface */
386 cGlyphs = ftface->num_glyphs + 1;
387
388 /* Allocate a buffer for the char codes and glyph indexes */
389 pcp = EngAllocMem(0, cGlyphs * sizeof(FTFD_CHARPAIR), 'pcp ');
390 if (!pcp)
391 {
392 DbgPrint("EngAllocMem() failed.\n");
393 return NULL;
394 }
395
396 /* Gather char codes and indexes and count WCRUNs */
397 pcp[0].code = FT_Get_First_Char(ftface, &pcp[0].index);
398 charcode = pcp[0].code;
399 for (i = 1, cRuns = 1; charcode && i < cGlyphs; i++)
400 {
401 charcode = FT_Get_Next_Char(ftface, charcode, &pcp[i].index);
402 DbgPrint("charcode=0x%lx, index=0x%lx\n", charcode, pcp[i].index);
403 pcp[i].code = charcode;
404 if (charcode != pcp[i - 1].code + 1)
405 {
406 cRuns++;
407 }
408 }
409
410 /* Update cGlyphs to real value */
411 cGlyphs = i - 1;
412
413 /* Calculate FD_GLYPHSET size */
414 cjSize = sizeof(FD_GLYPHSET)
415 + (cRuns - 1) * sizeof(WCRUN)
416 + cGlyphs * sizeof(HGLYPH);
417
418 /* Allocate the FD_GLYPHSET structure */
419 pGlyphSet = EngAllocMem(0, cjSize, TAG_GLYPHSET);
420 if (!pGlyphSet)
421 {
422 DbgPrint("EngAllocMem() failed.\n");
423 EngFreeMem(pcp);
424 return NULL;
425 }
426
427 /* Initialize FD_GLYPHSET */
428 pGlyphSet->cjThis = cjSize;
429 pGlyphSet->flAccel = 0;
430 pGlyphSet->cGlyphsSupported = cGlyphs;
431 pGlyphSet->cRuns = cRuns;
432
433 /* Initialize 1st WCRUN */
434 pwcrun = pGlyphSet->awcrun;
435 phglyphs = (PHGLYPH)&pGlyphSet->awcrun[cRuns];
436 pwcrun[0].wcLow = pcp[0].code;
437 pwcrun[0].cGlyphs = 1;
438 pwcrun[0].phg = &phglyphs[0];
439 phglyphs[0] = pcp[0].index;
440
441DbgPrint("pcp[0].index = 0x%lx\n", pcp[0].index);
442
443 /* Walk through all supported chars */
444 for (i = 1, j = 0; i < cGlyphs; i++)
445 {
446 /* Use glyph index as HGLYPH */
447 phglyphs[i] = pcp[i].index;
448
449 /* Check whether we can append the wchar to a run */
450 if (pcp[i].code == pcp[i - 1].code + 1)
451 {
452 /* Append to current WCRUN */
453 pwcrun[j].cGlyphs++;
454 }
455 else
456 {
457 /* Add a new WCRUN */
458 DbgPrint("adding new run\n");
459 j++;
460 pwcrun[j].wcLow = pcp[i].code;
461 pwcrun[j].cGlyphs = 1;
462 pwcrun[j].phg = &phglyphs[i];
463 }
464 }
465
466 /* Free the temporary buffer */
467 EngFreeMem(pcp);
468
469 /* Set *pid to the allocated structure for use in FtfdFree */
470 *pid = (ULONG_PTR)pGlyphSet;
471
472DbgPrint("pGlyphSet=%p\n", pGlyphSet);
474
475 return pGlyphSet;
476}
#define TAG_GLYPHSET
Definition: bmfd.h:42
#define ULONG_PTR
Definition: config.h:101
FT_Get_First_Char(FT_Face face, FT_UInt *agindex)
Definition: ftobjs.c:3697
FT_Get_Next_Char(FT_Face face, FT_ULong char_code, FT_UInt *agindex)
Definition: ftobjs.c:3722
unsigned long FT_ULong
Definition: fttypes.h:253
GLuint index
Definition: glext.h:6031
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 GLint GLint j
Definition: glfuncs.h:250
FT_ULong code
Definition: ftfd.h:29
FT_UInt index
Definition: ftfd.h:28
FT_Long num_glyphs
Definition: freetype.h:1076
ULONG cjThis
Definition: winddi.h:641
ULONG cRuns
Definition: winddi.h:644
ULONG cGlyphsSupported
Definition: winddi.h:643
FLONG flAccel
Definition: winddi.h:642
Definition: winddi.h:634
HGLYPH * phg
Definition: winddi.h:637
WCHAR wcLow
Definition: winddi.h:635
USHORT cGlyphs
Definition: winddi.h:636
Definition: inflate.c:139
struct _WCRUN WCRUN
struct _FD_GLYPHSET FD_GLYPHSET
HGLYPH * PHGLYPH
Definition: winddi.h:131
_In_ FONTOBJ _In_ ULONG _In_ ULONG cGlyphs
Definition: winddi.h:3799

◆ FtfdQueryGlyphAttrs()

PFD_GLYPHATTR APIENTRY FtfdQueryGlyphAttrs ( FONTOBJ pfo,
ULONG  iMode 
)

Public Interface

Definition at line 15 of file glyph.c.

18{
19 return NULL;
20}

◆ FtfdUnloadFontFile()

BOOL APIENTRY FtfdUnloadFontFile ( IN ULONG_PTR  iFile)

Definition at line 110 of file font.c.

112{
113 PFTFD_FILE pfile = (PFTFD_FILE)iFile;
114 ULONG i;
115
116 DbgPrint("FtfdUnloadFontFile()\n");
117
118 // HACK!!!
119 EngFreeMem(pfile->pvView);
120
121 /* Cleanup faces */
122 for (i = 0; i < pfile->cNumFaces; i++)
123 {
124 FT_Done_Face(pfile->aftface[i]);
125 }
126
127 /* Unmap the font file */
129
130 /* Free the memory that was allocated for the font */
131 EngFreeMem(pfile);
132
133 return TRUE;
134}
#define TRUE
Definition: types.h:120

Variable Documentation

◆ gftlibrary

FT_Library gftlibrary
extern

Definition at line 26 of file enable.c.

Referenced by FtfdEnableDriver(), FtfdLoadFontFile(), FtfdQueryFont(), and FtfdQueryFontTree().