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.

150 lines
4.3 KiB

  1. /***
  2. **
  3. ** Module: Encoding
  4. **
  5. ** Description:
  6. ** This is a module of the T1 to TT font converter. The module
  7. ** contains interface functions for the global encoding table,
  8. ** i.e. this is an abstract data type.
  9. **
  10. ** Author: Michael Jansson
  11. **
  12. ** Created: 6/13/93
  13. **
  14. ***/
  15. #ifndef _ARGS
  16. # define IN const
  17. # define OUT
  18. # define INOUT
  19. # define _ARGS(arg) arg
  20. #endif
  21. #define ENC_UNICODE (USHORT)0 /* Unicode */
  22. #define ENC_MSWINDOWS (USHORT)1 /* Microsoft Windows UGL sub-set encoding. */
  23. #define ENC_STANDARD (USHORT)2 /* Postscript Standard Encoding */
  24. #define ENC_MACCODES (USHORT)3 /* Mac encoding. */
  25. #define ENC_MAXCODES (USHORT)4
  26. #define NOTDEFCODE (USHORT)0xffff /* 0xfffff is not a vaild code point so use
  27. it for the .notdef character. */
  28. #define NOTDEFINIT 0xffffffffL /* Used to init encoding arrays. */
  29. #define NOTDEFGLYPH (USHORT)0 /* Glyph zero must be the notdef glyph. */
  30. #define NULLGLYPH (USHORT)1 /* Glyph one must be the null glyph. */
  31. /***
  32. ** Function: LookupNotDef
  33. **
  34. ** Description:
  35. ** look up a the .notdef character
  36. ***/
  37. const struct encoding *LookupNotDef _ARGS((void));
  38. /***
  39. ** Function: LookupPSName
  40. **
  41. ** Description:
  42. ** Do a binary search for a postscript name, and return
  43. ** a handle that can be used to look up a the character
  44. ** code for a specific encoding schema.
  45. ***/
  46. struct encoding *LookupPSName _ARGS((IN struct encoding *table,
  47. INOUT USHORT size,
  48. IN char *name));
  49. /***
  50. ** Function: LookupCharName
  51. **
  52. ** Description:
  53. ** look up a the character name for a
  54. ** specific encoding scheme.
  55. ***/
  56. const char *LookupCharName _ARGS((IN struct encoding *enc));
  57. /***
  58. ** Function: LookupCharCode
  59. **
  60. ** Description:
  61. ** look up a the character code for a
  62. ** specific encoding scheme.
  63. ***/
  64. USHORT LookupCharCode _ARGS((IN struct encoding *enc,
  65. IN USHORT type));
  66. /***
  67. ** Function: DecodeChar
  68. **
  69. ** Description:
  70. ** look up an encoding record for a character code in some
  71. ** known encoding.
  72. ***/
  73. const struct encoding *DecodeChar _ARGS((IN struct encoding *table,
  74. IN USHORT size,
  75. IN USHORT type,
  76. IN USHORT code));
  77. /***
  78. ** Function: AllocEncodingTable
  79. **
  80. ** Description:
  81. ** Create a new encoding ADT.
  82. ***/
  83. struct encoding *AllocEncodingTable _ARGS((IN USHORT num));
  84. /***
  85. ** Function: SetEncodingEntry
  86. **
  87. ** Description:
  88. ** Set the mapping from a glyph name to character
  89. ** codes for various platforms.
  90. ***/
  91. void SetEncodingEntry _ARGS((INOUT struct encoding *,
  92. IN USHORT entry,
  93. IN char *name,
  94. IN USHORT max,
  95. IN USHORT *codes));
  96. /***
  97. ** Function: RehashEncodingTable
  98. **
  99. ** Description:
  100. ** Prepare an encoding ADT so that entries can be
  101. ** located in it.
  102. ***/
  103. void RehashEncodingTable _ARGS((INOUT struct encoding *,
  104. IN USHORT num));
  105. /***
  106. ** Function: FreeEncoding
  107. **
  108. ** Description:
  109. ** Deallocate memory associated to the encoding array.
  110. ***/
  111. void FreeEncoding _ARGS((INOUT struct encoding *,
  112. IN USHORT num));
  113. /***
  114. ** Function: LookupFirstEnc
  115. **
  116. ** Description:
  117. ** Locate the first encoding for a given glyph.
  118. ***/
  119. const struct encoding *LookupFirstEnc(const struct encoding *encRoot,
  120. const int encSize,
  121. const struct encoding *encItem);
  122. /***
  123. ** Function: LookupNextEnc
  124. **
  125. ** Description:
  126. ** Locate the first encoding for a given glyph.
  127. ***/
  128. const struct encoding *LookupNextEnc(const struct encoding *encRoot,
  129. const int encSize,
  130. const struct encoding *encItem);