Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1136 lines
34 KiB

  1. /****************************************************************************\
  2. *
  3. * WIFE.H : East Asia Windows Intelligent Font Environment definitions
  4. *
  5. ******************************************************************************
  6. *
  7. * History:
  8. * 21-Oct-1991 bent
  9. * initial merge of East Asia 3.0 versions
  10. * Should be updated to resolve local inconsistencies.
  11. *
  12. * Copyright (c) 1990 Microsoft Corporation
  13. *
  14. * Brief instruction
  15. * -----------------
  16. *
  17. * This header file is a common single header for WIFE drivers. *
  18. * If you are a developer of FontDriver, please write coding as follow *
  19. *
  20. * #define WIFE_CREATE_FONTDRIVER *
  21. * #include <wife.h> *
  22. *
  23. * If you are a developer of DeviceDriver which are display or printer
  24. * drivers, please write coding as follow. *
  25. *
  26. * #define WIFE_CREATE_DEVICEDRIVER *
  27. * #include <wife.h> *
  28. *
  29. * If you don't define both of symbols, only common defenitions are
  30. * available.
  31. *
  32. * Aug.17,1990 Akira Kawamata [AkiraK] *
  33. *
  34. \****************************************************************************/
  35. /****** OS/2-like common data type definitions ******************************/
  36. #ifndef WIFEH_NODATATYPES
  37. typedef unsigned short int USHORT;
  38. typedef short int SHORT;
  39. typedef unsigned long ULONG;
  40. typedef LONG FAR * LPLONG;
  41. typedef LONG NEAR * NPLONG;
  42. typedef ULONG FAR * LPULONG;
  43. typedef ULONG NEAR * NPULONG;
  44. typedef SHORT FAR * LPSHORT;
  45. typedef SHORT NEAR * NPSHORT;
  46. typedef USHORT FAR * LPUSHORT;
  47. typedef USHORT NEAR * NPUSHORT;
  48. typedef char CHAR;
  49. typedef unsigned char UCHAR;
  50. typedef VOID NEAR * NPVOID;
  51. #endif //WIFEH_NODATATYPES
  52. /****** Graphics handling support definitions *******************************/
  53. #ifndef WIFEH_NOGRAPHSUPPORT
  54. /* rotation angle by 90degree */
  55. typedef enum {
  56. ANGLE000 = 0,
  57. ANGLE090 = 1,
  58. ANGLE180 = 2,
  59. ANGLE270 = 3
  60. } QUOTER_ANGLE;
  61. #define FixedToQuoterAngle(f) ((f.Integer/90)%4)
  62. #define RotationToQuoterAngle(r) ((r/900)%4)
  63. typedef DWORD PACKEDPOINT;
  64. typedef DWORD PACKEDLOGICALPOINT;
  65. typedef DWORD PACKEDPHYSICALPOINT;
  66. typedef struct {
  67. short x,y;
  68. } XYPOINT;
  69. typedef union {
  70. PACKEDPOINT packed;
  71. XYPOINT point;
  72. } UNIONPOINT, NEAR * NPUNIONPOINT, FAR * LPUNIONPOINT;
  73. #define PartOfX(xy) ((SHORT)(xy))
  74. #define PartOfY(xy) ((SHORT)(((DWORD)(xy) >> 16) & 0xFFFF))
  75. #define MAKELONG_LO_HI MAKELONG
  76. #define PackXY(x,y) ((DWORD)MAKELONG_LO_HI((WORD)x,(WORD)y))
  77. #endif //WIFEH_NOGRAPHSUPPORT
  78. /****** UBCS : Unified Byte Character Set, data types defenition **********/
  79. #ifndef WIFEH_NOUBCS
  80. typedef USHORT UBCHAR;
  81. typedef UBCHAR NEAR * NPUBCHAR;
  82. typedef UBCHAR FAR * LPUBCHAR;
  83. #define UBEOS (0) /* End Of String */
  84. #define UBNEWLINE (0x0a0d) /* New Line (CR/LF) */
  85. #define IsSbcsUBChar(uc) ((uc & 0xff00) == 0x2000)
  86. #define IsDbcsUBChar(uc) ((uc & 0xff00) != 0x2000)
  87. #endif //WIFEH_NOUBCS
  88. /****** Utility macros *****************************************************/
  89. #ifndef WIFEH_NOUTILITYMACROS
  90. /* return type of GlobalLock is LPSTR, but it's to be LPVOID */
  91. #define AnyGlobalLock(h) ((LPVOID)GlobalLock(h))
  92. #define AnyLocalLock(h) ((NPVOID)LocalLock(h))
  93. #define TypedLocalLock(h,t) ((t NEAR *)LocalLock(h))
  94. #define TypedGlobalLock(h,t) ((t FAR *)GlobalLock(h))
  95. /* utility macro which is not included windows.h */
  96. #define MAKEWORD(l,h) ((WORD)((BYTE)l+(((BYTE)h) << 8)))
  97. #endif //WIFEH_NOUTILITYMACROS
  98. /****** GDIDEFS.H support definitions **************************************/
  99. #ifdef WIFE_ENABLE_GDIDEFS_SUPPORT
  100. typedef FONTINFO FAR * LPFONTINFO;
  101. typedef DRAWMODE FAR * LPDRAWMODE;
  102. typedef TEXTXFORM FAR * LPTEXTXFORM;
  103. #endif //WIFE_ENABLE_GDIDEFS_SUPPORT
  104. /****** Character set definitions ******************************************/
  105. #ifndef WIFEH_NOCHARSET
  106. typedef enum {
  107. CHARSET_ANSI = 0,
  108. CHARSET_SYMBOL = 2,
  109. CHARSET_SHIFTJIS = 128,
  110. CHARSET_KOREA = 129,
  111. CHARSET_CHINESEBIG5 = 136,
  112. CHARSET_GB2312 = 134,
  113. CHARSET_OEM = 255
  114. } CHAR_SET;
  115. #endif //WIFEH_NOCHARSET
  116. /***************************************************************************/
  117. /****** Control function support definitions ******************************/
  118. #ifndef WIFEH_NOCONTROL
  119. /******************************************/
  120. /* FONT DRIVER MEDIA DESCRIPTER */
  121. /******************************************/
  122. #ifndef WIFEWH_NOMEDIA
  123. /* FDMEDIA enumration type */
  124. typedef enum {
  125. FDMEDIA_ON_FILE = 1,
  126. FDMEDIA_ON_DRIVER = 2,
  127. FDMEDIA_ON_REMOVEABLE_HARDWARE = 4,
  128. FDMEDIA_ON_FIXED_HARDWARE = 8,
  129. FDMEDIA_UNDEFINED = 0x4000,
  130. FDMEDIA_ANY_MEDIA = 0x7fff
  131. } FDMEDIA;
  132. #endif
  133. /******************************************/
  134. /* MINOR CHARACTER SETS DEFENITION */
  135. /******************************************/
  136. #ifndef WIFEH_NOMINORCHARSET_IN_JAPAN
  137. /* general default minor character set */
  138. #define FD_MINOR_CHARSET_DEFAULT 1
  139. /* Minor Character Set in Japan */
  140. #define FD_MINOR_CHARSET_NEW_JIS 1 /* new JIS */
  141. #define FD_MINOR_CHARSET_OLD_JIS 2 /* old JIS */
  142. #define FD_MINOR_CHARSET_IBM_JIS 4 /* IBM JIS */
  143. #define FD_MINOR_CHARSET_NEC_JIS 8 /* NEC JIS */
  144. #endif
  145. /******************************************/
  146. /* CODE AREA STRUCTURE */
  147. /******************************************/
  148. #ifndef WIFEH_NOCODEAREA
  149. typedef struct {
  150. UBCHAR CodeFrom;
  151. UBCHAR CodeTo;
  152. } CODEAREA, NEAR * NPCODEAREA, FAR * LPCODEAREA;
  153. #endif
  154. /******************************************/
  155. /* SPECIAL ESCAPE FUNCTION ORDERS */
  156. /******************************************/
  157. /* subfunction orders in WIFE */
  158. #define FD_CONTROL_RESERVED (0xa20)
  159. #define FD_CONTROL_RESERVED_LIMIT (FD_CONTROL_RESERVED+0x3f)
  160. /* standard subfunctions */
  161. #define FD_CONTROL_QUERY_ESC_SUPPORT (FD_CONTROL_RESERVED+0)
  162. #define FD_CONTROL_SUPPORT_CODES (FD_CONTROL_RESERVED+1)
  163. #define FD_CONTROL_NUMBER_OF_ATTRIBUTE (FD_CONTROL_RESERVED+2)
  164. #define FD_CONTROL_NAME_OF_ATTRIBUTE (FD_CONTROL_RESERVED+3)
  165. #define FD_CONTROL_SET_ATTRIBUTE (FD_CONTROL_RESERVED+4)
  166. #define FD_CONTROL_GET_ATTRIBUTE (FD_CONTROL_RESERVED+5)
  167. #define FD_CONTROL_SET_MINOR_CHARSET (FD_CONTROL_RESERVED+6)
  168. #define FD_CONTROL_GET_MINOR_CHARSET (FD_CONTROL_RESERVED+7)
  169. #define FD_CONTROL_GET_FONT_DRIVER_NAME (FD_CONTROL_RESERVED+8)
  170. #define FD_CONTROL_GET_FONT_PACK_NAME (FD_CONTROL_RESERVED+9)
  171. #define FD_CONTROL_GET_MEDIA (FD_CONTROL_RESERVED+10)
  172. #define FD_CONTROL_GET_DBCS_STRING_KERN (FD_CONTROL_RESERVED+11)
  173. #if defined(TAIWAN) || defined(PRC)
  174. /* Chinese related functions */
  175. #define FD_CONTROL_GET_USERFONT_TECH (FD_CONTROL_RESERVED+0X0C)
  176. #define FD_CONTROL_SET_USERFONT (FD_CONTROL_RESERVED+0X0D)
  177. #define FD_CONTROL_SETUP_DIALOG (FD_CONTROL_RESERVED+0X0E)
  178. #define FD_CONTROL_SET_DEFAULT_CHAR (FD_CONTROL_RESERVED+0X0F)
  179. /* private interface subfunctions */
  180. #define FD_CONTROL_USER (FD_CONTROL_RESERVED+0x10)
  181. #define FD_CONTROL_USER_LIMIT (FD_CONTROL_RESERVED_LIMIT)
  182. /* EUDC related subfunctions */
  183. #define FD_CONTROL_LEVEL2_EUDC_INFO (FD_CONTROL_RESERVED+0X12)
  184. #else
  185. /* EUDC related subfunctions */
  186. #define FD_CONTROL_LEVEL2_EUDC_INFO (FD_CONTROL_RESERVED+12)
  187. /* private interface subfunctions */
  188. #define FD_CONTROL_USER (FD_CONTROL_RESERVED+0x10)
  189. #define FD_CONTROL_USER_LIMIT (FD_CONTROL_RESERVED+0x1f)
  190. /* Chinese related functions */
  191. #define FD_CONTROL_GET_USERFONT_TECH (FD_CONTROL_RESERVED+0x20)
  192. #define FD_CONTROL_SET_USERFONT (FD_CONTROL_RESERVED+0x21)
  193. #define FD_CONTROL_SETUP_DIALOG (FD_CONTROL_RESERVED+0x22)
  194. #define FD_CONTROL_SET_DEFAULT_CHAR (FD_CONTROL_RESERVED+0x23)
  195. #endif
  196. #if defined(TAIWAN) || defined(PRC)
  197. // we add this line for the FDCONTROL constant has get the limit
  198. #define FD_CONTROL_CHINESE_RESERVED FD_CONTROL_RESERVED+0x30
  199. #endif // TAIWAN
  200. #ifdef WIFE_ENABLE_EUDC_SUPPORT
  201. typedef struct {
  202. ULONG cb; /* length of this structure */
  203. BOOL bForceFixedPitch; /* force fixed pitch */
  204. BOOL bVerticalFont; /* vertical font flag */
  205. FIXED fxCharRot; /* character rotation */
  206. FIXED fxInlineDir; /* inline rotation */
  207. USHORT usLimitWidth; /* maximum width of cachable */
  208. SHORT sFixedASpace; /* font width when bForceFixedPitch is TRUE */
  209. USHORT usFixedBSpace; /* font width when bForceFixedPitch is TRUE */
  210. SHORT sFixedCSpace; /* font width when bForceFixedPitch is TRUE */
  211. } EUDC_CONTEXT, NEAR * NPEUDC_CONTEXT, FAR * LPEUDC_CONTEXT;
  212. #endif
  213. #endif
  214. #if defined(TAIWAN) || defined(PRC)
  215. typedef struct {
  216. HWND hWnd;
  217. HANDLE hInst;
  218. } CALLINGINFO, FAR *LPCALLINGINFO;
  219. #endif // TAIWAN
  220. #ifndef WIFEH_NOFDCOMMONDEFENITION
  221. typedef LONG HFF;
  222. typedef LONG HFC;
  223. typedef HANDLE HFD;
  224. typedef HANDLE HFB;
  225. #define FACESIZE 32
  226. #define GLYPHNAMESIZE 16
  227. #define WIFEERR_FACENAME_NOT_FOUND 23004L
  228. #define WIFEERR_FD_ALREADY_INSTALLED 23005L
  229. #define WIFEERR_INVALID_CONTEXTINFO 23006L
  230. #define WIFEERR_NOT_A_FONT_FILE 23007L
  231. #define WIFEERR_INVALID_FONT_SELECTION 23008L
  232. #define WIFEERR_INVALID_FORMAT 23009L
  233. #define WIFEERR_BUSY_HFC 230010L
  234. #define WIFEERR_INVALID_HFC 230011L
  235. #define WIFEERR_INVALID_INDEX 230012L
  236. #define WIFEERR_INVALID_QUERY_TYPE 230013L
  237. #define WIFEERR_CONTEXT_NOT_SET 230014L
  238. #define FD_QUERY_ABC_WIDTHS 2L
  239. #define FD_QUERY_KERNINGPAIRS 3L
  240. #define FD_QUERY_CHARIMAGE 1L
  241. #define FD_QUERY_OUTLINE 2L
  242. #define FD_QUERY_BITMAPMETRICS 4L
  243. typedef UBCHAR GLYPH; /* gi */
  244. typedef LPUBCHAR LPGLYPH; /* lpgi */
  245. typedef struct _ABC_TRIPLETS { /* abc, npabc, lpabc */
  246. SHORT sA;
  247. USHORT usB;
  248. SHORT sC;
  249. } ABC_TRIPLETS, NEAR * NPABC_TRIPLETS, FAR * LPABC_TRIPLETS;
  250. typedef struct _SIZEL { /* sizl */
  251. ULONG cx; // Width.
  252. ULONG cy; // Height.
  253. } SIZEL;
  254. typedef struct _BITMAPMETRICS { /* bmm, npbmm, lpbmm */
  255. SIZEL sizlExtent;
  256. POINTFX pfxOrigin; /* Return character origin. */
  257. POINTFX pfxCharInc; /* Return the device advance width */
  258. } BITMAPMETRICS, NEAR * NPBITMAPMETRICS, FAR * LPBITMAPMETRICS;
  259. typedef struct _FD_KERNINGPAIRS { /* krnpr, npkrnpr, lpkrnpr */
  260. GLYPH giFirst;
  261. GLYPH giSecond;
  262. LONG eKerningAmount;
  263. } FD_KERNINGPAIRS, NEAR * NPFD_KERNINGPAIRS, FAR * LPFD_KERNINGPAIRS;
  264. typedef struct _CONTEXTINFO { /* ci */
  265. ULONG cb; /* Length in bytes of this structure. */
  266. ULONG fl; /* Flags. */
  267. SIZEL sizlPPM; /* Device resolution in pels/meter. */
  268. POINTFX pfxSpot; /* Spot size in pels. */
  269. MAT2 matXform; /* Notional to Device transform. */
  270. } CONTEXTINFO, NEAR * NPCONTEXTINFO, FAR * LPCONTEXTINFO;
  271. typedef struct _CHARATTR { /* chattr */
  272. ULONG cb;
  273. ULONG iQuery; /* Query type. */
  274. GLYPH gi; /* Glyph index in font. */
  275. LPBYTE lpBuffer; /* Bitmap buffer. */
  276. ULONG cbLen; /* Size of buffer in bytes. */
  277. } CHARATTR, NEAR * NPCHARATTR, FAR * LPCHARATTR;
  278. /* bit-constants for fsType in IFIMETRICS */
  279. #define IFIMETRICS_FIXED 0x0001 /* Fixed pitch */
  280. #define IFIMETRICS_LICENSED 0x0002 /* dummy defenition */
  281. #define IFIMETRICS_SPARSE 0x0004 /* Incomplete font */
  282. #define IFIMETRICS_SCALEABLE 0x8000 /* scalable font */
  283. /* bit-constant for fsDefn in IFIMETRICS */
  284. #define IFIMETRICS_OUTLINE 0x0001 /* dummy definition */
  285. /* 1 - Outline. 0 - Raster */
  286. /* bit-constant for fsSelection in IFIMETRICS */
  287. #define IFIMETRICS_ITALIC 0x8000 /*Italic */
  288. #define IFIMETRICS_UNDERSCORE 0x4000 /*Underscored */
  289. #define IFIMETRICS_OVERSTRUCK 0x2000 /*Overstruck */
  290. /* bit-constant for fsSelection in IFIMETRICS valid for bitmap fonts */
  291. #define IFIMETRICS_NEGATIVE 0x1000 /*Negative image */
  292. #define IFIMETRICS_HOLLOW 0x0800 /*Outline (hollow) */
  293. typedef struct _IFIMETRICS { /* ifim */
  294. /* UNITS */
  295. UCHAR szFamilyname[FACESIZE]; /*Font Family Name, e.g. Roman */
  296. UCHAR szFacename[FACESIZE]; /*Face name, e.g. Tms Rmn Bold Italic */
  297. UCHAR szGlyphlistName[GLYPHNAMESIZE]; /*e.g. PM316, Latin-2, Greek */
  298. USHORT idRegistry; /*Dummy I */
  299. SHORT sCapEmHeight; /*Height of uppercase M N */
  300. SHORT sXHeight; /*Nominal height of lowercase N */
  301. SHORT sMaxAscender; /*Maximum height above baseline of any char N */
  302. SHORT sMaxDescender; /*Maximum depth below baseline of any char N */
  303. SHORT sLowerCaseAscent; /*Maximum height above baseline of any a-z N */
  304. SHORT sLowerCaseDescent; /*Maximum depth below basiline of any a-z N */
  305. SHORT sInternalLeading; /*White space within character N */
  306. SHORT sExternalLeading; /*White space between lines N */
  307. SHORT sAveCharWidth; /*Weighted average character width N */
  308. SHORT sMaxCharInc; /*Maximum character increment N */
  309. SHORT sEmInc; /*Increment for Capitals (typically 'M') N */
  310. SHORT sMaxBaselineExt; /*Height of character cell N */
  311. FIXED fxCharSlope; /*Slope angle, degrees, clockwise D */
  312. FIXED fxInlineDir; /*Drawing direction, degrees clockwise D */
  313. FIXED fxCharRot; /*Glyph rotation in cell, degrees clockwise D */
  314. USHORT usWeightClass; /*Character weight, 1-9 (1=ultra-light) I */
  315. USHORT usWidthClass; /*Character width, 1-9 (1=ultra condensed) I */
  316. SHORT sEmSquareSize; /*Em Square size, x-direction N */
  317. GLYPH giFirstChar; /*Number of first glyph in font I */
  318. GLYPH giLastChar; /*Number of last glyph in font I */
  319. GLYPH giDefaultChar; /*Glyph used if requested glyph invalid I */
  320. GLYPH giBreakChar; /*Space glyph I */
  321. ULONG aulPanose [1]; /*Panose Number */
  322. USHORT usNominalPointSize; /*Point size for which font was designed N */
  323. USHORT usMinimumPointSize; /*Minimum point size scaling for font N */
  324. USHORT usMaximumPointSize; /*Maximum point size scaling for font N */
  325. USHORT fsType; /*Type indicators (see #defines) B */
  326. USHORT fsDefn; /*Font definition data (see #defines) B */
  327. USHORT fsSelection; /*Font selection flags (see #defines) B */
  328. USHORT fsCapabilities; /*Font capabilities must be 0 B */
  329. SHORT sSubscriptXSize; /*Size in x-direction of subscript N */
  330. SHORT sSubscriptYSize; /*Size in y-direction of subscript N */
  331. SHORT sSubscriptXOffset; /*Offset in x-direction of subscript N */
  332. SHORT sSubscriptYOffset; /*Offset in y-direction of subscript N */
  333. SHORT sSuperscriptXSize; /*Size in x-direction of superscript N */
  334. SHORT sSuperscriptYSize; /*Size in y-direction of superscript N */
  335. SHORT sSuperscriptXOffset; /*Offset in x-direction of superscript N */
  336. SHORT sSuperscriptYOffset; /*Offset in y-direction of superscript N */
  337. SHORT sUnderscoreSize; /*Underscore size N */
  338. SHORT sUnderscorePosition; /*Underscore position N */
  339. SHORT sStrikeoutSize; /*Strikeout size N */
  340. SHORT sStrikeoutPosition; /*Strikeout position N */
  341. SHORT cKerningPairs; /*Number of kerning pairs in pair table I */
  342. ULONG ulFontClass; /*IBM font classification B */
  343. } IFIMETRICS, NEAR * NPIFIMETRICS, FAR * LPIFIMETRICS;
  344. #ifdef ENABLE_CONTROL_TAG
  345. /* Tag structure for Fd(i)Control */
  346. typedef struct {
  347. USHORT SubFunction;
  348. LPDEVICE lpDevice;
  349. LPFONTINFO lpFontStructure;
  350. LPTEXTXFORM lpXform;
  351. LPVOID lpInData;
  352. } CONTROLTAG, FAR * LPCONTROLTAG;
  353. #else
  354. typedef struct {
  355. USHORT SubFunction;
  356. LPVOID lpDevice;
  357. LPVOID lpFontStructure;
  358. LPVOID lpXform;
  359. LPVOID lpInData;
  360. } CONTROLTAG, FAR * LPCONTROLTAG;
  361. #endif
  362. #endif
  363. /****************************************/
  364. /* Attribute bits for FdOpenFontContext */
  365. /****************************************/
  366. #ifndef WIFEH_NOWIFEMAN_EUDCFONTCONTEXT
  367. #define OFC_EUDC_CONTEXT (0x80000000L)
  368. #endif
  369. #ifdef WIFE_CREATE_FONTDRIVER
  370. /***********************************************/
  371. /* PROTO-TYPE FOR EACH FUNCTION in FONT DRIVER */
  372. /***********************************************/
  373. LONG FAR PASCAL FdClaimFontFile( LPSTR lpszFileName );
  374. LONG FAR PASCAL FdConvertFontFile(
  375. LPSTR lpszSrcFileName,
  376. LPSTR lpszDestDirName,
  377. LPSTR lpszResultPackName
  378. );
  379. HFF FAR PASCAL FdLoadFontFile( LPSTR lpszPackName );
  380. LONG FAR PASCAL FdUnloadFontFile( HFF hFF );
  381. LONG FAR PASCAL FdQueryFaces(
  382. HFF hFF,
  383. LPIFIMETRICS lpIfiMetrics,
  384. ULONG cMetricLen,
  385. ULONG cFontCount,
  386. ULONG cStart
  387. );
  388. HFC FAR PASCAL FdOpenFontContext( HFF hFF, ULONG ulFont );
  389. LONG FAR PASCAL FdSetFontContext(
  390. HFC hFC,
  391. LPCONTEXTINFO lpContextInfo
  392. );
  393. LONG FAR PASCAL FdCloseFontContext( HFC hFC );
  394. LONG FAR PASCAL FdQueryFaceAttr(
  395. HFC hFC,
  396. ULONG iQuery,
  397. LPVOID lpBuffer,
  398. ULONG cb,
  399. LPVOID lpIndex,
  400. SHORT Start
  401. );
  402. LONG FAR PASCAL FdQueryCharAttr(
  403. HFC hFC,
  404. LPCHARATTR lpCharAttr,
  405. LPBITMAPMETRICS lpbmm
  406. );
  407. SHORT FAR PASCAL FdControl(
  408. HFC hFC,
  409. LPCONTROLTAG lpControlTag,
  410. LPVOID lpOutData
  411. );
  412. /******************************************/
  413. /* FAR PTR TO EACH FUNCTION */
  414. /******************************************/
  415. typedef LONG (FAR PASCAL * LPFDCLF)( LPSTR lpszFileName );
  416. typedef LONG (FAR PASCAL * LPFDCFF)(
  417. LPSTR lpszSrcFileName,
  418. LPSTR lpszDestDirName,
  419. LPSTR lpszResultPackName
  420. );
  421. typedef HFF (FAR PASCAL * LPFDLFF)( LPSTR lpszPackName );
  422. typedef LONG (FAR PASCAL * LPFDQF)(
  423. HFF hFF,
  424. LPIFIMETRICS lpIfiMetrics,
  425. ULONG cMetricLen,
  426. ULONG cFontCount,
  427. ULONG cStart
  428. );
  429. typedef LONG (FAR PASCAL * LPFDUFF)( HFF hFF );
  430. typedef HFC (FAR PASCAL * LPFDOFC)( HFF hFF, ULONG ulFont );
  431. typedef LONG (FAR PASCAL * LPFDSFC)(
  432. HFC hFC,
  433. LPCONTEXTINFO lpContextInfo
  434. );
  435. typedef LONG (FAR PASCAL * LPFDCFC)( HFC hFC );
  436. typedef LONG (FAR PASCAL * LPFDQFA)(
  437. HFC hFC,
  438. ULONG iQuery,
  439. LPVOID lpBuffer,
  440. ULONG cb,
  441. LPVOID lpIndex,
  442. SHORT Start
  443. );
  444. typedef LONG (FAR PASCAL * LPFDQCA)(
  445. HFC hFC,
  446. LPCHARATTR lpCharAttr,
  447. LPBITMAPMETRICS lpbmm
  448. );
  449. typedef SHORT (FAR PASCAL * LPFDCTL)(
  450. HFC hFC,
  451. LPCONTROLTAG lpControlTag,
  452. LPVOID lpOutData
  453. );
  454. typedef struct _FDHEADER { /* fdhdr */
  455. ULONG cbLength; /* Length of FDHEADER */
  456. UCHAR strId[16]; /* String 'WIFE FONT DRIVER' */
  457. UCHAR szTechnology[40]; /* Identifier of Font Driver technology */
  458. ULONG ulVersion; /* IFI version number (0x0100) */
  459. ULONG ufDeviceCaps; /* Capabilities of device */
  460. NPVOID npfddisp;
  461. SHORT dummy1;
  462. } FDHEADER, NEAR * NPFDHEADER, FAR * LPFDHEADER;
  463. #endif
  464. #define WIFE_CREATE_DEVICEDRIVER
  465. #ifdef WIFE_CREATE_DEVICEDRIVER
  466. /***********************************************/
  467. /* PROTO-TYPE FOR EACH FUNCTION in WIFEMAN.DLL */
  468. /***********************************************/
  469. /***********************************************/
  470. /* Module Install Manager */
  471. /***********************************************/
  472. #ifndef WIFEH_NOWIFEMAN_MIM
  473. typedef BOOL (FAR PASCAL * LPCBMEAD)
  474. ( LPSTR lpszFoundFileName, LPSTR lpszDescriptionName );
  475. BOOL FAR PASCAL MimEnumAvailableDrivers
  476. ( LPSTR lpszSeachFilePath, LPCBMEAD lpfCallBack );
  477. typedef BOOL (FAR PASCAL * LPCBMEAP)
  478. ( HFD hFD, LPSTR lpszPackName );
  479. BOOL FAR PASCAL MimEnumAvailablePacks
  480. ( HFD hFD, LPSTR lpszPackName, LPCBMEAP lpfCallBack );
  481. HFD FAR PASCAL MimAddFontDriver( LPSTR lpszFileName );
  482. HFF FAR PASCAL MimAddFontPack( HFD hFD, LPSTR lpszPackName );
  483. BOOL FAR PASCAL MimRemoveFontDriver( HFD hFD );
  484. BOOL FAR PASCAL MimRemoveFontPack( HFD hFD, HFF hFontPack );
  485. HFD FAR PASCAL MimEnumFontDrivers( HFD hLastDriver );
  486. HFF FAR PASCAL MimEnumFontPacks( HFD hFD, HFF hLastPack );
  487. HFC FAR PASCAL MimOpenFontContext( HFD hFD, HFF hFF, ULONG ulFont );
  488. LONG FAR PASCAL MimCloseFontContext( HFD hFD, HFF hFF, HFC hFC );
  489. typedef enum {
  490. MIMGETINFO_FD_DESCRIPTION = 0,
  491. MIMGETINFO_FF_DESCRIPTION = 1,
  492. MIMGETINFO_FD_FILENAME = 2,
  493. MIMGETINFO_FF_FILENAME = 3,
  494. MIMGETINFO_FD_USAGE = 4,
  495. MIMGETINFO_FF_USAGE = 5,
  496. MIMGETINFO_FD_INSTALL_COUNT = 6,
  497. MIMGETINFO_FF_INSTALL_COUNT = 7
  498. } MIMGETINFO_ORDER;
  499. SHORT FAR PASCAL MimGetInformations(
  500. MIMGETINFO_ORDER order,
  501. HFD hFD,
  502. HFF hFF,
  503. LPVOID AnswerBuffer,
  504. USHORT SizeOfBuffer
  505. );
  506. #endif
  507. /***********************************************/
  508. /* Font Driver Interface */
  509. /***********************************************/
  510. #ifndef WIFEH_NOWIFEMAN_FDI
  511. LONG FAR PASCAL FdiClaimFontFile( HFD hFD, LPSTR lpszFileName );
  512. LONG FAR PASCAL FdiConvertFontFile(
  513. HFD hFD,
  514. LPSTR lpszSrcFileName,
  515. LPSTR lpszDestDirName,
  516. LPSTR lpszResultPackName
  517. );
  518. HFF FAR PASCAL FdiLoadFontFile( HFD hFD, LPSTR lpszPackName );
  519. LONG FAR PASCAL FdiUnloadFontFile( HFD hFD, HFF hFF );
  520. LONG FAR PASCAL FdiQueryFaces(
  521. HFD hFD,
  522. HFF hFF, // Font File handle
  523. LPIFIMETRICS lpIfiMetrics, // Buffer for the metrics
  524. ULONG cMetricLen, // Length of the metrics structure
  525. ULONG cFontCount, // # of fonts wanted.
  526. ULONG cStart // index of the font to start with
  527. );
  528. HFC FAR PASCAL FdiOpenFontContext( HFD hFD, HFF hFF, ULONG ulFont );
  529. LONG FAR PASCAL FdiSetFontContext(
  530. HFD hFD,
  531. HFC hFC,
  532. LPCONTEXTINFO lpContextInfo
  533. );
  534. LONG FAR PASCAL FdiCloseFontContext( HFD hFD, HFC hFC );
  535. LONG FAR PASCAL FdiQueryFaceAttr(
  536. HFD hFD,
  537. HFC hFC,
  538. ULONG iQuery,
  539. LPVOID lpBuffer,
  540. ULONG cb,
  541. LPVOID lpIndex,
  542. SHORT Start
  543. );
  544. LONG FAR PASCAL FdiQueryCharAttr(
  545. HFD hFD,
  546. HFC hFC,
  547. LPCHARATTR lpCharAttr,
  548. LPBITMAPMETRICS lpbmm
  549. );
  550. SHORT FAR PASCAL FdiControl(
  551. HFD hFD,
  552. HFC hFC,
  553. LPCONTROLTAG lpControlTag,
  554. LPVOID lpOutData
  555. );
  556. #endif
  557. /***********************************************/
  558. /* Font Cacheing Manager */
  559. /***********************************************/
  560. #ifdef WIFE_ENABLE_FCM
  561. #define FCM_WIFE_CHARACTER 1
  562. #define FCM_CLIP_OUT 2
  563. #define FCM_LEFT_CLIP 0x0100
  564. #define FCM_RIGHT_CLIP 0x0200
  565. #define FCM_TOP_CLIP 0x0400
  566. #define FCM_BOTTOM_CLIP 0x0800
  567. typedef struct {
  568. USHORT SizeOfStruct; /* size of structire */
  569. WORD WifeFlag; /* FCM processing flags */
  570. UBCHAR ubCode; /* character code */
  571. LPSTR lpCacheBuffer; /* long ptr to cache bitmap */
  572. SHORT nBitWidth; /* x size of character image */
  573. SHORT nBitHeight; /* y size of character image */
  574. SHORT nByteWidth; /* byte width size in alloctaed buffer */
  575. USHORT InternalIndex; /* RESERVED FOR SYSTEM USE */
  576. } FCM_CHARACTERISTIC, NEAR *NP_FCM_CHARACTERISTIC, FAR *LP_FCM_CHARACTERISTIC;
  577. typedef struct {
  578. USHORT SizeOfStruct; /* size of structire */
  579. WORD WifeFlag; /* FCM processing flags */
  580. UBCHAR ubCode; /* character code */
  581. LPSTR lpCacheBuffer; /* long ptr to cache bitmap */
  582. SHORT nBitWidth; /* x size of character image */
  583. SHORT nBitHeight; /* y size of character image */
  584. SHORT nByteWidth; /* byte width size in alloctaed buffer */
  585. USHORT InternalIndex; /* RESERVED FOR SYSTEM USE */
  586. SHORT xPosOnDst; /* x position on dst device */
  587. SHORT yPosOnDst; /* y position on dst device */
  588. } FCM_EXTCHARACTERISTIC,
  589. NEAR * NP_FCM_EXTCHARACTERISTIC, FAR * LP_FCM_EXTCHARACTERISTIC;
  590. HFB FAR PASCAL FcmCreateCacheBuffer(
  591. HFD hFD,
  592. HFF hFF,
  593. ULONG ulFont,
  594. LPTEXTXFORM lpXform,
  595. USHORT usMinorCharSet,
  596. USHORT usAttribute
  597. );
  598. BOOL FAR PASCAL FcmDeleteCacheBuffer( HFB hFontBuffer );
  599. SHORT FAR PASCAL FcmRequestImages(
  600. HFB hFontBuffer,
  601. LP_FCM_CHARACTERISTIC AnswerBuffer,
  602. short length
  603. );
  604. BOOL FAR PASCAL FcmReleaseImages(
  605. HFB hFontBuffer,
  606. LP_FCM_CHARACTERISTIC AnswerBuffer,
  607. short length
  608. );
  609. HFB FAR PASCAL FcmRequestDefaultFB(
  610. LPFONTINFO lpFont,
  611. LPTEXTXFORM lpTextXform
  612. );
  613. BOOL FAR PASCAL FcmReleaseDefaultFB( HFB hFB );
  614. #define FCMCALC_BIGFONT 1
  615. #define FCMCALC_ROUGHCLIPINFO 2
  616. #define FCMCALC_DETAILCLIPINFO 4
  617. DWORD FAR PASCAL FcmCalculateTextExtent(
  618. HFB hFB,
  619. LPSTR lpString,
  620. short count,
  621. LPFONTINFO lpFont,
  622. LPDRAWMODE lpDrawMode,
  623. LPTEXTXFORM lpXform,
  624. LPSHORT lpCharWidths,
  625. USHORT usMode
  626. );
  627. SHORT FAR PASCAL FcmCalculateOutputPositions(
  628. HFB hFB,
  629. LP_FCM_EXTCHARACTERISTIC lpFcmCharacteristics,
  630. SHORT nArrayLength,
  631. LPSHORT lpx,
  632. LPSHORT lpy,
  633. LPRECT lpClipRect,
  634. LPSTR FAR * lplpString,
  635. LPSHORT lpcount,
  636. LPFONTINFO lpFont,
  637. LPDRAWMODE lpDrawMode,
  638. LPTEXTXFORM lpXform,
  639. LPSHORT FAR * lplpCharWidths,
  640. USHORT usMode
  641. );
  642. SHORT FAR PASCAL FcmCleanUp( VOID );
  643. HFB FAR PASCAL FcmEnumFontBuffers( HFB hLastBuffer );
  644. HFC FAR PASCAL FcmGetFontContext( HFB hFB );
  645. SHORT FAR PASCAL FcmCalcByteWidth( SHORT nBitWidth );
  646. SHORT FAR PASCAL FcmForceCacheIn( HFB hFB, LPUBCHAR lpubStr );
  647. BOOL FAR PASCAL FcmValidateFC( HFB hFB );
  648. BOOL FAR PASCAL FcmUnvalidateFC( HFB hFB );
  649. LONG FAR PASCAL FcmQueryFaceAttr(
  650. HFB hFB,
  651. ULONG iQuery,
  652. LPABC_TRIPLETS lpBuffer,
  653. ULONG cb,
  654. LPUBCHAR lpIndex,
  655. UBCHAR Start
  656. );
  657. #ifdef WIFE_ENABLE_FCM_CONTROL
  658. SHORT FAR PASCAL FcmIsProcessableDeviceControl(
  659. HFB hFB,
  660. SHORT nFunction,
  661. GAIJIINFO FAR * lpGI
  662. );
  663. SHORT FAR PASCAL FcmProcessDeviceControl(
  664. HFB hFB,
  665. SHORT nFunction,
  666. GAIJIINFO FAR * lpGI,
  667. LPVOID lpOutData
  668. );
  669. #endif
  670. USHORT FAR PASCAL FcmGetEUDCLeadByteRange( HFB hFB );
  671. HFB FAR PASCAL FcmGetEUDCFB( HFB hFB );
  672. USHORT FAR PASCAL FcmGetCharWidth(
  673. HFB hFB,
  674. LPUSHORT lpBuffer,
  675. USHORT wFirstChar,
  676. USHORT wLastChar,
  677. LPFONTINFO lpFont,
  678. LPDRAWMODE lpDrawMode,
  679. LPTEXTXFORM lpFontTrans,
  680. USHORT usExpandPixels,
  681. USHORT usMode
  682. );
  683. #endif
  684. #endif
  685. /***********************************************/
  686. /* WIFEMAN's Miscellaneous Service Functions */
  687. /***********************************************/
  688. #ifndef WIFEH_NOWIFEMAN_MISC
  689. BOOL FAR PASCAL MiscIsDBCSLeadByte( CHAR_SET CharSet, USHORT ch );
  690. #define MiscIsMBCSCharSet(c) (MiscIsDBCSLeadByte(c,0xffff))
  691. VOID FAR PASCAL MiscSetErroInfo( ULONG ErrorCode );
  692. ULONG FAR PASCAL MiscGetErroInfo( VOID );
  693. SHORT FAR PASCAL MiscWarningMessage(
  694. HANDLE hInst,
  695. USHORT idsMsg,
  696. USHORT idsTitle,
  697. USHORT mode
  698. );
  699. SHORT FAR PASCAL MiscWarningMessageWithArgument(
  700. HANDLE hInst,
  701. USHORT idsMsg,
  702. USHORT idsTitle,
  703. LPSTR lpszArgument,
  704. USHORT mode
  705. );
  706. #ifdef ENABLE_MESSAGEBOX
  707. /* MessageBox() Flags */
  708. #define MB_OK 0x0000
  709. #define MB_OKCANCEL 0x0001
  710. #define MB_ABORTRETRYIGNORE 0x0002
  711. #define MB_YESNOCANCEL 0x0003
  712. #define MB_YESNO 0x0004
  713. #define MB_RETRYCANCEL 0x0005
  714. #define MB_ICONHAND 0x0010
  715. #define MB_ICONQUESTION 0x0020
  716. #define MB_ICONEXCLAMATION 0x0030
  717. #define MB_ICONASTERISK 0x0040
  718. #define MB_ICONINFORMATION MB_ICONASTERISK
  719. #define MB_ICONSTOP MB_ICONHAND
  720. #define MB_DEFBUTTON1 0x0000
  721. #define MB_DEFBUTTON2 0x0100
  722. #define MB_DEFBUTTON3 0x0200
  723. #define MB_APPLMODAL 0x0000
  724. #define MB_SYSTEMMODAL 0x1000
  725. #define MB_TASKMODAL 0x2000
  726. #define MB_NOFOCUS 0x8000
  727. #define MB_TYPEMASK 0x000F
  728. #define MB_ICONMASK 0x00F0
  729. #define MB_DEFMASK 0x0F00
  730. #define MB_MODEMASK 0x3000
  731. #define MB_MISCMASK 0xC000
  732. #endif /* ENABLE_MESSAGEBOX */
  733. USHORT FAR PASCAL ubstrlen( LPUBCHAR cp );
  734. LPUBCHAR FAR PASCAL ubstrcpy( LPUBCHAR dst, LPUBCHAR src );
  735. LPUBCHAR FAR PASCAL ubstrncpy( LPUBCHAR dst, LPUBCHAR src, USHORT limit );
  736. LPUBCHAR FAR PASCAL ubstrcat( LPUBCHAR dst, LPUBCHAR src );
  737. LPUBCHAR FAR PASCAL ubstrncat( LPUBCHAR dst, LPUBCHAR src, USHORT limit );
  738. SHORT FAR PASCAL ubstrcmp( LPUBCHAR str1, LPUBCHAR str2 );
  739. USHORT FAR PASCAL AscizToUz(
  740. LPUBCHAR dst,
  741. LPSTR src,
  742. USHORT limit,
  743. CHAR_SET CharSet
  744. );
  745. USHORT FAR PASCAL UzToAsciz(
  746. LPSTR dst,
  747. LPUBCHAR src,
  748. USHORT limit
  749. );
  750. VOID FAR PASCAL MiscTrancateString(
  751. LPSTR lpszStr,
  752. SHORT length,
  753. SHORT CharSet
  754. );
  755. #define MiscTrancateByDefaultCharSet(s,l) MiscTrancateString(s,l,-1)
  756. ULONG FAR PASCAL MiscGetVersion( VOID );
  757. USHORT FAR PASCAL MiscGetEUDCLeadByteRange( CHAR_SET csCharSet );
  758. BYTE FAR PASCAL MiscConvertFontFamily( LPSTR szFamilyName );
  759. BYTE FAR PASCAL MiscConvertCharSet( LPSTR CharSetString );
  760. #ifdef WIFE_ENABLE_FONT_STRUCT_CONVERT
  761. /* follow two values are only for usLogicalMapFlag parameter */
  762. /* in MiscIfiMetricsToLogFont function. */
  763. #define LOGMAP_IGNORE_DESCENT 1
  764. #define LOGMAP_IGNORE_INTERNAL_LEADING 2
  765. #define LOGMAP_NEGATIVE (0x8000)
  766. VOID FAR PASCAL MiscIfiMetricsToLogFont(
  767. LPLOGFONT lpLogFont,
  768. LPIFIMETRICS lpIFIMetrics,
  769. USHORT usLogicalMapFlag
  770. );
  771. VOID FAR PASCAL MiscIfiMetricsToTextMetrics(
  772. LPTEXTMETRIC lpTextMetrics,
  773. LPIFIMETRICS lpIFIMetrics
  774. );
  775. #endif
  776. #ifdef WIFE_ENABLE_FONT_STRUCT_MAKE
  777. VOID FAR PASCAL MiscMakeTextXform(
  778. LPTEXTXFORM lpTXF,
  779. LPIFIMETRICS lpIM,
  780. LPLOGFONT lpLF
  781. );
  782. #endif
  783. #ifndef WIFEH_NO_HUGE_SUPPORT
  784. LPVOID FAR PASCAL MiscAddHugePtr( LPVOID src, ULONG offset );
  785. USHORT FAR PASCAL MiscGetSegmentIncrement( VOID );
  786. #endif
  787. #ifndef WIFEH_NO_CONTROL_RANGES
  788. BOOL FAR PASCAL MiscIsWifeControl( SHORT function );
  789. BOOL FAR PASCAL MiscIsGaijiControl( SHORT function );
  790. #endif
  791. #ifndef WIFEH_NO_STRETCHER
  792. BOOL FAR PASCAL MiscStretchMonoFontImage(
  793. LPVOID lpDestImage,
  794. USHORT usSizeOfDestX,
  795. USHORT usSizeOfDestY,
  796. LPVOID lpSrcImage,
  797. USHORT usSizeOfSrcX,
  798. USHORT usSizeOfSrcY
  799. );
  800. #endif
  801. #define WIFE_ENABLE_QUICK_SEARCH_TABLE
  802. #ifdef WIFE_ENABLE_QUICK_SEARCH_TABLE
  803. typedef struct {
  804. HFD hFD;
  805. HFF hFF;
  806. ULONG ulFont;
  807. BOOL bScalable;
  808. LOGFONT LogFont;
  809. }QUICK_SEARCH_TABLE, NEAR * NP_QUICK_SEARCH_TABLE, FAR * LP_QUICK_SEARCH_TABLE;
  810. LP_QUICK_SEARCH_TABLE FAR PASCAL MiscValidateQuickSearchTable(
  811. USHORT usLogicalMapFlag
  812. );
  813. BOOL FAR PASCAL MiscUnvalidateQuickSearchTable(
  814. USHORT usLogicalMapFlag
  815. );
  816. typedef LP_QUICK_SEARCH_TABLE (FAR PASCAL * LPMISCVALIDATEQST)(
  817. USHORT usLogicalMapFlag
  818. );
  819. typedef BOOL (FAR PASCAL * LPMISCUNVALIDATEQST)(
  820. USHORT usLogicalMapFlag
  821. );
  822. #define NMISCVALIDATEQST (67)
  823. #define NMISCUNVALIDATEQST (68)
  824. #endif
  825. #ifdef WIFE_ENABLE_NOTIFY_FUNCTIONS
  826. typedef enum {
  827. WN_ADD_FONTDRIVER = 0,
  828. WN_ADD_FONTPACKAGE = 1,
  829. WN_REMOVE_FONTDRIVER = 2,
  830. WN_REMOVE_FONTPACKAGE = 3,
  831. WN_REGISTER_SYSTEM_EUDC_CHAR = 4,
  832. WN_CHANGE_SYSTEM_EUDC_FILE = 5
  833. } WIFENOTIFY_ORDER;
  834. typedef struct {
  835. HFD hTargetFontDriver;
  836. } WNS_FONTDRIVER;
  837. typedef struct {
  838. HFD hTargetFontDriver;
  839. HFF hTargetFontPackage;
  840. } WNS_FONTPACKAGE;
  841. typedef struct {
  842. HFD hTargetFontDriver;
  843. HFF hTargetFontPackage;
  844. UBCHAR ubRegistedCharCode;
  845. } WNS_REGISTER_SYSTEM_EUDC_CHAR;
  846. typedef struct {
  847. HFD hTargetFontDriver;
  848. HFF hTargetFontPackage;
  849. LPSTR lpszNewFileName;
  850. } WNS_WN_CHANGE_SYSTEM_EUDC_FILE;
  851. typedef BOOL (FAR PASCAL * LPNOTIFYCALLBACKFUNC)(
  852. WIFENOTIFY_ORDER NotifyOrder,
  853. LPVOID lpParamBlock
  854. );
  855. BOOL FAR PASCAL MiscRegisterNotifyFunction(
  856. LPNOTIFYCALLBACKFUNC lpfnCallBack
  857. );
  858. BOOL FAR PASCAL MiscUnregisterNotifyFunction(
  859. LPNOTIFYCALLBACKFUNC lpfnCallBack
  860. );
  861. #endif
  862. #ifdef WIFE_ENABLE_REALIZE_FUNCTIONS
  863. WORD FAR PASCAL MiscRealizeWifeFont(
  864. LPLOGFONT lpLogFont,
  865. LPFONTINFO lpExtFont,
  866. LPTEXTXFORM lpTextXform
  867. );
  868. BOOL FAR PASCAL MiscDeleteWifeFont(
  869. LPFONTINFO lpExtFont
  870. );
  871. #endif
  872. #endif
  873. /***********************************************/
  874. /* DIAGNOSTIC TEST&CHECKING FUNCTIONS */
  875. /***********************************************/
  876. #ifdef ENABLE_DIAGNOSTIC_FUNCTION
  877. /* test and return error code */
  878. SHORT FAR PASCAL DiagSelfCheck( VOID );
  879. /* invoke self test and make error record file, display warning dialog */
  880. SHORT FAR PASCAL DiagSelfCheckAndWarning( VOID );
  881. #endif
  882. /************************************************/
  883. /* THESE ARE PRIVATE INTERFACE FOR TEST PROGRAM */
  884. /************************************************/
  885. #ifdef ENABLE_TEST_PROGRAM_INTERFACE
  886. LPVOID FAR PASCAL DiagLocalLockAnything( LOCALHANDLE hAny );
  887. LPVOID FAR PASCAL DiagLocalUnlockAnything( LOCALHANDLE hAny );
  888. SHORT FAR PASCAL DiagGetConfirmString( LPSTR buffer, SHORT length );
  889. #endif
  890. ////// for WOW ///////////
  891. #define IDS_NOTSUPORTFUNCTION 200
  892. #define IDS_WIFETITLE 201
  893. /* end of wife.h */