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.

297 lines
5.3 KiB

  1. /******************************Module*Header*******************************\
  2. * Module Name: cvt.h
  3. *
  4. * function declarations that are private to cvt.c
  5. *
  6. * Created: 26-Nov-1990 17:39:35
  7. * Author: Bodin Dresevic [BodinD]
  8. *
  9. * Copyright (c) 1990 Microsoft Corporation
  10. *
  11. \**************************************************************************/
  12. FSHORT
  13. fsSelectionFlags(
  14. PBYTE
  15. );
  16. VOID
  17. vAlignHdrData(
  18. PCVTFILEHDR,
  19. PRES_ELEM
  20. );
  21. BOOL
  22. bVerifyResource(
  23. PCVTFILEHDR,
  24. PRES_ELEM
  25. );
  26. BOOL
  27. bVerifyFNTQuick(
  28. PRES_ELEM
  29. );
  30. BOOL
  31. bVerifyFNT(
  32. PCVTFILEHDR,
  33. PRES_ELEM
  34. );
  35. BOOL
  36. bGrep(
  37. PSZ,
  38. PSZ
  39. );
  40. VOID
  41. vFigureVendorId(
  42. CHAR*,
  43. PSZ
  44. );
  45. BYTE
  46. jFamilyType(
  47. FSHORT
  48. );
  49. ULONG
  50. cjGLYPHDATA(
  51. ULONG
  52. );
  53. USHORT
  54. usConvertWeightClass(
  55. USHORT
  56. );
  57. VOID
  58. vComputeSpecialChars(
  59. PCVTFILEHDR,
  60. PWCHAR,
  61. PWCHAR
  62. );
  63. PBYTE
  64. pjRawBitmap(
  65. HGLYPH,
  66. PCVTFILEHDR,
  67. PRES_ELEM,
  68. PULONG
  69. );
  70. BOOL
  71. bDescStr(
  72. PVOID,
  73. SIZE_T,
  74. PSZ
  75. );
  76. VOID
  77. vCvtToBmp(
  78. GLYPHBITS *,
  79. GLYPHDATA *,
  80. PBYTE,
  81. ULONG,
  82. ULONG,
  83. ULONG
  84. );
  85. VOID
  86. vCvtToBoldBmp(
  87. GLYPHBITS *,
  88. GLYPHDATA *,
  89. PBYTE,
  90. ULONG,
  91. ULONG,
  92. ULONG
  93. );
  94. VOID
  95. vCvtToItalicBmp(
  96. GLYPHBITS *,
  97. GLYPHDATA *,
  98. PBYTE,
  99. ULONG,
  100. ULONG,
  101. ULONG
  102. );
  103. VOID
  104. vCvtToBoldItalicBmp(
  105. GLYPHBITS *,
  106. GLYPHDATA *,
  107. PBYTE,
  108. ULONG,
  109. ULONG,
  110. ULONG
  111. );
  112. VOID
  113. vComputeSimulatedGLYPHDATA(
  114. GLYPHDATA*,
  115. PBYTE,
  116. ULONG,
  117. ULONG,
  118. ULONG,
  119. ULONG,
  120. ULONG,
  121. FONTOBJ*
  122. );
  123. VOID
  124. vFindTAndB(
  125. PBYTE,
  126. ULONG,
  127. ULONG,
  128. ULONG*,
  129. ULONG*
  130. );
  131. BOOL
  132. bConvertFontRes
  133. (
  134. PVOID pvView,
  135. SIZE_T cjView,
  136. PRES_ELEM,
  137. FACEINFO*
  138. );
  139. VOID
  140. vCheckOffsetTable(
  141. PCVTFILEHDR,
  142. PRES_ELEM
  143. );
  144. BOOL
  145. bBMFDIFIMETRICS(
  146. PVOID pvView,
  147. SIZE_T cjView,
  148. PCVTFILEHDR pcvtfh OPTIONAL,
  149. PRES_ELEM pre,
  150. OUT PULONG pcjIFIOut OPTIONAL
  151. );
  152. VOID
  153. vDefFace(
  154. FACEINFO *pfai,
  155. RES_ELEM *pre
  156. );
  157. VOID
  158. vBmfdFill_IFIMETRICS(
  159. FACEINFO *pfai,
  160. PRES_ELEM pre
  161. );
  162. typedef VOID (* PFN_IFI)(PIFIMETRICS);
  163. //
  164. // This is a useful macro. It returns the offset from the address y
  165. // to the next higher address aligned to an object of type x
  166. //
  167. #define OFFSET_OF_NEXT(x,y) sizeof(x)*((y+sizeof(x)-1)/sizeof(x))
  168. //
  169. // ISIMULATE -- converts from FO_SIM_FOO to FC_SIM_FOO
  170. //
  171. #define ISIMULATE(x) \
  172. \
  173. (x) == 0 ? \
  174. FC_SIM_NONE : \
  175. ( \
  176. (x) == FO_SIM_BOLD ? \
  177. FC_SIM_BOLD : \
  178. ( \
  179. (x) == FO_SIM_ITALIC ? \
  180. FC_SIMULATE_ITALIC : \
  181. FC_SIMULATE_BOLDITALIC \
  182. ) \
  183. )
  184. // The missing range in SYMBOL character set (inclusive-inclusive)
  185. #define CHARSET_SYMBOL_GAP_MIN 127
  186. #define CHARSET_SYMBOL_GAP_MAX 160
  187. // save some typing here, rename what used to be functions into
  188. // these macros
  189. #define ulMakeULONG(pj) ((ULONG)READ_DWORD(pj))
  190. #define lMakeLONG(pj) ((LONG)READ_DWORD(pj))
  191. #define usMakeUSHORT(pj) ((USHORT)READ_WORD(pj))
  192. #define sMakeSHORT(pj) ((SHORT)READ_WORD(pj))
  193. //!!! the next one is specific to win31 us char set (1252 cp) and this
  194. //!!! has to be generalized to an arbitrary code page
  195. #define C_RUNS 15
  196. // these are the indicies into the array of strings below
  197. #define I_DONTCARE 0 // don't care or don't know
  198. #define I_ROMAN 1
  199. #define I_SWISS 2
  200. #define I_MODERN 3
  201. #define I_SCRIPT 4
  202. #define I_DECORATIVE 5
  203. // #define DUMPCALL
  204. #if defined(_X86_)
  205. typedef struct _FLOATINTERN
  206. {
  207. LONG lMant;
  208. LONG lExp;
  209. } FLOATINTERN;
  210. typedef FLOATINTERN EFLOAT;
  211. typedef EFLOAT *PEFLOAT;
  212. VOID ftoef_c(FLOATL, PEFLOAT);
  213. BOOL eftol_c(EFLOAT *, PLONG, LONG);
  214. #define vEToEF(e, pef) ftoef_c((e), (pef))
  215. #define bEFtoL(pe, pl ) eftol_c((pe), (pl), 1 )
  216. #define bIsZero(ef) ( ((ef).lMant == 0) && ((ef).lExp == 0) )
  217. #define bPositive(ef) ( (ef).lMant >= 0 )
  218. FIX fxLTimesEf(EFLOAT *pef, LONG l);
  219. #else // not X86
  220. typedef FLOAT EFLOAT;
  221. typedef EFLOAT *PEFLOAT;
  222. //
  223. // these could come from the real header files in math
  224. //
  225. #if defined(_AMD64_) || defined(_IA64_)
  226. #define bFToLRound(e, pl) (bFToL(e, pl, 4+2))
  227. extern BOOL bFToL(FLOAT e, PLONG pl, LONG lType);
  228. #else
  229. extern BOOL bFToLRound(FLOAT e, PLONG pl);
  230. #endif
  231. #define vEToEF(e, pef) ( *(pef) = (e) )
  232. #define bEFtoL( pe, pl ) ( bFToLRound(*(pe), (pl) ))
  233. #define bIsZero(ef) ( (ef) == 0 )
  234. #define bPositive(ef) ( (ef) >= 0 )
  235. #endif
  236. BOOL bLoadNtFon(
  237. HFF iFile,
  238. PVOID pvView,
  239. HFF *phff
  240. );
  241. VOID vBmfdMarkFontGone(FONTFILE *pff, DWORD iExceptionCode);