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.

179 lines
4.3 KiB

  1. /***
  2. **
  3. ** Module: T1Parser
  4. **
  5. ** Description:
  6. ** This is a module of the T1 to TT font converter. The module
  7. ** contains functions that is used by the Builder moduler, to
  8. ** manage the lowlevel writing to the TT font file, as well as
  9. ** generic check sum, table length and table offset computations.
  10. **
  11. ** Author: Michael Jansson
  12. **
  13. ** Created: 5/26/93
  14. **
  15. ***/
  16. #ifndef FWRITER_H
  17. #define FWRITER_H
  18. #ifndef _ARGS
  19. # define IN const
  20. # define OUT
  21. # define INOUT
  22. # define _ARGS(arg) arg
  23. #endif
  24. #define TBL_OS2 (USHORT)0
  25. #define TBL_CMAP (USHORT)1
  26. #define TBL_CVT (USHORT)2
  27. #define TBL_FPGM (USHORT)3
  28. #define TBL_GASP (USHORT)4
  29. #define TBL_GLYF (USHORT)5
  30. #define TBL_HEAD (USHORT)6
  31. #define TBL_HHEA (USHORT)7
  32. #define TBL_HMTX (USHORT)8
  33. #define TBL_KERN (USHORT)9
  34. #define TBL_LOCA (USHORT)10
  35. #define TBL_MAXP (USHORT)11
  36. #define TBL_NAME (USHORT)12
  37. #define TBL_POST (USHORT)13
  38. #define TBL_PREP (USHORT)14
  39. #define NUMTBL 15L
  40. #define TBLDIRSIZE (4L+4L+4L+4L)
  41. /* Referenced types. */
  42. typedef struct ioFile OutputFile;
  43. /***
  44. ** Function: WriteTableHeader
  45. **
  46. ** Description:
  47. ** This function initiates a TT font file, by initiating
  48. ** a handle used when writing the tables and by writing
  49. ** the leading table dictionary of the file.
  50. ***/
  51. void WriteTableHeader _ARGS((INOUT OutputFile *file));
  52. /***
  53. ** Function: OpenOutputFile
  54. **
  55. ** Description:
  56. ***/
  57. OutputFile *OpenOutputFile _ARGS((IN char *name));
  58. /***
  59. ** Function: CloseOutputFile
  60. **
  61. ** Description:
  62. ***/
  63. errcode CloseOutputFile _ARGS((INOUT OutputFile *fp));
  64. /***
  65. ** Function: FileError
  66. **
  67. ** Description:
  68. ***/
  69. boolean FileError _ARGS((INOUT OutputFile *fp));
  70. /***
  71. ** Function: FileTell
  72. **
  73. ** Description:
  74. ***/
  75. long FileTell _ARGS((INOUT OutputFile *fp));
  76. /***
  77. ** Function: WriteLong
  78. **
  79. ** Description:
  80. ** This function writes a 32-bit integer in the
  81. ** Big Endian byte order, regardless of the
  82. ** used byte order.
  83. ***/
  84. void WriteLong _ARGS((IN ULONG val,
  85. INOUT OutputFile *file));
  86. /***
  87. ** Function: WriteShort
  88. **
  89. ** Description:
  90. ** This function writes a 16-bit integer in the
  91. ** Big Endian byte order, regardless of the used
  92. ** byte order.
  93. ***/
  94. void WriteShort _ARGS((IN USHORT val,
  95. INOUT OutputFile *file));
  96. /***
  97. ** Function: WriteByte
  98. **
  99. ** Description:
  100. ** This function writes an 8-bit integer in the
  101. ** Big Endian byte order, regardless of used
  102. ** byte order.
  103. ***/
  104. void WriteByte _ARGS((IN UBYTE val,
  105. INOUT OutputFile *file));
  106. /***
  107. ** Function: WriteChecksum
  108. **
  109. ** Description:
  110. ** This function completes the whole TT font file,
  111. ** by computing the check sum of the whole file and writing
  112. ** it at the designated place.
  113. ***/
  114. void WriteChecksum _ARGS((IN long offset,
  115. INOUT OutputFile *file));
  116. /***
  117. ** Function: FileSeek
  118. **
  119. ** Description:
  120. ***/
  121. long FileSeek _ARGS((INOUT OutputFile *fp,
  122. IN long where));
  123. /***
  124. ** Function: WriteBytes
  125. **
  126. ** Description:
  127. ***/
  128. USHORT WriteBytes _ARGS((IN UBYTE *buf,
  129. IN USHORT len,
  130. INOUT OutputFile *fp));
  131. /***
  132. ** Function: CompleteTable
  133. **
  134. ** Description:
  135. ** This function completes a TT font file table,
  136. ** by computing the check sum and writing it, the
  137. ** table length and table offset to the table directory
  138. ** of the TT font file.
  139. **
  140. ** Please note the dependency that this function must
  141. ** be called right after the last byte of the contents
  142. ** of the table have been written.
  143. ***/
  144. errcode CompleteTable _ARGS((IN long offset,
  145. IN USHORT num,
  146. INOUT OutputFile *file));
  147. /***
  148. ** Function: RemoveFile
  149. **
  150. ** Description:
  151. ** Removes an already closed output file.
  152. ***/
  153. void RemoveFile _ARGS((IN char *name));
  154. #endif