fterrdef.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283
  1. /****************************************************************************
  2. *
  3. * fterrdef.h
  4. *
  5. * FreeType error codes (specification).
  6. *
  7. * Copyright (C) 2002-2023 by
  8. * David Turner, Robert Wilhelm, and Werner Lemberg.
  9. *
  10. * This file is part of the FreeType project, and may only be used,
  11. * modified, and distributed under the terms of the FreeType project
  12. * license, LICENSE.TXT. By continuing to use, modify, or distribute
  13. * this file you indicate that you have read the license and
  14. * understand and accept it fully.
  15. *
  16. */
  17. /**************************************************************************
  18. *
  19. * @section:
  20. * error_code_values
  21. *
  22. * @title:
  23. * Error Code Values
  24. *
  25. * @abstract:
  26. * All possible error codes returned by FreeType functions.
  27. *
  28. * @description:
  29. * The list below is taken verbatim from the file `fterrdef.h` (loaded
  30. * automatically by including `FT_FREETYPE_H`). The first argument of the
  31. * `FT_ERROR_DEF_` macro is the error label; by default, the prefix
  32. * `FT_Err_` gets added so that you get error names like
  33. * `FT_Err_Cannot_Open_Resource`. The second argument is the error code,
  34. * and the last argument an error string, which is not used by FreeType.
  35. *
  36. * Within your application you should **only** use error names and
  37. * **never** its numeric values! The latter might (and actually do)
  38. * change in forthcoming FreeType versions.
  39. *
  40. * Macro `FT_NOERRORDEF_` defines `FT_Err_Ok`, which is always zero. See
  41. * the 'Error Enumerations' subsection how to automatically generate a
  42. * list of error strings.
  43. *
  44. */
  45. /**************************************************************************
  46. *
  47. * @enum:
  48. * FT_Err_XXX
  49. *
  50. */
  51. /* generic errors */
  52. FT_NOERRORDEF_( Ok, 0x00,
  53. "no error" )
  54. FT_ERRORDEF_( Cannot_Open_Resource, 0x01,
  55. "cannot open resource" )
  56. FT_ERRORDEF_( Unknown_File_Format, 0x02,
  57. "unknown file format" )
  58. FT_ERRORDEF_( Invalid_File_Format, 0x03,
  59. "broken file" )
  60. FT_ERRORDEF_( Invalid_Version, 0x04,
  61. "invalid FreeType version" )
  62. FT_ERRORDEF_( Lower_Module_Version, 0x05,
  63. "module version is too low" )
  64. FT_ERRORDEF_( Invalid_Argument, 0x06,
  65. "invalid argument" )
  66. FT_ERRORDEF_( Unimplemented_Feature, 0x07,
  67. "unimplemented feature" )
  68. FT_ERRORDEF_( Invalid_Table, 0x08,
  69. "broken table" )
  70. FT_ERRORDEF_( Invalid_Offset, 0x09,
  71. "broken offset within table" )
  72. FT_ERRORDEF_( Array_Too_Large, 0x0A,
  73. "array allocation size too large" )
  74. FT_ERRORDEF_( Missing_Module, 0x0B,
  75. "missing module" )
  76. FT_ERRORDEF_( Missing_Property, 0x0C,
  77. "missing property" )
  78. /* glyph/character errors */
  79. FT_ERRORDEF_( Invalid_Glyph_Index, 0x10,
  80. "invalid glyph index" )
  81. FT_ERRORDEF_( Invalid_Character_Code, 0x11,
  82. "invalid character code" )
  83. FT_ERRORDEF_( Invalid_Glyph_Format, 0x12,
  84. "unsupported glyph image format" )
  85. FT_ERRORDEF_( Cannot_Render_Glyph, 0x13,
  86. "cannot render this glyph format" )
  87. FT_ERRORDEF_( Invalid_Outline, 0x14,
  88. "invalid outline" )
  89. FT_ERRORDEF_( Invalid_Composite, 0x15,
  90. "invalid composite glyph" )
  91. FT_ERRORDEF_( Too_Many_Hints, 0x16,
  92. "too many hints" )
  93. FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
  94. "invalid pixel size" )
  95. FT_ERRORDEF_( Invalid_SVG_Document, 0x18,
  96. "invalid SVG document" )
  97. /* handle errors */
  98. FT_ERRORDEF_( Invalid_Handle, 0x20,
  99. "invalid object handle" )
  100. FT_ERRORDEF_( Invalid_Library_Handle, 0x21,
  101. "invalid library handle" )
  102. FT_ERRORDEF_( Invalid_Driver_Handle, 0x22,
  103. "invalid module handle" )
  104. FT_ERRORDEF_( Invalid_Face_Handle, 0x23,
  105. "invalid face handle" )
  106. FT_ERRORDEF_( Invalid_Size_Handle, 0x24,
  107. "invalid size handle" )
  108. FT_ERRORDEF_( Invalid_Slot_Handle, 0x25,
  109. "invalid glyph slot handle" )
  110. FT_ERRORDEF_( Invalid_CharMap_Handle, 0x26,
  111. "invalid charmap handle" )
  112. FT_ERRORDEF_( Invalid_Cache_Handle, 0x27,
  113. "invalid cache manager handle" )
  114. FT_ERRORDEF_( Invalid_Stream_Handle, 0x28,
  115. "invalid stream handle" )
  116. /* driver errors */
  117. FT_ERRORDEF_( Too_Many_Drivers, 0x30,
  118. "too many modules" )
  119. FT_ERRORDEF_( Too_Many_Extensions, 0x31,
  120. "too many extensions" )
  121. /* memory errors */
  122. FT_ERRORDEF_( Out_Of_Memory, 0x40,
  123. "out of memory" )
  124. FT_ERRORDEF_( Unlisted_Object, 0x41,
  125. "unlisted object" )
  126. /* stream errors */
  127. FT_ERRORDEF_( Cannot_Open_Stream, 0x51,
  128. "cannot open stream" )
  129. FT_ERRORDEF_( Invalid_Stream_Seek, 0x52,
  130. "invalid stream seek" )
  131. FT_ERRORDEF_( Invalid_Stream_Skip, 0x53,
  132. "invalid stream skip" )
  133. FT_ERRORDEF_( Invalid_Stream_Read, 0x54,
  134. "invalid stream read" )
  135. FT_ERRORDEF_( Invalid_Stream_Operation, 0x55,
  136. "invalid stream operation" )
  137. FT_ERRORDEF_( Invalid_Frame_Operation, 0x56,
  138. "invalid frame operation" )
  139. FT_ERRORDEF_( Nested_Frame_Access, 0x57,
  140. "nested frame access" )
  141. FT_ERRORDEF_( Invalid_Frame_Read, 0x58,
  142. "invalid frame read" )
  143. /* raster errors */
  144. FT_ERRORDEF_( Raster_Uninitialized, 0x60,
  145. "raster uninitialized" )
  146. FT_ERRORDEF_( Raster_Corrupted, 0x61,
  147. "raster corrupted" )
  148. FT_ERRORDEF_( Raster_Overflow, 0x62,
  149. "raster overflow" )
  150. FT_ERRORDEF_( Raster_Negative_Height, 0x63,
  151. "negative height while rastering" )
  152. /* cache errors */
  153. FT_ERRORDEF_( Too_Many_Caches, 0x70,
  154. "too many registered caches" )
  155. /* TrueType and SFNT errors */
  156. FT_ERRORDEF_( Invalid_Opcode, 0x80,
  157. "invalid opcode" )
  158. FT_ERRORDEF_( Too_Few_Arguments, 0x81,
  159. "too few arguments" )
  160. FT_ERRORDEF_( Stack_Overflow, 0x82,
  161. "stack overflow" )
  162. FT_ERRORDEF_( Code_Overflow, 0x83,
  163. "code overflow" )
  164. FT_ERRORDEF_( Bad_Argument, 0x84,
  165. "bad argument" )
  166. FT_ERRORDEF_( Divide_By_Zero, 0x85,
  167. "division by zero" )
  168. FT_ERRORDEF_( Invalid_Reference, 0x86,
  169. "invalid reference" )
  170. FT_ERRORDEF_( Debug_OpCode, 0x87,
  171. "found debug opcode" )
  172. FT_ERRORDEF_( ENDF_In_Exec_Stream, 0x88,
  173. "found ENDF opcode in execution stream" )
  174. FT_ERRORDEF_( Nested_DEFS, 0x89,
  175. "nested DEFS" )
  176. FT_ERRORDEF_( Invalid_CodeRange, 0x8A,
  177. "invalid code range" )
  178. FT_ERRORDEF_( Execution_Too_Long, 0x8B,
  179. "execution context too long" )
  180. FT_ERRORDEF_( Too_Many_Function_Defs, 0x8C,
  181. "too many function definitions" )
  182. FT_ERRORDEF_( Too_Many_Instruction_Defs, 0x8D,
  183. "too many instruction definitions" )
  184. FT_ERRORDEF_( Table_Missing, 0x8E,
  185. "SFNT font table missing" )
  186. FT_ERRORDEF_( Horiz_Header_Missing, 0x8F,
  187. "horizontal header (hhea) table missing" )
  188. FT_ERRORDEF_( Locations_Missing, 0x90,
  189. "locations (loca) table missing" )
  190. FT_ERRORDEF_( Name_Table_Missing, 0x91,
  191. "name table missing" )
  192. FT_ERRORDEF_( CMap_Table_Missing, 0x92,
  193. "character map (cmap) table missing" )
  194. FT_ERRORDEF_( Hmtx_Table_Missing, 0x93,
  195. "horizontal metrics (hmtx) table missing" )
  196. FT_ERRORDEF_( Post_Table_Missing, 0x94,
  197. "PostScript (post) table missing" )
  198. FT_ERRORDEF_( Invalid_Horiz_Metrics, 0x95,
  199. "invalid horizontal metrics" )
  200. FT_ERRORDEF_( Invalid_CharMap_Format, 0x96,
  201. "invalid character map (cmap) format" )
  202. FT_ERRORDEF_( Invalid_PPem, 0x97,
  203. "invalid ppem value" )
  204. FT_ERRORDEF_( Invalid_Vert_Metrics, 0x98,
  205. "invalid vertical metrics" )
  206. FT_ERRORDEF_( Could_Not_Find_Context, 0x99,
  207. "could not find context" )
  208. FT_ERRORDEF_( Invalid_Post_Table_Format, 0x9A,
  209. "invalid PostScript (post) table format" )
  210. FT_ERRORDEF_( Invalid_Post_Table, 0x9B,
  211. "invalid PostScript (post) table" )
  212. FT_ERRORDEF_( DEF_In_Glyf_Bytecode, 0x9C,
  213. "found FDEF or IDEF opcode in glyf bytecode" )
  214. FT_ERRORDEF_( Missing_Bitmap, 0x9D,
  215. "missing bitmap in strike" )
  216. FT_ERRORDEF_( Missing_SVG_Hooks, 0x9E,
  217. "SVG hooks have not been set" )
  218. /* CFF, CID, and Type 1 errors */
  219. FT_ERRORDEF_( Syntax_Error, 0xA0,
  220. "opcode syntax error" )
  221. FT_ERRORDEF_( Stack_Underflow, 0xA1,
  222. "argument stack underflow" )
  223. FT_ERRORDEF_( Ignore, 0xA2,
  224. "ignore" )
  225. FT_ERRORDEF_( No_Unicode_Glyph_Name, 0xA3,
  226. "no Unicode glyph name found" )
  227. FT_ERRORDEF_( Glyph_Too_Big, 0xA4,
  228. "glyph too big for hinting" )
  229. /* BDF errors */
  230. FT_ERRORDEF_( Missing_Startfont_Field, 0xB0,
  231. "`STARTFONT' field missing" )
  232. FT_ERRORDEF_( Missing_Font_Field, 0xB1,
  233. "`FONT' field missing" )
  234. FT_ERRORDEF_( Missing_Size_Field, 0xB2,
  235. "`SIZE' field missing" )
  236. FT_ERRORDEF_( Missing_Fontboundingbox_Field, 0xB3,
  237. "`FONTBOUNDINGBOX' field missing" )
  238. FT_ERRORDEF_( Missing_Chars_Field, 0xB4,
  239. "`CHARS' field missing" )
  240. FT_ERRORDEF_( Missing_Startchar_Field, 0xB5,
  241. "`STARTCHAR' field missing" )
  242. FT_ERRORDEF_( Missing_Encoding_Field, 0xB6,
  243. "`ENCODING' field missing" )
  244. FT_ERRORDEF_( Missing_Bbx_Field, 0xB7,
  245. "`BBX' field missing" )
  246. FT_ERRORDEF_( Bbx_Too_Big, 0xB8,
  247. "`BBX' too big" )
  248. FT_ERRORDEF_( Corrupted_Font_Header, 0xB9,
  249. "Font header corrupted or missing fields" )
  250. FT_ERRORDEF_( Corrupted_Font_Glyphs, 0xBA,
  251. "Font glyphs corrupted or missing fields" )
  252. /* */
  253. /* END */