Leaked source code of windows server 2003
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.

738 lines
20 KiB

  1. /*++
  2. Copyright (c) 1996 Adobe Systems Incorporated
  3. Copyright (c) 1996-1999 Microsoft Corporation
  4. Module Name:
  5. afm2ntm.h
  6. Abstract:
  7. Header file for converting AFM to NTM.
  8. Environment:
  9. Windows NT PostScript driver.
  10. Revision History:
  11. 02/16/1998 -ksuzuki-
  12. Added CS_SHIFTJIS83 and others for OCF font support.
  13. 10/17/1997 -ksuzuki-
  14. Added CJK CMap names, fixed typos, and did clean-up.
  15. 10/24/1996 rkiesler@adobe.com
  16. Implemented.
  17. 09/16/1996 -slam-
  18. Created.
  19. --*/
  20. #ifndef _AFM2NTM_H_
  21. #define _AFM2NTM_H_
  22. //
  23. // Parsing Macros.
  24. //
  25. #define EOL(a) \
  26. (*a == '\r' || *a == '\n')
  27. #define IS_EOF(a) \
  28. (*a == -1)
  29. #define IS_WHTSPACE(a) \
  30. (*(a) <= ' ')
  31. #define IS_ALPHA(a) \
  32. ((*a > 'A' && *a < 'Z') || (*a > 'a' && *a < 'z'))
  33. #define IS_NUM(a) \
  34. (*(a) >= '0' && *(a) <= '9')
  35. #define IS_HEX_ALPHA(a) \
  36. ((*(a) >= 'a' && *(a) <= 'f') || (*(a) >= 'A' && *(a) <= 'F'))
  37. #define IS_HEX_DIGIT(a) \
  38. (IS_NUM(a) || IS_HEX_ALPHA(a))
  39. #define SKIP_WHTSPACE(a) \
  40. while ((IS_WHTSPACE(a)) && (!IS_EOF(a))) \
  41. { \
  42. ((ULONG_PTR) a)++; \
  43. }
  44. #define NEXT_LINE(a) \
  45. while ((!EOL(a)) && (!IS_EOF(a))) \
  46. { \
  47. ((ULONG_PTR) a)++; \
  48. } \
  49. SKIP_WHTSPACE(a)
  50. #define PARSE_TOKEN(a, Tok) \
  51. SKIP_WHTSPACE(a); \
  52. Tok = a; \
  53. do \
  54. { \
  55. if (!IS_EOF(a)) \
  56. ((ULONG_PTR) a)++; \
  57. } while (!IS_WHTSPACE(a) && !IS_EOF(a)); \
  58. while (!EOL(a) && !IS_EOF(a) && IS_WHTSPACE(a)) \
  59. { \
  60. ((ULONG_PTR) a)++; \
  61. }
  62. #define NEXT_TOKEN(a) \
  63. while(!EOL(a) && *(a) != ';') \
  64. ((ULONG_PTR) a)++; \
  65. while ((*(a) == ';' || IS_WHTSPACE(a))) \
  66. { \
  67. ((ULONG_PTR) (a))++; \
  68. }
  69. #define PARSE_RECT(ptr, rect) \
  70. rect.left = atoi(ptr); \
  71. while (!IS_WHTSPACE(ptr)) \
  72. ptr++; \
  73. SKIP_WHTSPACE(ptr); \
  74. rect.bottom = atoi(ptr); \
  75. while (!IS_WHTSPACE(ptr)) \
  76. ptr++; \
  77. SKIP_WHTSPACE(ptr); \
  78. rect.right = atoi(ptr); \
  79. while (!IS_WHTSPACE(ptr)) \
  80. ptr++; \
  81. SKIP_WHTSPACE(ptr); \
  82. rect.top = atoi(ptr); \
  83. while (!IS_WHTSPACE(ptr)) \
  84. ptr++; \
  85. SKIP_WHTSPACE(ptr)
  86. //
  87. // Macro to detect comments in font .DAT files. This macro is NOT for use
  88. // with AFMs.
  89. //
  90. #define IS_COMMENT(a) \
  91. (*(a) == '#')
  92. //
  93. // Token structure.
  94. //
  95. typedef struct _AFM_TOKEN
  96. {
  97. PSZ psTokName; // ASCII Key Name
  98. PFN pfnTokHndlr; // Ptr to token handler fct
  99. } AFM_TOKEN;
  100. #define PS_CH_METRICS_TOK "StartCharMetrics"
  101. #define PS_CH_NAME_TOK "N"
  102. #define PS_CH_CODE_TOK "C"
  103. #define PS_CH_BBOX_TOK "B"
  104. #define PS_FONT_NAME_TOK "FontName"
  105. #define PS_FONT_FULL_NAME_TOK "FullName"
  106. #define PS_FONT_MS_NAME_TOK "MSFaceName"
  107. #define PS_FONT_FAMILY_NAME_TOK "FamilyName"
  108. #define PS_FONT_VERSION_TOK "Version"
  109. #define PS_CHAR_WIDTH_TOK "CharWidth"
  110. #define PS_PITCH_TOK "IsFixedPitch"
  111. #define PS_CH_WIDTH_TOK "WX"
  112. #define PS_CH_WIDTH0_TOK "W0X"
  113. #define PS_COMMENT_TOK "Comment"
  114. #define PS_END_METRICS_TOK "EndCharMetrics"
  115. #define PS_FONT_BBOX_TOK "FontBBox"
  116. #define PS_FONT_BBOX2_TOK "FontBBox2"
  117. #define PS_EOF_TOK "EndFontMetrics"
  118. #define PS_UNDERLINE_POS_TOK "UnderlinePosition"
  119. #define PS_UNDERLINE_THICK_TOK "UnderlineThickness"
  120. #define PS_KERN_DATA_TOK "StartKernData"
  121. #define PS_NUM_KERN_PAIRS_TOK "StartKernPairs"
  122. #define PS_END_KERN_PAIRS_TOK "EndKernPairs"
  123. #define PS_KERN_PAIR_TOK "KPX"
  124. #define PS_CHARSET_TOK "CharacterSet"
  125. #define PS_STANDARD_CHARSET_TOK "Standard"
  126. #define PS_SPECIAL_CHARSET_TOK "Special"
  127. #define PS_EXTENDED_CHARSET_TOK "ExtendedRoman"
  128. #define PS_ITALIC_TOK "ItalicAngle"
  129. #define PS_WEIGHT_TOK "Weight"
  130. #define PS_ENCODING_TOK "EncodingScheme"
  131. #define PS_SYMBOL_ENCODING "FontSpecific"
  132. #define PS_STANDARD_ENCODING "AdobeStandardEncoding"
  133. #define PS_CH_NAME_EASTEUROPE "ncaron"
  134. #define PS_CH_NAME_RUSSIAN "afii10071"
  135. #define PS_CH_NAME_ANSI "ecircumflex"
  136. #define PS_CH_NAME_GREEK "upsilondieresis"
  137. #define PS_CH_NAME_TURKISH "Idotaccent"
  138. #define PS_CH_NAME_HEBREW "afii57664"
  139. #define PS_CH_NAME_ARABIC "afii57410"
  140. #define PS_CH_NAME_BALTIC "uogonek"
  141. #define PS_CIDFONT_TOK "IsCIDFont"
  142. #define CHAR_NAME_LEN 50
  143. #define NUM_PS_CHARS 602
  144. #define NUM_UNICODE_CHARS 0x10000
  145. #define MAX_TOKENS 3
  146. #define NUM_CHARSETS 8
  147. #define CS_THRESHOLD 200
  148. #define MAX_CSET_CHARS 256
  149. #define MAX_ASCII 127
  150. #define CAP_HEIGHT_CHAR "H"
  151. #define CAP_HEIGHT_CH 'H'
  152. #define X_HEIGHT_CHAR "x"
  153. #define X_HEIGHT_CH 'x'
  154. #define LWR_ASCENT_CHAR "d"
  155. #define LWR_ASCENT_CH 'd'
  156. #define LWR_DESCENT_CHAR "p"
  157. #define LWR_DESCENT_CH 'p'
  158. #define UNICODE_PRV_STRT 0xf000
  159. #define ANSI_CCODE_MAX 0x007f
  160. // Equivalent symbol to '.notdef1f' (ref. unipstbl.c)
  161. #define NOTDEF1F 0x1f
  162. // Some CharSet numbers made up - only meaningful to the driver itself
  163. #define ADOBE228_CHARSET 255 // Internally, we use the CodePage 0xFFF1 to match CharCol256
  164. #define ADOBE314_CHARSET 255 // Internally, we use the CodePage 0xFFF2 to match CharCol257
  165. // Special codepage for symbol fonts and the driver itself
  166. #define SYMBOL_CODEPAGE 4
  167. //
  168. // Defs related to FD_GLYPHSET (unicode->glyphindex map) generation.
  169. //
  170. // Type which indicates source of "recommended" PS character name.
  171. //
  172. typedef enum
  173. {
  174. SRC_NONE, // There is no "recommended" PS char name
  175. SRC_ADOBE_CURRENT, // Font name used in "shipping" font
  176. SRC_ADOBE_FUTURE, // Font name to be used in future fonts
  177. SRC_MSDN, // Name from MS Dev Network Docs
  178. SRC_AFII // Some folks met and agreed on this name
  179. } CHARNAMESRC;
  180. //
  181. // Possible Charsets supported by this font. Note that the charsets are
  182. // listed in Win 3.x codepage order.
  183. //
  184. typedef enum
  185. {
  186. CS_228 = 0,
  187. CS_314,
  188. CS_EASTEUROPE,
  189. CS_SYMBOL,
  190. CS_RUSSIAN,
  191. CS_ANSI,
  192. CS_GREEK,
  193. CS_TURKISH,
  194. CS_HEBREW,
  195. CS_ARABIC,
  196. CS_BALTIC,
  197. CS_ANSI_RUS,
  198. CS_ANSI_RUS_EE_BAL_TURK,
  199. CS_WEST_MAX,
  200. CS_CHINESEBIG5 = CS_WEST_MAX,
  201. CS_GB2312,
  202. CS_SHIFTJIS,
  203. CS_SHIFTJISP,
  204. CS_SHIFTJIS83, // Bogus for OCF font support
  205. CS_HANGEUL,
  206. CS_HANGEULHW, // Added for fixing bug 360206
  207. CS_JOHAB,
  208. CS_MAX,
  209. CS_UNICODE, // This codepage NOT to be referenced by NTMs!
  210. CS_DEFAULT,
  211. CS_OEM,
  212. CS_VIETNAMESE,
  213. CS_THAI,
  214. CS_MAC,
  215. CS_NOCHARSET
  216. } CHSETSUPPORT, *PCHSETSUPPORT;
  217. #define CS_UNIQUE CS_MAX // Charset is unique to this font.
  218. #define CS_EURO \
  219. (\
  220. CSUP(CS_228) | \
  221. CSUP(CS_EASTEUROPE) | \
  222. CSUP(CS_RUSSIAN) | \
  223. CSUP(CS_ANSI) | \
  224. CSUP(CS_GREEK) | \
  225. CSUP(CS_TURKISH) | \
  226. CSUP(CS_HEBREW) | \
  227. CSUP(CS_ARABIC) | \
  228. CSUP(CS_BALTIC) \
  229. )
  230. #define CS_ALL \
  231. (\
  232. CSUP(CS_228) | \
  233. CSUP(CS_314) | \
  234. CSUP(CS_EASTEUROPE) | \
  235. CSUP(CS_SYMBOL) | \
  236. CSUP(CS_RUSSIAN) | \
  237. CSUP(CS_ANSI) | \
  238. CSUP(CS_GREEK) | \
  239. CSUP(CS_TURKISH) | \
  240. CSUP(CS_HEBREW) | \
  241. CSUP(CS_ARABIC) | \
  242. CSUP(CS_BALTIC) | \
  243. CSUP(CS_ANSI_RUS) | \
  244. CSUP(CS_ANSI_RUS_EE_BAL_TURK) | \
  245. \
  246. CSUP(CS_CHINESEBIG5) | \
  247. CSUP(CS_GB2312) | \
  248. CSUP(CS_SHIFTJIS) | \
  249. CSUP(CS_SHIFTJISP) | \
  250. CSUP(CS_SHIFTJIS83) | \
  251. CSUP(CS_HANGEUL) | \
  252. CSUP(CS_HANGEULHW) | \
  253. CSUP(CS_JOHAB) | \
  254. \
  255. CSUP(CS_DEFAULT) | \
  256. CSUP(CS_OEM) | \
  257. CSUP(CS_VIETNAMESE) | \
  258. CSUP(CS_THAI) | \
  259. CSUP(CS_MAC) \
  260. )
  261. #define CS_CJK \
  262. (\
  263. CSUP(CS_CHINESEBIG5) | \
  264. CSUP(CS_GB2312) | \
  265. CSUP(CS_SHIFTJIS) | \
  266. CSUP(CS_SHIFTJISP) | \
  267. CSUP(CS_SHIFTJIS83) | \
  268. CSUP(CS_HANGEUL) | \
  269. CSUP(CS_HANGEULHW) | \
  270. CSUP(CS_JOHAB) \
  271. )
  272. //
  273. // Standard GLYPHSETDATA names. These are #defines as someday they may
  274. // become public.
  275. //
  276. #define ADOBE228_GS_NAME "228"
  277. #define ADOBE314_GS_NAME "314"
  278. #define EASTEUROPE_GS_NAME "Eastern European"
  279. #define SYMBOL_GS_NAME "Symbol"
  280. #define CYRILLIC_GS_NAME "Cyrillic"
  281. #define ANSI_GS_NAME "ANSI"
  282. #define GREEK_GS_NAME "Greek"
  283. #define TURKISH_GS_NAME "Turkish"
  284. #define HEBREW_GS_NAME "Hebrew"
  285. #define ARABIC_GS_NAME "Arabic"
  286. #define BALTIC_GS_NAME "Baltic"
  287. #define ANSI_CYR_GS_NAME "ANSI/Cyrillic"
  288. #define ANSI_CYR_EE_BAL_TURK_GS_NAME "ANSI/Cyrillic/EastEurope/Baltic/Turkish"
  289. #define CHN_BIG5_GS_NAME "--ETen-B5-"
  290. #define CHN_SMPL_GBK_GS_NAME "--GBK-EUC-"
  291. #define SHIFTJIS_GS_NAME "-90ms-RKSJ-"
  292. #define SHIFTJIS_P_GS_NAME "-90msp-RKSJ-"
  293. #define KSCMS_UHC_GS_NAME "--KSCms-UHC-"
  294. #define KSC_JOHAB_GS_NAME "--KSC-Johab-"
  295. #define UNICODE_GS_NAME "Unicode"
  296. #define CHN_SMPL_GB_GS_NAME "--GB-EUC-"
  297. #define CHN_SMPL_GBT_GS_NAME "--GBT-EUC-"
  298. #define CHN_B5_GS_NAME "--B5-"
  299. #define SHIFTJIS_83PV_GS_NAME "-83pv-RKSJ-"
  300. #define KSC_GS_NAME "--KSC-EUC-"
  301. #define KSCMS_UHC_HW_GS_NAME "--KSCms-UHC-HW-"
  302. #define SHIFTJIS_P_GS_HNAME "-90msp-RKSJ-H"
  303. #define SHIFTJIS_P_GS_VNAME "-90msp-RKSJ-V"
  304. #define KSCMS_UHC_GS_HNAME "--KSCms-UHC-H"
  305. #define KSCMS_UHC_GS_VNAME "--KSCms-UHC-V"
  306. //
  307. // CJK related stuff.
  308. //
  309. #define CMAPS_PER_COL 4
  310. //
  311. // Win CJK Codepage values.
  312. //
  313. #define CH_BIG5 950 // Traditional Chinese
  314. #define CH_SIMPLE 936 // Simplified Chinese
  315. #define CH_JIS 932 // Japanese
  316. #define CH_HANA 949 // Korean Wansung
  317. #define CH_JOHAB 1361 // Korean Johab
  318. //
  319. // Font Metrics Stuff.
  320. //
  321. #define EM 1000
  322. #define NOTDEF_WIDTH_BIAS 166 // Bias of space char in avg charwidth
  323. // computation.
  324. //
  325. // Structure to xlat between Postscript char names and unicode code points.
  326. //
  327. typedef struct _UPSCODEPT
  328. {
  329. WCHAR wcUnicodeid; // Unicode code point
  330. PUCHAR pPsName; // PS Char Name
  331. CHSETSUPPORT flCharSets; // Which Win CPs are supported?
  332. } UPSCODEPT, *PUPSCODEPT;
  333. //
  334. // Structure to store AFM char metrics.
  335. //
  336. typedef struct _AFMCHMETRICS
  337. {
  338. ULONG chWidth; // WX, W0X: Char width
  339. } AFMCHMETRICS, *PAFMCHMETRICS;
  340. //
  341. // PS Char Info Structure.
  342. //
  343. typedef struct _PSCHARMETRICS
  344. {
  345. CHAR pPsName[CHAR_NAME_LEN];
  346. ULONG chWidth;
  347. RECT rcChBBox;
  348. } PSCHARMETRICS, *PPSCHARMETRICS;
  349. //
  350. // Codepage mapping table structure. Maps PS char names to Win
  351. // codepages/codepoints.
  352. //
  353. //
  354. // Win codept to PS char name mapping.
  355. //
  356. typedef struct _WINCPT
  357. {
  358. PUCHAR pPsName; // PS Char Name
  359. USHORT usWinCpt; // Windows codept
  360. } WINCPT, *PWINCPT;
  361. //
  362. // Win Codepage to PS char name mapping.
  363. //
  364. typedef struct _WINCPTOPS
  365. {
  366. USHORT usACP; // Windows ANSI Codepage
  367. BYTE jWinCharset; // Win 3.1 IFIMETRICS.jWinCharset
  368. PUCHAR pGSName; // Glyphset name for this Codepage
  369. ULONG ulChCnt; // Count of supported chars
  370. WINCPT aWinCpts[MAX_CSET_CHARS];
  371. } WINCPTOPS, *PWINCPTOPS;
  372. //
  373. // Win codepoint to Unicode mapping.
  374. //
  375. typedef struct _UNIWINCPT
  376. {
  377. WCHAR wcWinCpt; // Windows charcode value
  378. WCHAR wcUnicodeid; // Unicode id
  379. } UNIWINCPT, *PUNIWINCPT;
  380. //
  381. // Windows codepage structure.
  382. //
  383. typedef struct _WINCODEPAGE
  384. {
  385. USHORT usNumBaseCsets; // # of base csets
  386. PSZ pszCPname; // Name of this "codepage"
  387. CHSETSUPPORT pCsetList[CS_MAX]; // ptr to base csets supported
  388. } WINCODEPAGE, *PWINCODEPAGE;
  389. //
  390. // Structure used to store EXTTEXTMETRIC info which must be derived
  391. // from the AFM char metrics. These fields are identical to the fields
  392. // etmCapHeight -> etmLowerCaseDescent in the EXTTEXTMETRIC struct.
  393. //
  394. typedef struct _ETMINFO
  395. {
  396. SHORT etmCapHeight;
  397. SHORT etmXHeight;
  398. SHORT etmLowerCaseAscent;
  399. SHORT etmLowerCaseDescent;
  400. } ETMINFO, *PETMINFO;
  401. //
  402. // Generic Key-Value pair.
  403. //
  404. typedef struct _KEY
  405. {
  406. CHAR pName[CHAR_NAME_LEN]; // Key name
  407. USHORT usValue; // Value
  408. } KEY, *PKEY;
  409. //
  410. // Format of table entries which map PS font names to MS face (family) names.
  411. //
  412. typedef struct _PSFAMILYINFO
  413. {
  414. CHAR pFontName[CHAR_NAME_LEN];
  415. CHAR pEngFamilyName[CHAR_NAME_LEN];
  416. KEY FamilyKey;
  417. USHORT usPitch;
  418. } PSFAMILYINFO, *PPSFAMILYINFO;
  419. //
  420. // Generic table struct.
  421. //
  422. typedef struct _TBL
  423. {
  424. USHORT usNumEntries; // Number of PSFAMILYINFOs
  425. PVOID pTbl; // -> to table entries
  426. } TBL, *PTBL;
  427. //
  428. // Macro used to determine if a particular codept's CHSETSUPPORT field
  429. // (see UPSCODEPT above) indicates support for a particular charset.
  430. //
  431. #define CSUP(a) \
  432. (1 << a)
  433. #define CSET_SUPPORT(cpt, cset) \
  434. (cpt & (CSUP(cset)))
  435. //
  436. // Macros used to determine if a char from a glyphset is supported by a
  437. // font. Takes the char index and IsCharDefined table as parms.
  438. //
  439. #define CHR_DEF(gi) \
  440. (1 << (gi % 8))
  441. #define CHR_DEF_INDEX(gi) \
  442. (gi / 8)
  443. #define IS_CHAR_DEFINED(gi, cdeftbl) \
  444. (cdeftbl[CHR_DEF_INDEX(gi)] & CHR_DEF(gi))
  445. #define DEFINE_CHAR(gi, cdeftbl) \
  446. (cdeftbl[CHR_DEF_INDEX(gi)] |= CHR_DEF(gi))
  447. //
  448. // Macro used to create a void ptr from a pointer to a structure and its
  449. // element name. The result must be cast to the desired type.
  450. //
  451. #ifndef MK_PTR
  452. #define MK_PTR(pstruct, element) ((PVOID)((PBYTE)(pstruct)+(pstruct)->element))
  453. #endif
  454. //
  455. // External global data defined in UNIPSTBL.C.
  456. //
  457. extern ULONG cFontChsetCnt[CS_MAX];
  458. extern UPSCODEPT PstoUnicode[NUM_PS_CHARS];
  459. extern PUPSCODEPT UnicodetoPs;
  460. extern WINCODEPAGE aStdCPList[];
  461. extern AFM_TOKEN afmTokenList[MAX_TOKENS];
  462. extern WINCPTOPS aPStoCP[];
  463. extern WINCODEPAGE aStdCPList[];
  464. extern char *TimesAlias[];
  465. extern char *HelveticaAlias[];
  466. extern char *CourierAlias[];
  467. extern char *HelveticaNarrowAlias[];
  468. extern char *PalatinoAlias[];
  469. extern char *BookmanAlias[];
  470. extern char *NewCenturySBAlias[];
  471. extern char *AvantGardeAlias[];
  472. extern char *ZapfChanceryAlias[];
  473. extern char *ZapfDingbatsAlias[];
  474. extern KEY FontFamilies[];
  475. extern PWCHAR DatFileName;
  476. extern PTBL pFamilyTbl;
  477. extern TBL FamilyKeyTbl;
  478. extern TBL PitchKeyTbl;
  479. extern TBL WeightKeyTbl[];
  480. extern TBL CjkColTbl;
  481. extern ULONG CharWidthBias[];
  482. extern PWCHAR CjkFnameTbl[8][CMAPS_PER_COL];
  483. extern WINCODEPAGE UnicodePage;
  484. extern char *PropCjkGsNames[];
  485. extern PSTR pAFMCharacterSetString;
  486. //
  487. // Local fct protos.
  488. //
  489. PNTM
  490. AFMToNTM(
  491. PBYTE pAFM,
  492. PGLYPHSETDATA pGlyphSetData,
  493. PULONG pUniPs,
  494. CHSETSUPPORT *pCharSet,
  495. BOOL bIsCJKFont,
  496. BOOL bIs90mspFont
  497. );
  498. CHSETSUPPORT
  499. GetAFMCharSetSupport(
  500. PBYTE pAFM,
  501. CHSETSUPPORT *pGlyphSet
  502. );
  503. PBYTE
  504. FindAFMToken(
  505. PBYTE pAFM,
  506. PSZ pszToken
  507. );
  508. extern int __cdecl
  509. StrCmp(
  510. const VOID *str1,
  511. const VOID *str2
  512. );
  513. extern size_t
  514. StrLen(
  515. PBYTE pString
  516. );
  517. extern int
  518. AFM2NTMStrCpy(
  519. const VOID *str1,
  520. size_t cchDest,
  521. const VOID *str2
  522. );
  523. extern int __cdecl
  524. StrPos(
  525. const PBYTE str1,
  526. CHAR c
  527. );
  528. int __cdecl
  529. CmpUniCodePts(
  530. const VOID *p1,
  531. const VOID *p2
  532. );
  533. static int __cdecl
  534. CmpUnicodePsNames(
  535. const VOID *p1,
  536. const VOID *p2
  537. );
  538. extern int __cdecl
  539. CmpPsChars(
  540. const VOID *p1,
  541. const VOID *p2
  542. );
  543. ULONG
  544. CreateGlyphSets(
  545. PGLYPHSETDATA *pGlyphSet,
  546. PWINCODEPAGE pWinCodePage,
  547. PULONG *pUniPs
  548. );
  549. ULONG
  550. BuildPSFamilyTable(
  551. PBYTE pDatFile,
  552. PTBL *pPsFamilyTbl,
  553. ULONG ulFileSize
  554. );
  555. LONG
  556. FindClosestCodePage(
  557. PWINCODEPAGE *pWinCodePages,
  558. ULONG ulNumCodePages,
  559. CHSETSUPPORT chSets,
  560. PCHSETSUPPORT pchCsupMatch
  561. );
  562. ULONG
  563. GetAFMCharWidths(
  564. PBYTE pAFM,
  565. PWIDTHRUN *pWidthRuns,
  566. PPSCHARMETRICS pFontChars,
  567. PULONG pUniPs,
  568. ULONG ulChCnt,
  569. PUSHORT pusAvgCharWidth,
  570. PUSHORT pusMaxCharWidth
  571. );
  572. ULONG
  573. GetAFMETM(
  574. PBYTE pAFM,
  575. PPSCHARMETRICS pFontChars,
  576. PETMINFO pEtmInfo
  577. );
  578. ULONG
  579. GetAFMKernPairs(
  580. PBYTE pAFM,
  581. FD_KERNINGPAIR *pKernPairs,
  582. PGLYPHSETDATA pGlyphSetData
  583. );
  584. static int __cdecl
  585. CmpPsChars(
  586. const VOID *p1,
  587. const VOID *p2
  588. );
  589. static int __cdecl
  590. CmpPsNameWinCpt(
  591. const VOID *p1,
  592. const VOID *p2
  593. );
  594. static int __cdecl
  595. CmpKernPairs(
  596. const VOID *p1,
  597. const VOID *p2
  598. );
  599. int __cdecl
  600. CmpGlyphRuns(
  601. const VOID *p1,
  602. const VOID *p2
  603. );
  604. ULONG
  605. BuildPSCharMetrics(
  606. PBYTE pAFM,
  607. PULONG pUniPs,
  608. PPSCHARMETRICS pFontChars,
  609. PBYTE pCharDefTbl,
  610. ULONG cGlyphSetChars
  611. );
  612. ULONG
  613. cjGetFamilyAliases(
  614. IFIMETRICS *pifi,
  615. PSTR pstr,
  616. UINT cp
  617. );
  618. PBYTE
  619. FindStringToken(
  620. PBYTE pPSFile,
  621. PBYTE pToken
  622. );
  623. BOOLEAN
  624. AsciiToHex(
  625. PBYTE pStr,
  626. PUSHORT pNum
  627. );
  628. BOOLEAN
  629. IsPiFont(
  630. PBYTE pAFM
  631. );
  632. BOOLEAN
  633. IsCJKFixedPitchEncoding(
  634. PGLYPHSETDATA pGlyphSetData
  635. );
  636. PBYTE
  637. FindUniqueID(
  638. PBYTE pAFM
  639. );
  640. #endif //!_AFM2NTM_H_