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.

118 lines
3.5 KiB

  1. /*
  2. * Adobe Universal Font Library
  3. *
  4. * Copyright (c) 1996 Adobe Systems Inc.
  5. * All Rights Reserved
  6. *
  7. * GoodName -- Give a good name(searchable) for each downloaded glyph
  8. *
  9. *
  10. * $Header:
  11. */
  12. #ifndef GOODNAME_H
  13. #define GOODNAME_H
  14. /* --------------------------------------------------------- */
  15. /* For ToUnicode Information, we are interested in TTF's cmap of
  16. * Platform=3, Encoding=1 and cmapFormat=4
  17. for other format, we need to use external CodePoint To Unicode CMaps:
  18. WinPlatformID EncodingID Format Description
  19. 3 1 4 Unicode
  20. 3 2 4 ShiftJIS
  21. 3 3 4 PRC --- Not sure if this is PRC - TTF doc says Big5
  22. 3 4 4 Big5 --- We know this is actually Big5, see Win95CT's MingLi.ttc.
  23. 3 5 4 Wansung
  24. 3 6 4 Johab
  25. Also parse cmap of format 2, fix bug 274659, 12-29-98
  26. WinPlatformID EncodingID Format Description
  27. 3 1 2 Unicode
  28. 3 2 2 ShiftJIS
  29. 3 3 2 PRC --- Not sure if this is PRC - TTF doc says Big5
  30. 3 4 2 Big5 --- We know this is actually Big5, see Win95CT's MingLi.ttc.
  31. 3 5 2 Wansung
  32. 3 6 2 Johab
  33. */
  34. #define GSUB_HEADERSIZE 10 /* Version (4) + 3 Offsets(2) = 10 bytes */
  35. #define mort_HEADERSIZE 76 /* fixed size - see TT Spec for glyph metamorphosis table ('mort') */
  36. typedef enum
  37. {
  38. DTT_parseCmapOnly = 0,
  39. DTT_parseMoreGSUBOnly,
  40. DTT_parseAllTables
  41. }TTparseFlag;
  42. typedef enum
  43. {
  44. /* Microsoft platformID = 3 */
  45. DTT_Win_UNICODE_cmap2 = 0,
  46. DTT_Win_CS_cmap2,
  47. DTT_Win_CT_cmap2,
  48. DTT_Win_J_cmap2 ,
  49. DTT_Win_K_cmap2 ,
  50. DTT_Win_UNICODE_cmap4,
  51. DTT_Win_CS_cmap4,
  52. DTT_Win_CT_cmap4,
  53. DTT_Win_J_cmap4 ,
  54. DTT_Win_K_cmap4 ,
  55. }TTcmapFormat;
  56. #define TTcmap_IS_UNICODE(cf) \
  57. ((cf) == DTT_Win_UNICODE_cmap2 || (cf) == DTT_Win_UNICODE_cmap4)
  58. #define TTcmap_IS_FORMAT2(cf) \
  59. (((cf) >= DTT_Win_UNICODE_cmap2 && (cf) <= DTT_Win_K_cmap2) )
  60. #define TTcmap_IS_J_CMAP(cf) \
  61. ((cf) == DTT_Win_J_cmap2 || (cf) == DTT_Win_J_cmap4)
  62. #define TTcmap_IS_CS_CMAP(cf) \
  63. ((cf) == DTT_Win_CS_cmap2 || (cf) == DTT_Win_CS_cmap4)
  64. #define TTcmap_IS_CT_CMAP(cf) \
  65. ((cf) == DTT_Win_CT_cmap2 || (cf) == DTT_Win_CT_cmap4)
  66. #define TTcmap_IS_K_CMAP(cf) \
  67. ((cf) == DTT_Win_K_cmap2 || (cf) == DTT_Win_K_cmap4)
  68. typedef struct
  69. {
  70. unsigned short platformID;
  71. unsigned short encodingID;
  72. unsigned long offset;
  73. }SubTableEntry, *PSubTableEntry;
  74. typedef struct t_TTcmap2SubHeader
  75. {
  76. unsigned short firstCode;
  77. unsigned short entryCount;
  78. short idDelta;
  79. unsigned short idRangeOffset;
  80. }TTcmap2SH, *PTTcmap2SH;
  81. typedef struct t_TTcmap2Stuff
  82. {
  83. unsigned short* subHeaderKeys; /* Array of 256 USHORT, HighByte --> 8*subHeaderIndex */
  84. PTTcmap2SH subHeaders; /* SubHeaders */
  85. unsigned char* pByte; /* cmap data pointer, for Byte offset calculation */
  86. }TTcmap2Stuff;
  87. typedef struct t_TTcmap4Stuff
  88. {
  89. unsigned short segCount;
  90. unsigned short* endCode; /* End characterCode for each segment, last =0xFFFF.*/
  91. unsigned short* startCode;
  92. unsigned short* idDelta; /* Delta for all character codes in segment */
  93. unsigned short* idRangeOffset; /* Offsets into glyphIdArray or 0 */
  94. unsigned short* glyphIdArray;
  95. }TTcmap4Stuff;
  96. typedef struct t_TTmortStuff
  97. {
  98. unsigned short nEntries;
  99. unsigned short* pGlyphSet;
  100. }TTmortStuff;
  101. typedef struct t_TTGSUBStuff
  102. {
  103. unsigned short lookupCount;
  104. unsigned short* pLookupList;
  105. }TTGSUBStuff;
  106. #endif