🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
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.

1305 lines
30 KiB

  1. <!doctype html>
  2. <html lang="en" class="no-js">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width,initial-scale=1">
  6. <meta name="description" content="API Reference Documentation for FreeType-2.11.0">
  7. <meta name="author" content="FreeType Contributors">
  8. <link rel="icon" href="images/favico.ico">
  9. <meta name="generator" content="mkdocs-1.2.1, mkdocs-material-7.1.9">
  10. <title>Error Enumerations - FreeType-2.11.0 API Reference</title>
  11. <link rel="stylesheet" href="assets/stylesheets/main.ca7ac06f.min.css">
  12. <link rel="stylesheet" href="assets/stylesheets/palette.f1a3b89f.min.css">
  13. <meta name="theme-color" content="#4cae4f">
  14. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  15. <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif:300,400,400i,700%7CRoboto+Mono&display=fallback">
  16. <style>:root{--md-text-font-family:"Noto Serif";--md-code-font-family:"Roboto Mono"}</style>
  17. <link rel="stylesheet" href="stylesheets/extra.css">
  18. </head>
  19. <body dir="ltr" data-md-color-scheme="" data-md-color-primary="green" data-md-color-accent="green">
  20. <script>function __prefix(e){return new URL(".",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script>
  21. <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
  22. <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
  23. <label class="md-overlay" for="__drawer"></label>
  24. <div data-md-component="skip">
  25. <a href="#error-enumerations" class="md-skip">
  26. Skip to content
  27. </a>
  28. </div>
  29. <div data-md-component="announce">
  30. </div>
  31. <header class="md-header" data-md-component="header">
  32. <nav class="md-header__inner md-grid" aria-label="Header">
  33. <a href="index.html" title="FreeType-2.11.0 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.11.0 API Reference" data-md-component="logo">
  34. <img src="images/favico.ico" alt="logo">
  35. </a>
  36. <label class="md-header__button md-icon" for="__drawer">
  37. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
  38. </label>
  39. <div class="md-header__title" data-md-component="header-title">
  40. <div class="md-header__ellipsis">
  41. <div class="md-header__topic">
  42. <span class="md-ellipsis">
  43. FreeType-2.11.0 API Reference
  44. </span>
  45. </div>
  46. <div class="md-header__topic" data-md-component="header-topic">
  47. <span class="md-ellipsis">
  48. Error Enumerations
  49. </span>
  50. </div>
  51. </div>
  52. </div>
  53. <label class="md-header__button md-icon" for="__search">
  54. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
  55. </label>
  56. <div class="md-search" data-md-component="search" role="dialog">
  57. <label class="md-search__overlay" for="__search"></label>
  58. <div class="md-search__inner" role="search">
  59. <form class="md-search__form" name="search">
  60. <input type="text" class="md-search__input" name="query" aria-label="Search" placeholder="Search" autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false" data-md-component="search-query" data-md-state="active" required>
  61. <label class="md-search__icon md-icon" for="__search">
  62. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M9.5 3A6.5 6.5 0 0 1 16 9.5c0 1.61-.59 3.09-1.56 4.23l.27.27h.79l5 5-1.5 1.5-5-5v-.79l-.27-.27A6.516 6.516 0 0 1 9.5 16 6.5 6.5 0 0 1 3 9.5 6.5 6.5 0 0 1 9.5 3m0 2C7 5 5 7 5 9.5S7 14 9.5 14 14 12 14 9.5 12 5 9.5 5z"/></svg>
  63. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
  64. </label>
  65. <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
  66. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z"/></svg>
  67. </button>
  68. </form>
  69. <div class="md-search__output">
  70. <div class="md-search__scrollwrap" data-md-scrollfix>
  71. <div class="md-search-result" data-md-component="search-result">
  72. <div class="md-search-result__meta">
  73. Initializing search
  74. </div>
  75. <ol class="md-search-result__list"></ol>
  76. </div>
  77. </div>
  78. </div>
  79. </div>
  80. </div>
  81. </nav>
  82. </header>
  83. <div class="md-container" data-md-component="container">
  84. <main class="md-main" data-md-component="main">
  85. <div class="md-main__inner md-grid">
  86. <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
  87. <div class="md-sidebar__scrollwrap">
  88. <div class="md-sidebar__inner">
  89. <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
  90. <label class="md-nav__title" for="__drawer">
  91. <a href="index.html" title="FreeType-2.11.0 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.11.0 API Reference" data-md-component="logo">
  92. <img src="images/favico.ico" alt="logo">
  93. </a>
  94. FreeType-2.11.0 API Reference
  95. </label>
  96. <ul class="md-nav__list" data-md-scrollfix>
  97. <li class="md-nav__item">
  98. <a href="index.html" class="md-nav__link">
  99. TOC
  100. </a>
  101. </li>
  102. <li class="md-nav__item">
  103. <a href="ft2-index.html" class="md-nav__link">
  104. Index
  105. </a>
  106. </li>
  107. <li class="md-nav__item md-nav__item--nested">
  108. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
  109. <label class="md-nav__link" for="__nav_3">
  110. General Remarks
  111. <span class="md-nav__icon md-icon"></span>
  112. </label>
  113. <nav class="md-nav" aria-label="General Remarks" data-md-level="1">
  114. <label class="md-nav__title" for="__nav_3">
  115. <span class="md-nav__icon md-icon"></span>
  116. General Remarks
  117. </label>
  118. <ul class="md-nav__list" data-md-scrollfix>
  119. <li class="md-nav__item">
  120. <a href="ft2-preamble.html" class="md-nav__link">
  121. Preamble
  122. </a>
  123. </li>
  124. <li class="md-nav__item">
  125. <a href="ft2-header_inclusion.html" class="md-nav__link">
  126. FreeType's header inclusion scheme
  127. </a>
  128. </li>
  129. <li class="md-nav__item">
  130. <a href="ft2-user_allocation.html" class="md-nav__link">
  131. User allocation
  132. </a>
  133. </li>
  134. </ul>
  135. </nav>
  136. </li>
  137. <li class="md-nav__item md-nav__item--nested">
  138. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" >
  139. <label class="md-nav__link" for="__nav_4">
  140. Core API
  141. <span class="md-nav__icon md-icon"></span>
  142. </label>
  143. <nav class="md-nav" aria-label="Core API" data-md-level="1">
  144. <label class="md-nav__title" for="__nav_4">
  145. <span class="md-nav__icon md-icon"></span>
  146. Core API
  147. </label>
  148. <ul class="md-nav__list" data-md-scrollfix>
  149. <li class="md-nav__item">
  150. <a href="ft2-version.html" class="md-nav__link">
  151. FreeType Version
  152. </a>
  153. </li>
  154. <li class="md-nav__item">
  155. <a href="ft2-basic_types.html" class="md-nav__link">
  156. Basic Data Types
  157. </a>
  158. </li>
  159. <li class="md-nav__item">
  160. <a href="ft2-base_interface.html" class="md-nav__link">
  161. Base Interface
  162. </a>
  163. </li>
  164. <li class="md-nav__item">
  165. <a href="ft2-glyph_variants.html" class="md-nav__link">
  166. Unicode Variation Sequences
  167. </a>
  168. </li>
  169. <li class="md-nav__item">
  170. <a href="ft2-color_management.html" class="md-nav__link">
  171. Glyph Color Management
  172. </a>
  173. </li>
  174. <li class="md-nav__item">
  175. <a href="ft2-layer_management.html" class="md-nav__link">
  176. Glyph Layer Management
  177. </a>
  178. </li>
  179. <li class="md-nav__item">
  180. <a href="ft2-glyph_management.html" class="md-nav__link">
  181. Glyph Management
  182. </a>
  183. </li>
  184. <li class="md-nav__item">
  185. <a href="ft2-mac_specific.html" class="md-nav__link">
  186. Mac Specific Interface
  187. </a>
  188. </li>
  189. <li class="md-nav__item">
  190. <a href="ft2-sizes_management.html" class="md-nav__link">
  191. Size Management
  192. </a>
  193. </li>
  194. <li class="md-nav__item">
  195. <a href="ft2-header_file_macros.html" class="md-nav__link">
  196. Header File Macros
  197. </a>
  198. </li>
  199. </ul>
  200. </nav>
  201. </li>
  202. <li class="md-nav__item md-nav__item--nested">
  203. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
  204. <label class="md-nav__link" for="__nav_5">
  205. Format-Specific API
  206. <span class="md-nav__icon md-icon"></span>
  207. </label>
  208. <nav class="md-nav" aria-label="Format-Specific API" data-md-level="1">
  209. <label class="md-nav__title" for="__nav_5">
  210. <span class="md-nav__icon md-icon"></span>
  211. Format-Specific API
  212. </label>
  213. <ul class="md-nav__list" data-md-scrollfix>
  214. <li class="md-nav__item">
  215. <a href="ft2-multiple_masters.html" class="md-nav__link">
  216. Multiple Masters
  217. </a>
  218. </li>
  219. <li class="md-nav__item">
  220. <a href="ft2-truetype_tables.html" class="md-nav__link">
  221. TrueType Tables
  222. </a>
  223. </li>
  224. <li class="md-nav__item">
  225. <a href="ft2-type1_tables.html" class="md-nav__link">
  226. Type 1 Tables
  227. </a>
  228. </li>
  229. <li class="md-nav__item">
  230. <a href="ft2-sfnt_names.html" class="md-nav__link">
  231. SFNT Names
  232. </a>
  233. </li>
  234. <li class="md-nav__item">
  235. <a href="ft2-bdf_fonts.html" class="md-nav__link">
  236. BDF and PCF Files
  237. </a>
  238. </li>
  239. <li class="md-nav__item">
  240. <a href="ft2-cid_fonts.html" class="md-nav__link">
  241. CID Fonts
  242. </a>
  243. </li>
  244. <li class="md-nav__item">
  245. <a href="ft2-pfr_fonts.html" class="md-nav__link">
  246. PFR Fonts
  247. </a>
  248. </li>
  249. <li class="md-nav__item">
  250. <a href="ft2-winfnt_fonts.html" class="md-nav__link">
  251. Window FNT Files
  252. </a>
  253. </li>
  254. <li class="md-nav__item">
  255. <a href="ft2-font_formats.html" class="md-nav__link">
  256. Font Formats
  257. </a>
  258. </li>
  259. <li class="md-nav__item">
  260. <a href="ft2-gasp_table.html" class="md-nav__link">
  261. Gasp Table
  262. </a>
  263. </li>
  264. </ul>
  265. </nav>
  266. </li>
  267. <li class="md-nav__item md-nav__item--nested">
  268. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
  269. <label class="md-nav__link" for="__nav_6">
  270. Controlling FreeType Modules
  271. <span class="md-nav__icon md-icon"></span>
  272. </label>
  273. <nav class="md-nav" aria-label="Controlling FreeType Modules" data-md-level="1">
  274. <label class="md-nav__title" for="__nav_6">
  275. <span class="md-nav__icon md-icon"></span>
  276. Controlling FreeType Modules
  277. </label>
  278. <ul class="md-nav__list" data-md-scrollfix>
  279. <li class="md-nav__item">
  280. <a href="ft2-auto_hinter.html" class="md-nav__link">
  281. The auto-hinter
  282. </a>
  283. </li>
  284. <li class="md-nav__item">
  285. <a href="ft2-cff_driver.html" class="md-nav__link">
  286. The CFF driver
  287. </a>
  288. </li>
  289. <li class="md-nav__item">
  290. <a href="ft2-t1_cid_driver.html" class="md-nav__link">
  291. The Type 1 and CID drivers
  292. </a>
  293. </li>
  294. <li class="md-nav__item">
  295. <a href="ft2-tt_driver.html" class="md-nav__link">
  296. The TrueType driver
  297. </a>
  298. </li>
  299. <li class="md-nav__item">
  300. <a href="ft2-pcf_driver.html" class="md-nav__link">
  301. The PCF driver
  302. </a>
  303. </li>
  304. <li class="md-nav__item">
  305. <a href="ft2-properties.html" class="md-nav__link">
  306. Driver properties
  307. </a>
  308. </li>
  309. <li class="md-nav__item">
  310. <a href="ft2-parameter_tags.html" class="md-nav__link">
  311. Parameter Tags
  312. </a>
  313. </li>
  314. <li class="md-nav__item">
  315. <a href="ft2-lcd_rendering.html" class="md-nav__link">
  316. Subpixel Rendering
  317. </a>
  318. </li>
  319. </ul>
  320. </nav>
  321. </li>
  322. <li class="md-nav__item md-nav__item--nested">
  323. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
  324. <label class="md-nav__link" for="__nav_7">
  325. Cache Sub-System
  326. <span class="md-nav__icon md-icon"></span>
  327. </label>
  328. <nav class="md-nav" aria-label="Cache Sub-System" data-md-level="1">
  329. <label class="md-nav__title" for="__nav_7">
  330. <span class="md-nav__icon md-icon"></span>
  331. Cache Sub-System
  332. </label>
  333. <ul class="md-nav__list" data-md-scrollfix>
  334. <li class="md-nav__item">
  335. <a href="ft2-cache_subsystem.html" class="md-nav__link">
  336. Cache Sub-System
  337. </a>
  338. </li>
  339. </ul>
  340. </nav>
  341. </li>
  342. <li class="md-nav__item md-nav__item--nested">
  343. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8" type="checkbox" id="__nav_8" >
  344. <label class="md-nav__link" for="__nav_8">
  345. Support API
  346. <span class="md-nav__icon md-icon"></span>
  347. </label>
  348. <nav class="md-nav" aria-label="Support API" data-md-level="1">
  349. <label class="md-nav__title" for="__nav_8">
  350. <span class="md-nav__icon md-icon"></span>
  351. Support API
  352. </label>
  353. <ul class="md-nav__list" data-md-scrollfix>
  354. <li class="md-nav__item">
  355. <a href="ft2-computations.html" class="md-nav__link">
  356. Computations
  357. </a>
  358. </li>
  359. <li class="md-nav__item">
  360. <a href="ft2-list_processing.html" class="md-nav__link">
  361. List Processing
  362. </a>
  363. </li>
  364. <li class="md-nav__item">
  365. <a href="ft2-outline_processing.html" class="md-nav__link">
  366. Outline Processing
  367. </a>
  368. </li>
  369. <li class="md-nav__item">
  370. <a href="ft2-quick_advance.html" class="md-nav__link">
  371. Quick retrieval of advance values
  372. </a>
  373. </li>
  374. <li class="md-nav__item">
  375. <a href="ft2-bitmap_handling.html" class="md-nav__link">
  376. Bitmap Handling
  377. </a>
  378. </li>
  379. <li class="md-nav__item">
  380. <a href="ft2-raster.html" class="md-nav__link">
  381. Scanline Converter
  382. </a>
  383. </li>
  384. <li class="md-nav__item">
  385. <a href="ft2-glyph_stroker.html" class="md-nav__link">
  386. Glyph Stroker
  387. </a>
  388. </li>
  389. <li class="md-nav__item">
  390. <a href="ft2-system_interface.html" class="md-nav__link">
  391. System Interface
  392. </a>
  393. </li>
  394. <li class="md-nav__item">
  395. <a href="ft2-module_management.html" class="md-nav__link">
  396. Module Management
  397. </a>
  398. </li>
  399. <li class="md-nav__item">
  400. <a href="ft2-gzip.html" class="md-nav__link">
  401. GZIP Streams
  402. </a>
  403. </li>
  404. <li class="md-nav__item">
  405. <a href="ft2-lzw.html" class="md-nav__link">
  406. LZW Streams
  407. </a>
  408. </li>
  409. <li class="md-nav__item">
  410. <a href="ft2-bzip2.html" class="md-nav__link">
  411. BZIP2 Streams
  412. </a>
  413. </li>
  414. <li class="md-nav__item">
  415. <a href="ft2-debugging_apis.html" class="md-nav__link">
  416. External Debugging APIs
  417. </a>
  418. </li>
  419. </ul>
  420. </nav>
  421. </li>
  422. <li class="md-nav__item md-nav__item--active md-nav__item--nested">
  423. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_9" type="checkbox" id="__nav_9" checked>
  424. <label class="md-nav__link" for="__nav_9">
  425. Error Codes
  426. <span class="md-nav__icon md-icon"></span>
  427. </label>
  428. <nav class="md-nav" aria-label="Error Codes" data-md-level="1">
  429. <label class="md-nav__title" for="__nav_9">
  430. <span class="md-nav__icon md-icon"></span>
  431. Error Codes
  432. </label>
  433. <ul class="md-nav__list" data-md-scrollfix>
  434. <li class="md-nav__item md-nav__item--active">
  435. <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
  436. <label class="md-nav__link md-nav__link--active" for="__toc">
  437. Error Enumerations
  438. <span class="md-nav__icon md-icon"></span>
  439. </label>
  440. <a href="ft2-error_enumerations.html" class="md-nav__link md-nav__link--active">
  441. Error Enumerations
  442. </a>
  443. <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  444. <label class="md-nav__title" for="__toc">
  445. <span class="md-nav__icon md-icon"></span>
  446. Table of contents
  447. </label>
  448. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
  449. <li class="md-nav__item">
  450. <a href="#synopsis" class="md-nav__link">
  451. Synopsis
  452. </a>
  453. </li>
  454. <li class="md-nav__item">
  455. <a href="#ft_error_string" class="md-nav__link">
  456. FT_Error_String
  457. </a>
  458. </li>
  459. </ul>
  460. </nav>
  461. </li>
  462. <li class="md-nav__item">
  463. <a href="ft2-error_code_values.html" class="md-nav__link">
  464. Error Code Values
  465. </a>
  466. </li>
  467. </ul>
  468. </nav>
  469. </li>
  470. <li class="md-nav__item md-nav__item--nested">
  471. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_10" type="checkbox" id="__nav_10" >
  472. <label class="md-nav__link" for="__nav_10">
  473. Miscellaneous
  474. <span class="md-nav__icon md-icon"></span>
  475. </label>
  476. <nav class="md-nav" aria-label="Miscellaneous" data-md-level="1">
  477. <label class="md-nav__title" for="__nav_10">
  478. <span class="md-nav__icon md-icon"></span>
  479. Miscellaneous
  480. </label>
  481. <ul class="md-nav__list" data-md-scrollfix>
  482. <li class="md-nav__item">
  483. <a href="ft2-gx_validation.html" class="md-nav__link">
  484. TrueTypeGX/AAT Validation
  485. </a>
  486. </li>
  487. <li class="md-nav__item">
  488. <a href="ft2-incremental.html" class="md-nav__link">
  489. Incremental Loading
  490. </a>
  491. </li>
  492. <li class="md-nav__item">
  493. <a href="ft2-truetype_engine.html" class="md-nav__link">
  494. The TrueType Engine
  495. </a>
  496. </li>
  497. <li class="md-nav__item">
  498. <a href="ft2-ot_validation.html" class="md-nav__link">
  499. OpenType Validation
  500. </a>
  501. </li>
  502. </ul>
  503. </nav>
  504. </li>
  505. </ul>
  506. </nav>
  507. </div>
  508. </div>
  509. </div>
  510. <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
  511. <div class="md-sidebar__scrollwrap">
  512. <div class="md-sidebar__inner">
  513. <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  514. <label class="md-nav__title" for="__toc">
  515. <span class="md-nav__icon md-icon"></span>
  516. Table of contents
  517. </label>
  518. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
  519. <li class="md-nav__item">
  520. <a href="#synopsis" class="md-nav__link">
  521. Synopsis
  522. </a>
  523. </li>
  524. <li class="md-nav__item">
  525. <a href="#ft_error_string" class="md-nav__link">
  526. FT_Error_String
  527. </a>
  528. </li>
  529. </ul>
  530. </nav>
  531. </div>
  532. </div>
  533. </div>
  534. <div class="md-content" data-md-component="content">
  535. <article class="md-content__inner md-typeset">
  536. <p><a href="https://www.freetype.org">FreeType</a> &raquo; <a href="../">Docs</a> &raquo; <a href="index.html#error-codes">Error Codes</a> &raquo; Error Enumerations</p>
  537. <hr />
  538. <h1 id="error-enumerations">Error Enumerations<a class="headerlink" href="#error-enumerations" title="Permanent link">&para;</a></h1>
  539. <h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">&para;</a></h2>
  540. <p>The header file <code>fterrors.h</code> (which is automatically included by <code>freetype.h</code> defines the handling of FreeType's enumeration constants. It can also be used to generate error message strings with a small macro trick explained below.</p>
  541. <p><strong>Error Formats</strong></p>
  542. <p>The configuration macro <code>FT_CONFIG_OPTION_USE_MODULE_ERRORS</code> can be defined in <code>ftoption.h</code> in order to make the higher byte indicate the module where the error has happened (this is not compatible with standard builds of FreeType&nbsp;2, however). See the file <code>ftmoderr.h</code> for more details.</p>
  543. <p><strong>Error Message Strings</strong></p>
  544. <p>Error definitions are set up with special macros that allow client applications to build a table of error message strings. The strings are not included in a normal build of FreeType&nbsp;2 to save space (most client applications do not use them).</p>
  545. <p>To do so, you have to define the following macros before including this file.
  546. <div class="highlight"><pre><span></span><code> FT_ERROR_START_LIST
  547. </code></pre></div></p>
  548. <p>This macro is called before anything else to define the start of the error list. It is followed by several <code>FT_ERROR_DEF</code> calls.
  549. <div class="highlight"><pre><span></span><code> FT_ERROR_DEF( e, v, s )
  550. </code></pre></div></p>
  551. <p>This macro is called to define one single error. &lsquo;e&rsquo; is the error code identifier (e.g., <code>Invalid_Argument</code>), &lsquo;v&rsquo; is the error's numerical value, and &lsquo;s&rsquo; is the corresponding error string.
  552. <div class="highlight"><pre><span></span><code> FT_ERROR_END_LIST
  553. </code></pre></div></p>
  554. <p>This macro ends the list.</p>
  555. <p>Additionally, you have to undefine <code>FTERRORS_H_</code> before #including this file.</p>
  556. <p>Here is a simple example.
  557. <div class="highlight"><pre><span></span><code> #undef FTERRORS_H_
  558. #define FT_ERRORDEF( e, v, s ) { e, s },
  559. #define FT_ERROR_START_LIST {
  560. #define FT_ERROR_END_LIST { 0, NULL } };
  561. const struct
  562. {
  563. int err_code;
  564. const char* err_msg;
  565. } ft_errors[] =
  566. #include &lt;freetype/fterrors.h&gt;
  567. </code></pre></div></p>
  568. <p>An alternative to using an array is a switch statement.
  569. <div class="highlight"><pre><span></span><code> #undef FTERRORS_H_
  570. #define FT_ERROR_START_LIST switch ( error_code ) {
  571. #define FT_ERRORDEF( e, v, s ) case v: return s;
  572. #define FT_ERROR_END_LIST }
  573. </code></pre></div></p>
  574. <p>If you use <code>FT_CONFIG_OPTION_USE_MODULE_ERRORS</code>, <code>error_code</code> should be replaced with <code>FT_ERROR_BASE(error_code)</code> in the last example.</p>
  575. <h2 id="ft_error_string">FT_Error_String<a class="headerlink" href="#ft_error_string" title="Permanent link">&para;</a></h2>
  576. <p>Defined in FT_ERRORS_H (freetype/fterrors.h).</p>
  577. <div class = "codehilite"><pre><code> FT_EXPORT( <span class="keyword">const</span> <span class="keyword">char</span>* )
  578. <b>FT_Error_String</b>( <a href="ft2-basic_types.html#ft_error">FT_Error</a> error_code );
  579. </code></pre></div>
  580. <p>Retrieve the description of a valid FreeType error code.</p>
  581. <h4>input</h4>
  582. <table class="fields">
  583. <tr><td class="val" id="error_code">error_code</td><td class="desc">
  584. <p>A valid FreeType error code.</p>
  585. </td></tr>
  586. </table>
  587. <h4>return</h4>
  588. <p>A C&nbsp;string or <code>NULL</code>, if any error occurred.</p>
  589. <h4>note</h4>
  590. <p>FreeType has to be compiled with <code>FT_CONFIG_OPTION_ERROR_STRINGS</code> or <code>FT_DEBUG_LEVEL_ERROR</code> to get meaningful descriptions. &lsquo;error_string&rsquo; will be <code>NULL</code> otherwise.</p>
  591. <p>Module identification will be ignored:
  592. <div class="highlight"><pre><span></span><code> <span class="n">strcmp</span><span class="p">(</span> <span class="n">FT_Error_String</span><span class="p">(</span> <span class="n">FT_Err_Unknown_File_Format</span> <span class="p">),</span>
  593. <span class="n">FT_Error_String</span><span class="p">(</span> <span class="n">BDF_Err_Unknown_File_Format</span> <span class="p">)</span> <span class="p">)</span> <span class="o">==</span> <span class="mi">0</span><span class="p">;</span>
  594. </code></pre></div></p>
  595. <hr>
  596. </article>
  597. </div>
  598. </div>
  599. </main>
  600. <footer class="md-footer">
  601. <nav class="md-footer__inner md-grid" aria-label="Footer">
  602. <a href="ft2-debugging_apis.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: External Debugging APIs" rel="prev">
  603. <div class="md-footer__button md-icon">
  604. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M20 11v2H8l5.5 5.5-1.42 1.42L4.16 12l7.92-7.92L13.5 5.5 8 11h12z"/></svg>
  605. </div>
  606. <div class="md-footer__title">
  607. <div class="md-ellipsis">
  608. <span class="md-footer__direction">
  609. Previous
  610. </span>
  611. External Debugging APIs
  612. </div>
  613. </div>
  614. </a>
  615. <a href="ft2-error_code_values.html" class="md-footer__link md-footer__link--next" aria-label="Next: Error Code Values" rel="next">
  616. <div class="md-footer__title">
  617. <div class="md-ellipsis">
  618. <span class="md-footer__direction">
  619. Next
  620. </span>
  621. Error Code Values
  622. </div>
  623. </div>
  624. <div class="md-footer__button md-icon">
  625. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M4 11v2h12l-5.5 5.5 1.42 1.42L19.84 12l-7.92-7.92L10.5 5.5 16 11H4z"/></svg>
  626. </div>
  627. </a>
  628. </nav>
  629. <div class="md-footer-meta md-typeset">
  630. <div class="md-footer-meta__inner md-grid">
  631. <div class="md-footer-copyright">
  632. <div class="md-footer-copyright__highlight">
  633. Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
  634. </div>
  635. Made with
  636. <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
  637. Material for MkDocs
  638. </a>
  639. </div>
  640. </div>
  641. </div>
  642. </footer>
  643. </div>
  644. <div class="md-dialog" data-md-component="dialog">
  645. <div class="md-dialog__inner md-typeset"></div>
  646. </div>
  647. <script id="__config" type="application/json">{"base": ".", "features": [], "translations": {"clipboard.copy": "Copy to clipboard", "clipboard.copied": "Copied to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.placeholder": "Type to start searching", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "search": "assets/javascripts/workers/search.477d984a.min.js", "version": null}</script>
  648. <script src="assets/javascripts/bundle.82b56eb2.min.js"></script>
  649. <script src="javascripts/extra.js"></script>
  650. </body>
  651. </html>