🛠️🐜 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.

1878 lines
52 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>Glyph Management - 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="#glyph-management" 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. Glyph Management
  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--active md-nav__item--nested">
  138. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" checked>
  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 md-nav__item--active">
  180. <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
  181. <label class="md-nav__link md-nav__link--active" for="__toc">
  182. Glyph Management
  183. <span class="md-nav__icon md-icon"></span>
  184. </label>
  185. <a href="ft2-glyph_management.html" class="md-nav__link md-nav__link--active">
  186. Glyph Management
  187. </a>
  188. <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  189. <label class="md-nav__title" for="__toc">
  190. <span class="md-nav__icon md-icon"></span>
  191. Table of contents
  192. </label>
  193. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
  194. <li class="md-nav__item">
  195. <a href="#synopsis" class="md-nav__link">
  196. Synopsis
  197. </a>
  198. </li>
  199. <li class="md-nav__item">
  200. <a href="#ft_glyph" class="md-nav__link">
  201. FT_Glyph
  202. </a>
  203. </li>
  204. <li class="md-nav__item">
  205. <a href="#ft_glyphrec" class="md-nav__link">
  206. FT_GlyphRec
  207. </a>
  208. </li>
  209. <li class="md-nav__item">
  210. <a href="#ft_bitmapglyph" class="md-nav__link">
  211. FT_BitmapGlyph
  212. </a>
  213. </li>
  214. <li class="md-nav__item">
  215. <a href="#ft_bitmapglyphrec" class="md-nav__link">
  216. FT_BitmapGlyphRec
  217. </a>
  218. </li>
  219. <li class="md-nav__item">
  220. <a href="#ft_outlineglyph" class="md-nav__link">
  221. FT_OutlineGlyph
  222. </a>
  223. </li>
  224. <li class="md-nav__item">
  225. <a href="#ft_outlineglyphrec" class="md-nav__link">
  226. FT_OutlineGlyphRec
  227. </a>
  228. </li>
  229. <li class="md-nav__item">
  230. <a href="#ft_new_glyph" class="md-nav__link">
  231. FT_New_Glyph
  232. </a>
  233. </li>
  234. <li class="md-nav__item">
  235. <a href="#ft_get_glyph" class="md-nav__link">
  236. FT_Get_Glyph
  237. </a>
  238. </li>
  239. <li class="md-nav__item">
  240. <a href="#ft_glyph_copy" class="md-nav__link">
  241. FT_Glyph_Copy
  242. </a>
  243. </li>
  244. <li class="md-nav__item">
  245. <a href="#ft_glyph_transform" class="md-nav__link">
  246. FT_Glyph_Transform
  247. </a>
  248. </li>
  249. <li class="md-nav__item">
  250. <a href="#ft_glyph_bbox_mode" class="md-nav__link">
  251. FT_Glyph_BBox_Mode
  252. </a>
  253. </li>
  254. <li class="md-nav__item">
  255. <a href="#ft_glyph_get_cbox" class="md-nav__link">
  256. FT_Glyph_Get_CBox
  257. </a>
  258. </li>
  259. <li class="md-nav__item">
  260. <a href="#ft_glyph_to_bitmap" class="md-nav__link">
  261. FT_Glyph_To_Bitmap
  262. </a>
  263. </li>
  264. <li class="md-nav__item">
  265. <a href="#ft_done_glyph" class="md-nav__link">
  266. FT_Done_Glyph
  267. </a>
  268. </li>
  269. </ul>
  270. </nav>
  271. </li>
  272. <li class="md-nav__item">
  273. <a href="ft2-mac_specific.html" class="md-nav__link">
  274. Mac Specific Interface
  275. </a>
  276. </li>
  277. <li class="md-nav__item">
  278. <a href="ft2-sizes_management.html" class="md-nav__link">
  279. Size Management
  280. </a>
  281. </li>
  282. <li class="md-nav__item">
  283. <a href="ft2-header_file_macros.html" class="md-nav__link">
  284. Header File Macros
  285. </a>
  286. </li>
  287. </ul>
  288. </nav>
  289. </li>
  290. <li class="md-nav__item md-nav__item--nested">
  291. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
  292. <label class="md-nav__link" for="__nav_5">
  293. Format-Specific API
  294. <span class="md-nav__icon md-icon"></span>
  295. </label>
  296. <nav class="md-nav" aria-label="Format-Specific API" data-md-level="1">
  297. <label class="md-nav__title" for="__nav_5">
  298. <span class="md-nav__icon md-icon"></span>
  299. Format-Specific API
  300. </label>
  301. <ul class="md-nav__list" data-md-scrollfix>
  302. <li class="md-nav__item">
  303. <a href="ft2-multiple_masters.html" class="md-nav__link">
  304. Multiple Masters
  305. </a>
  306. </li>
  307. <li class="md-nav__item">
  308. <a href="ft2-truetype_tables.html" class="md-nav__link">
  309. TrueType Tables
  310. </a>
  311. </li>
  312. <li class="md-nav__item">
  313. <a href="ft2-type1_tables.html" class="md-nav__link">
  314. Type 1 Tables
  315. </a>
  316. </li>
  317. <li class="md-nav__item">
  318. <a href="ft2-sfnt_names.html" class="md-nav__link">
  319. SFNT Names
  320. </a>
  321. </li>
  322. <li class="md-nav__item">
  323. <a href="ft2-bdf_fonts.html" class="md-nav__link">
  324. BDF and PCF Files
  325. </a>
  326. </li>
  327. <li class="md-nav__item">
  328. <a href="ft2-cid_fonts.html" class="md-nav__link">
  329. CID Fonts
  330. </a>
  331. </li>
  332. <li class="md-nav__item">
  333. <a href="ft2-pfr_fonts.html" class="md-nav__link">
  334. PFR Fonts
  335. </a>
  336. </li>
  337. <li class="md-nav__item">
  338. <a href="ft2-winfnt_fonts.html" class="md-nav__link">
  339. Window FNT Files
  340. </a>
  341. </li>
  342. <li class="md-nav__item">
  343. <a href="ft2-font_formats.html" class="md-nav__link">
  344. Font Formats
  345. </a>
  346. </li>
  347. <li class="md-nav__item">
  348. <a href="ft2-gasp_table.html" class="md-nav__link">
  349. Gasp Table
  350. </a>
  351. </li>
  352. </ul>
  353. </nav>
  354. </li>
  355. <li class="md-nav__item md-nav__item--nested">
  356. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
  357. <label class="md-nav__link" for="__nav_6">
  358. Controlling FreeType Modules
  359. <span class="md-nav__icon md-icon"></span>
  360. </label>
  361. <nav class="md-nav" aria-label="Controlling FreeType Modules" data-md-level="1">
  362. <label class="md-nav__title" for="__nav_6">
  363. <span class="md-nav__icon md-icon"></span>
  364. Controlling FreeType Modules
  365. </label>
  366. <ul class="md-nav__list" data-md-scrollfix>
  367. <li class="md-nav__item">
  368. <a href="ft2-auto_hinter.html" class="md-nav__link">
  369. The auto-hinter
  370. </a>
  371. </li>
  372. <li class="md-nav__item">
  373. <a href="ft2-cff_driver.html" class="md-nav__link">
  374. The CFF driver
  375. </a>
  376. </li>
  377. <li class="md-nav__item">
  378. <a href="ft2-t1_cid_driver.html" class="md-nav__link">
  379. The Type 1 and CID drivers
  380. </a>
  381. </li>
  382. <li class="md-nav__item">
  383. <a href="ft2-tt_driver.html" class="md-nav__link">
  384. The TrueType driver
  385. </a>
  386. </li>
  387. <li class="md-nav__item">
  388. <a href="ft2-pcf_driver.html" class="md-nav__link">
  389. The PCF driver
  390. </a>
  391. </li>
  392. <li class="md-nav__item">
  393. <a href="ft2-properties.html" class="md-nav__link">
  394. Driver properties
  395. </a>
  396. </li>
  397. <li class="md-nav__item">
  398. <a href="ft2-parameter_tags.html" class="md-nav__link">
  399. Parameter Tags
  400. </a>
  401. </li>
  402. <li class="md-nav__item">
  403. <a href="ft2-lcd_rendering.html" class="md-nav__link">
  404. Subpixel Rendering
  405. </a>
  406. </li>
  407. </ul>
  408. </nav>
  409. </li>
  410. <li class="md-nav__item md-nav__item--nested">
  411. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
  412. <label class="md-nav__link" for="__nav_7">
  413. Cache Sub-System
  414. <span class="md-nav__icon md-icon"></span>
  415. </label>
  416. <nav class="md-nav" aria-label="Cache Sub-System" data-md-level="1">
  417. <label class="md-nav__title" for="__nav_7">
  418. <span class="md-nav__icon md-icon"></span>
  419. Cache Sub-System
  420. </label>
  421. <ul class="md-nav__list" data-md-scrollfix>
  422. <li class="md-nav__item">
  423. <a href="ft2-cache_subsystem.html" class="md-nav__link">
  424. Cache Sub-System
  425. </a>
  426. </li>
  427. </ul>
  428. </nav>
  429. </li>
  430. <li class="md-nav__item md-nav__item--nested">
  431. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8" type="checkbox" id="__nav_8" >
  432. <label class="md-nav__link" for="__nav_8">
  433. Support API
  434. <span class="md-nav__icon md-icon"></span>
  435. </label>
  436. <nav class="md-nav" aria-label="Support API" data-md-level="1">
  437. <label class="md-nav__title" for="__nav_8">
  438. <span class="md-nav__icon md-icon"></span>
  439. Support API
  440. </label>
  441. <ul class="md-nav__list" data-md-scrollfix>
  442. <li class="md-nav__item">
  443. <a href="ft2-computations.html" class="md-nav__link">
  444. Computations
  445. </a>
  446. </li>
  447. <li class="md-nav__item">
  448. <a href="ft2-list_processing.html" class="md-nav__link">
  449. List Processing
  450. </a>
  451. </li>
  452. <li class="md-nav__item">
  453. <a href="ft2-outline_processing.html" class="md-nav__link">
  454. Outline Processing
  455. </a>
  456. </li>
  457. <li class="md-nav__item">
  458. <a href="ft2-quick_advance.html" class="md-nav__link">
  459. Quick retrieval of advance values
  460. </a>
  461. </li>
  462. <li class="md-nav__item">
  463. <a href="ft2-bitmap_handling.html" class="md-nav__link">
  464. Bitmap Handling
  465. </a>
  466. </li>
  467. <li class="md-nav__item">
  468. <a href="ft2-raster.html" class="md-nav__link">
  469. Scanline Converter
  470. </a>
  471. </li>
  472. <li class="md-nav__item">
  473. <a href="ft2-glyph_stroker.html" class="md-nav__link">
  474. Glyph Stroker
  475. </a>
  476. </li>
  477. <li class="md-nav__item">
  478. <a href="ft2-system_interface.html" class="md-nav__link">
  479. System Interface
  480. </a>
  481. </li>
  482. <li class="md-nav__item">
  483. <a href="ft2-module_management.html" class="md-nav__link">
  484. Module Management
  485. </a>
  486. </li>
  487. <li class="md-nav__item">
  488. <a href="ft2-gzip.html" class="md-nav__link">
  489. GZIP Streams
  490. </a>
  491. </li>
  492. <li class="md-nav__item">
  493. <a href="ft2-lzw.html" class="md-nav__link">
  494. LZW Streams
  495. </a>
  496. </li>
  497. <li class="md-nav__item">
  498. <a href="ft2-bzip2.html" class="md-nav__link">
  499. BZIP2 Streams
  500. </a>
  501. </li>
  502. <li class="md-nav__item">
  503. <a href="ft2-debugging_apis.html" class="md-nav__link">
  504. External Debugging APIs
  505. </a>
  506. </li>
  507. </ul>
  508. </nav>
  509. </li>
  510. <li class="md-nav__item md-nav__item--nested">
  511. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_9" type="checkbox" id="__nav_9" >
  512. <label class="md-nav__link" for="__nav_9">
  513. Error Codes
  514. <span class="md-nav__icon md-icon"></span>
  515. </label>
  516. <nav class="md-nav" aria-label="Error Codes" data-md-level="1">
  517. <label class="md-nav__title" for="__nav_9">
  518. <span class="md-nav__icon md-icon"></span>
  519. Error Codes
  520. </label>
  521. <ul class="md-nav__list" data-md-scrollfix>
  522. <li class="md-nav__item">
  523. <a href="ft2-error_enumerations.html" class="md-nav__link">
  524. Error Enumerations
  525. </a>
  526. </li>
  527. <li class="md-nav__item">
  528. <a href="ft2-error_code_values.html" class="md-nav__link">
  529. Error Code Values
  530. </a>
  531. </li>
  532. </ul>
  533. </nav>
  534. </li>
  535. <li class="md-nav__item md-nav__item--nested">
  536. <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_10" type="checkbox" id="__nav_10" >
  537. <label class="md-nav__link" for="__nav_10">
  538. Miscellaneous
  539. <span class="md-nav__icon md-icon"></span>
  540. </label>
  541. <nav class="md-nav" aria-label="Miscellaneous" data-md-level="1">
  542. <label class="md-nav__title" for="__nav_10">
  543. <span class="md-nav__icon md-icon"></span>
  544. Miscellaneous
  545. </label>
  546. <ul class="md-nav__list" data-md-scrollfix>
  547. <li class="md-nav__item">
  548. <a href="ft2-gx_validation.html" class="md-nav__link">
  549. TrueTypeGX/AAT Validation
  550. </a>
  551. </li>
  552. <li class="md-nav__item">
  553. <a href="ft2-incremental.html" class="md-nav__link">
  554. Incremental Loading
  555. </a>
  556. </li>
  557. <li class="md-nav__item">
  558. <a href="ft2-truetype_engine.html" class="md-nav__link">
  559. The TrueType Engine
  560. </a>
  561. </li>
  562. <li class="md-nav__item">
  563. <a href="ft2-ot_validation.html" class="md-nav__link">
  564. OpenType Validation
  565. </a>
  566. </li>
  567. </ul>
  568. </nav>
  569. </li>
  570. </ul>
  571. </nav>
  572. </div>
  573. </div>
  574. </div>
  575. <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
  576. <div class="md-sidebar__scrollwrap">
  577. <div class="md-sidebar__inner">
  578. <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
  579. <label class="md-nav__title" for="__toc">
  580. <span class="md-nav__icon md-icon"></span>
  581. Table of contents
  582. </label>
  583. <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
  584. <li class="md-nav__item">
  585. <a href="#synopsis" class="md-nav__link">
  586. Synopsis
  587. </a>
  588. </li>
  589. <li class="md-nav__item">
  590. <a href="#ft_glyph" class="md-nav__link">
  591. FT_Glyph
  592. </a>
  593. </li>
  594. <li class="md-nav__item">
  595. <a href="#ft_glyphrec" class="md-nav__link">
  596. FT_GlyphRec
  597. </a>
  598. </li>
  599. <li class="md-nav__item">
  600. <a href="#ft_bitmapglyph" class="md-nav__link">
  601. FT_BitmapGlyph
  602. </a>
  603. </li>
  604. <li class="md-nav__item">
  605. <a href="#ft_bitmapglyphrec" class="md-nav__link">
  606. FT_BitmapGlyphRec
  607. </a>
  608. </li>
  609. <li class="md-nav__item">
  610. <a href="#ft_outlineglyph" class="md-nav__link">
  611. FT_OutlineGlyph
  612. </a>
  613. </li>
  614. <li class="md-nav__item">
  615. <a href="#ft_outlineglyphrec" class="md-nav__link">
  616. FT_OutlineGlyphRec
  617. </a>
  618. </li>
  619. <li class="md-nav__item">
  620. <a href="#ft_new_glyph" class="md-nav__link">
  621. FT_New_Glyph
  622. </a>
  623. </li>
  624. <li class="md-nav__item">
  625. <a href="#ft_get_glyph" class="md-nav__link">
  626. FT_Get_Glyph
  627. </a>
  628. </li>
  629. <li class="md-nav__item">
  630. <a href="#ft_glyph_copy" class="md-nav__link">
  631. FT_Glyph_Copy
  632. </a>
  633. </li>
  634. <li class="md-nav__item">
  635. <a href="#ft_glyph_transform" class="md-nav__link">
  636. FT_Glyph_Transform
  637. </a>
  638. </li>
  639. <li class="md-nav__item">
  640. <a href="#ft_glyph_bbox_mode" class="md-nav__link">
  641. FT_Glyph_BBox_Mode
  642. </a>
  643. </li>
  644. <li class="md-nav__item">
  645. <a href="#ft_glyph_get_cbox" class="md-nav__link">
  646. FT_Glyph_Get_CBox
  647. </a>
  648. </li>
  649. <li class="md-nav__item">
  650. <a href="#ft_glyph_to_bitmap" class="md-nav__link">
  651. FT_Glyph_To_Bitmap
  652. </a>
  653. </li>
  654. <li class="md-nav__item">
  655. <a href="#ft_done_glyph" class="md-nav__link">
  656. FT_Done_Glyph
  657. </a>
  658. </li>
  659. </ul>
  660. </nav>
  661. </div>
  662. </div>
  663. </div>
  664. <div class="md-content" data-md-component="content">
  665. <article class="md-content__inner md-typeset">
  666. <p><a href="https://www.freetype.org">FreeType</a> &raquo; <a href="../">Docs</a> &raquo; <a href="index.html#core-api">Core API</a> &raquo; Glyph Management</p>
  667. <hr />
  668. <h1 id="glyph-management">Glyph Management<a class="headerlink" href="#glyph-management" title="Permanent link">&para;</a></h1>
  669. <h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">&para;</a></h2>
  670. <p>This section contains definitions used to manage glyph data through generic <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> objects. Each of them can contain a bitmap, a vector outline, or even images in other formats. These objects are detached from <code><a href="ft2-base_interface.html#ft_face">FT_Face</a></code>, contrary to <code><a href="ft2-base_interface.html#ft_glyphslot">FT_GlyphSlot</a></code>.</p>
  671. <h2 id="ft_glyph">FT_Glyph<a class="headerlink" href="#ft_glyph" title="Permanent link">&para;</a></h2>
  672. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  673. <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_GlyphRec_* <b>FT_Glyph</b>;
  674. </code></pre></div>
  675. <p>Handle to an object used to model generic glyph images. It is a pointer to the <code><a href="ft2-glyph_management.html#ft_glyphrec">FT_GlyphRec</a></code> structure and can contain a glyph bitmap or pointer.</p>
  676. <h4>note</h4>
  677. <p>Glyph objects are not owned by the library. You must thus release them manually (through <code><a href="ft2-glyph_management.html#ft_done_glyph">FT_Done_Glyph</a></code>) <em>before</em> calling <code><a href="ft2-base_interface.html#ft_done_freetype">FT_Done_FreeType</a></code>.</p>
  678. <hr>
  679. <h2 id="ft_glyphrec">FT_GlyphRec<a class="headerlink" href="#ft_glyphrec" title="Permanent link">&para;</a></h2>
  680. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  681. <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_GlyphRec_
  682. {
  683. <a href="ft2-base_interface.html#ft_library">FT_Library</a> library;
  684. <span class="keyword">const</span> FT_Glyph_Class* clazz;
  685. <a href="ft2-basic_types.html#ft_glyph_format">FT_Glyph_Format</a> format;
  686. <a href="ft2-basic_types.html#ft_vector">FT_Vector</a> advance;
  687. } <b>FT_GlyphRec</b>;
  688. </code></pre></div>
  689. <p>The root glyph structure contains a given glyph image plus its advance width in 16.16 fixed-point format.</p>
  690. <h4>fields</h4>
  691. <table class="fields">
  692. <tr><td class="val" id="library">library</td><td class="desc">
  693. <p>A handle to the FreeType library object.</p>
  694. </td></tr>
  695. <tr><td class="val" id="clazz">clazz</td><td class="desc">
  696. <p>A pointer to the glyph's class. Private.</p>
  697. </td></tr>
  698. <tr><td class="val" id="format">format</td><td class="desc">
  699. <p>The format of the glyph's image.</p>
  700. </td></tr>
  701. <tr><td class="val" id="advance">advance</td><td class="desc">
  702. <p>A 16.16 vector that gives the glyph's advance width.</p>
  703. </td></tr>
  704. </table>
  705. <hr>
  706. <h2 id="ft_bitmapglyph">FT_BitmapGlyph<a class="headerlink" href="#ft_bitmapglyph" title="Permanent link">&para;</a></h2>
  707. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  708. <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_BitmapGlyphRec_* <b>FT_BitmapGlyph</b>;
  709. </code></pre></div>
  710. <p>A handle to an object used to model a bitmap glyph image. This is a sub-class of <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>, and a pointer to <code><a href="ft2-glyph_management.html#ft_bitmapglyphrec">FT_BitmapGlyphRec</a></code>.</p>
  711. <hr>
  712. <h2 id="ft_bitmapglyphrec">FT_BitmapGlyphRec<a class="headerlink" href="#ft_bitmapglyphrec" title="Permanent link">&para;</a></h2>
  713. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  714. <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_BitmapGlyphRec_
  715. {
  716. <a href="ft2-glyph_management.html#ft_glyphrec">FT_GlyphRec</a> root;
  717. <a href="ft2-basic_types.html#ft_int">FT_Int</a> left;
  718. <a href="ft2-basic_types.html#ft_int">FT_Int</a> top;
  719. <a href="ft2-basic_types.html#ft_bitmap">FT_Bitmap</a> bitmap;
  720. } <b>FT_BitmapGlyphRec</b>;
  721. </code></pre></div>
  722. <p>A structure used for bitmap glyph images. This really is a &lsquo;sub-class&rsquo; of <code><a href="ft2-glyph_management.html#ft_glyphrec">FT_GlyphRec</a></code>.</p>
  723. <h4>fields</h4>
  724. <table class="fields">
  725. <tr><td class="val" id="root">root</td><td class="desc">
  726. <p>The root <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> fields.</p>
  727. </td></tr>
  728. <tr><td class="val" id="left">left</td><td class="desc">
  729. <p>The left-side bearing, i.e., the horizontal distance from the current pen position to the left border of the glyph bitmap.</p>
  730. </td></tr>
  731. <tr><td class="val" id="top">top</td><td class="desc">
  732. <p>The top-side bearing, i.e., the vertical distance from the current pen position to the top border of the glyph bitmap. This distance is positive for upwards&nbsp;y!</p>
  733. </td></tr>
  734. <tr><td class="val" id="bitmap">bitmap</td><td class="desc">
  735. <p>A descriptor for the bitmap.</p>
  736. </td></tr>
  737. </table>
  738. <h4>note</h4>
  739. <p>You can typecast an <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> to <code><a href="ft2-glyph_management.html#ft_bitmapglyph">FT_BitmapGlyph</a></code> if you have <code>glyph-&gt;format == FT_GLYPH_FORMAT_BITMAP</code>. This lets you access the bitmap's contents easily.</p>
  740. <p>The corresponding pixel buffer is always owned by <code><a href="ft2-glyph_management.html#ft_bitmapglyph">FT_BitmapGlyph</a></code> and is thus created and destroyed with it.</p>
  741. <hr>
  742. <h2 id="ft_outlineglyph">FT_OutlineGlyph<a class="headerlink" href="#ft_outlineglyph" title="Permanent link">&para;</a></h2>
  743. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  744. <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_OutlineGlyphRec_* <b>FT_OutlineGlyph</b>;
  745. </code></pre></div>
  746. <p>A handle to an object used to model an outline glyph image. This is a sub-class of <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code>, and a pointer to <code><a href="ft2-glyph_management.html#ft_outlineglyphrec">FT_OutlineGlyphRec</a></code>.</p>
  747. <hr>
  748. <h2 id="ft_outlineglyphrec">FT_OutlineGlyphRec<a class="headerlink" href="#ft_outlineglyphrec" title="Permanent link">&para;</a></h2>
  749. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  750. <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_OutlineGlyphRec_
  751. {
  752. <a href="ft2-glyph_management.html#ft_glyphrec">FT_GlyphRec</a> root;
  753. <a href="ft2-outline_processing.html#ft_outline">FT_Outline</a> outline;
  754. } <b>FT_OutlineGlyphRec</b>;
  755. </code></pre></div>
  756. <p>A structure used for outline (vectorial) glyph images. This really is a &lsquo;sub-class&rsquo; of <code><a href="ft2-glyph_management.html#ft_glyphrec">FT_GlyphRec</a></code>.</p>
  757. <h4>fields</h4>
  758. <table class="fields">
  759. <tr><td class="val" id="root">root</td><td class="desc">
  760. <p>The root <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> fields.</p>
  761. </td></tr>
  762. <tr><td class="val" id="outline">outline</td><td class="desc">
  763. <p>A descriptor for the outline.</p>
  764. </td></tr>
  765. </table>
  766. <h4>note</h4>
  767. <p>You can typecast an <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> to <code><a href="ft2-glyph_management.html#ft_outlineglyph">FT_OutlineGlyph</a></code> if you have <code>glyph-&gt;format == FT_GLYPH_FORMAT_OUTLINE</code>. This lets you access the outline's content easily.</p>
  768. <p>As the outline is extracted from a glyph slot, its coordinates are expressed normally in 26.6 pixels, unless the flag <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_SCALE</a></code> was used in <code><a href="ft2-base_interface.html#ft_load_glyph">FT_Load_Glyph</a></code> or <code><a href="ft2-base_interface.html#ft_load_char">FT_Load_Char</a></code>.</p>
  769. <p>The outline's tables are always owned by the object and are destroyed with it.</p>
  770. <hr>
  771. <h2 id="ft_new_glyph">FT_New_Glyph<a class="headerlink" href="#ft_new_glyph" title="Permanent link">&para;</a></h2>
  772. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  773. <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
  774. <b>FT_New_Glyph</b>( <a href="ft2-base_interface.html#ft_library">FT_Library</a> library,
  775. <a href="ft2-basic_types.html#ft_glyph_format">FT_Glyph_Format</a> format,
  776. <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a> *aglyph );
  777. </code></pre></div>
  778. <p>A function used to create a new empty glyph image. Note that the created <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> object must be released with <code><a href="ft2-glyph_management.html#ft_done_glyph">FT_Done_Glyph</a></code>.</p>
  779. <h4>input</h4>
  780. <table class="fields">
  781. <tr><td class="val" id="library">library</td><td class="desc">
  782. <p>A handle to the FreeType library object.</p>
  783. </td></tr>
  784. <tr><td class="val" id="format">format</td><td class="desc">
  785. <p>The format of the glyph's image.</p>
  786. </td></tr>
  787. </table>
  788. <h4>output</h4>
  789. <table class="fields">
  790. <tr><td class="val" id="aglyph">aglyph</td><td class="desc">
  791. <p>A handle to the glyph object.</p>
  792. </td></tr>
  793. </table>
  794. <h4>return</h4>
  795. <p>FreeType error code. 0&nbsp;means success.</p>
  796. <h4>since</h4>
  797. <p>2.10</p>
  798. <hr>
  799. <h2 id="ft_get_glyph">FT_Get_Glyph<a class="headerlink" href="#ft_get_glyph" title="Permanent link">&para;</a></h2>
  800. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  801. <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
  802. <b>FT_Get_Glyph</b>( <a href="ft2-base_interface.html#ft_glyphslot">FT_GlyphSlot</a> slot,
  803. <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a> *aglyph );
  804. </code></pre></div>
  805. <p>A function used to extract a glyph image from a slot. Note that the created <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> object must be released with <code><a href="ft2-glyph_management.html#ft_done_glyph">FT_Done_Glyph</a></code>.</p>
  806. <h4>input</h4>
  807. <table class="fields">
  808. <tr><td class="val" id="slot">slot</td><td class="desc">
  809. <p>A handle to the source glyph slot.</p>
  810. </td></tr>
  811. </table>
  812. <h4>output</h4>
  813. <table class="fields">
  814. <tr><td class="val" id="aglyph">aglyph</td><td class="desc">
  815. <p>A handle to the glyph object.</p>
  816. </td></tr>
  817. </table>
  818. <h4>return</h4>
  819. <p>FreeType error code. 0&nbsp;means success.</p>
  820. <h4>note</h4>
  821. <p>Because <code>*aglyph-&gt;advance.x</code> and <code>*aglyph-&gt;advance.y</code> are 16.16 fixed-point numbers, <code>slot-&gt;advance.x</code> and <code>slot-&gt;advance.y</code> (which are in 26.6 fixed-point format) must be in the range ]-32768;32768[.</p>
  822. <hr>
  823. <h2 id="ft_glyph_copy">FT_Glyph_Copy<a class="headerlink" href="#ft_glyph_copy" title="Permanent link">&para;</a></h2>
  824. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  825. <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
  826. <b>FT_Glyph_Copy</b>( <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a> source,
  827. <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a> *target );
  828. </code></pre></div>
  829. <p>A function used to copy a glyph image. Note that the created <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> object must be released with <code><a href="ft2-glyph_management.html#ft_done_glyph">FT_Done_Glyph</a></code>.</p>
  830. <h4>input</h4>
  831. <table class="fields">
  832. <tr><td class="val" id="source">source</td><td class="desc">
  833. <p>A handle to the source glyph object.</p>
  834. </td></tr>
  835. </table>
  836. <h4>output</h4>
  837. <table class="fields">
  838. <tr><td class="val" id="target">target</td><td class="desc">
  839. <p>A handle to the target glyph object. 0&nbsp;in case of error.</p>
  840. </td></tr>
  841. </table>
  842. <h4>return</h4>
  843. <p>FreeType error code. 0&nbsp;means success.</p>
  844. <hr>
  845. <h2 id="ft_glyph_transform">FT_Glyph_Transform<a class="headerlink" href="#ft_glyph_transform" title="Permanent link">&para;</a></h2>
  846. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  847. <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
  848. <b>FT_Glyph_Transform</b>( <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a> glyph,
  849. <a href="ft2-basic_types.html#ft_matrix">FT_Matrix</a>* matrix,
  850. <a href="ft2-basic_types.html#ft_vector">FT_Vector</a>* delta );
  851. </code></pre></div>
  852. <p>Transform a glyph image if its format is scalable.</p>
  853. <h4>inout</h4>
  854. <table class="fields">
  855. <tr><td class="val" id="glyph">glyph</td><td class="desc">
  856. <p>A handle to the target glyph object.</p>
  857. </td></tr>
  858. </table>
  859. <h4>input</h4>
  860. <table class="fields">
  861. <tr><td class="val" id="matrix">matrix</td><td class="desc">
  862. <p>A pointer to a 2x2 matrix to apply.</p>
  863. </td></tr>
  864. <tr><td class="val" id="delta">delta</td><td class="desc">
  865. <p>A pointer to a 2d vector to apply. Coordinates are expressed in 1/64th of a pixel.</p>
  866. </td></tr>
  867. </table>
  868. <h4>return</h4>
  869. <p>FreeType error code (if not 0, the glyph format is not scalable).</p>
  870. <h4>note</h4>
  871. <p>The 2x2 transformation matrix is also applied to the glyph's advance vector.</p>
  872. <hr>
  873. <h2 id="ft_glyph_bbox_mode">FT_Glyph_BBox_Mode<a class="headerlink" href="#ft_glyph_bbox_mode" title="Permanent link">&para;</a></h2>
  874. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  875. <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">enum</span> FT_Glyph_BBox_Mode_
  876. {
  877. <a href="ft2-glyph_management.html#ft_glyph_bbox_unscaled">FT_GLYPH_BBOX_UNSCALED</a> = 0,
  878. <a href="ft2-glyph_management.html#ft_glyph_bbox_subpixels">FT_GLYPH_BBOX_SUBPIXELS</a> = 0,
  879. <a href="ft2-glyph_management.html#ft_glyph_bbox_gridfit">FT_GLYPH_BBOX_GRIDFIT</a> = 1,
  880. <a href="ft2-glyph_management.html#ft_glyph_bbox_truncate">FT_GLYPH_BBOX_TRUNCATE</a> = 2,
  881. <a href="ft2-glyph_management.html#ft_glyph_bbox_pixels">FT_GLYPH_BBOX_PIXELS</a> = 3
  882. } <b>FT_Glyph_BBox_Mode</b>;
  883. /* these constants are deprecated; use the corresponding */
  884. /* `<b>FT_Glyph_BBox_Mode</b>` values instead */
  885. #<span class="keyword">define</span> ft_glyph_bbox_unscaled <a href="ft2-glyph_management.html#ft_glyph_bbox_unscaled">FT_GLYPH_BBOX_UNSCALED</a>
  886. #<span class="keyword">define</span> ft_glyph_bbox_subpixels <a href="ft2-glyph_management.html#ft_glyph_bbox_subpixels">FT_GLYPH_BBOX_SUBPIXELS</a>
  887. #<span class="keyword">define</span> ft_glyph_bbox_gridfit <a href="ft2-glyph_management.html#ft_glyph_bbox_gridfit">FT_GLYPH_BBOX_GRIDFIT</a>
  888. #<span class="keyword">define</span> ft_glyph_bbox_truncate <a href="ft2-glyph_management.html#ft_glyph_bbox_truncate">FT_GLYPH_BBOX_TRUNCATE</a>
  889. #<span class="keyword">define</span> ft_glyph_bbox_pixels <a href="ft2-glyph_management.html#ft_glyph_bbox_pixels">FT_GLYPH_BBOX_PIXELS</a>
  890. </code></pre></div>
  891. <p>The mode how the values of <code><a href="ft2-glyph_management.html#ft_glyph_get_cbox">FT_Glyph_Get_CBox</a></code> are returned.</p>
  892. <h4>values</h4>
  893. <table class="fields">
  894. <tr><td class="val" id="ft_glyph_bbox_unscaled">FT_GLYPH_BBOX_UNSCALED</td><td class="desc">
  895. <p>Return unscaled font units.</p>
  896. </td></tr>
  897. <tr><td class="val" id="ft_glyph_bbox_subpixels">FT_GLYPH_BBOX_SUBPIXELS</td><td class="desc">
  898. <p>Return unfitted 26.6 coordinates.</p>
  899. </td></tr>
  900. <tr><td class="val" id="ft_glyph_bbox_gridfit">FT_GLYPH_BBOX_GRIDFIT</td><td class="desc">
  901. <p>Return grid-fitted 26.6 coordinates.</p>
  902. </td></tr>
  903. <tr><td class="val" id="ft_glyph_bbox_truncate">FT_GLYPH_BBOX_TRUNCATE</td><td class="desc">
  904. <p>Return coordinates in integer pixels.</p>
  905. </td></tr>
  906. <tr><td class="val" id="ft_glyph_bbox_pixels">FT_GLYPH_BBOX_PIXELS</td><td class="desc">
  907. <p>Return grid-fitted pixel coordinates.</p>
  908. </td></tr>
  909. </table>
  910. <hr>
  911. <h2 id="ft_glyph_get_cbox">FT_Glyph_Get_CBox<a class="headerlink" href="#ft_glyph_get_cbox" title="Permanent link">&para;</a></h2>
  912. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  913. <div class = "codehilite"><pre><code> FT_EXPORT( <span class="keyword">void</span> )
  914. <b>FT_Glyph_Get_CBox</b>( <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a> glyph,
  915. <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> bbox_mode,
  916. <a href="ft2-basic_types.html#ft_bbox">FT_BBox</a> *acbox );
  917. </code></pre></div>
  918. <p>Return a glyph's &lsquo;control box&rsquo;. The control box encloses all the outline's points, including Bezier control points. Though it coincides with the exact bounding box for most glyphs, it can be slightly larger in some situations (like when rotating an outline that contains Bezier outside arcs).</p>
  919. <p>Computing the control box is very fast, while getting the bounding box can take much more time as it needs to walk over all segments and arcs in the outline. To get the latter, you can use the &lsquo;ftbbox&rsquo; component, which is dedicated to this single task.</p>
  920. <h4>input</h4>
  921. <table class="fields">
  922. <tr><td class="val" id="glyph">glyph</td><td class="desc">
  923. <p>A handle to the source glyph object.</p>
  924. </td></tr>
  925. <tr><td class="val" id="mode">mode</td><td class="desc">
  926. <p>The mode that indicates how to interpret the returned bounding box values.</p>
  927. </td></tr>
  928. </table>
  929. <h4>output</h4>
  930. <table class="fields">
  931. <tr><td class="val" id="acbox">acbox</td><td class="desc">
  932. <p>The glyph coordinate bounding box. Coordinates are expressed in 1/64th of pixels if it is grid-fitted.</p>
  933. </td></tr>
  934. </table>
  935. <h4>note</h4>
  936. <p>Coordinates are relative to the glyph origin, using the y&nbsp;upwards convention.</p>
  937. <p>If the glyph has been loaded with <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_SCALE</a></code>, <code>bbox_mode</code> must be set to <code><a href="ft2-glyph_management.html#ft_glyph_bbox_mode">FT_GLYPH_BBOX_UNSCALED</a></code> to get unscaled font units in 26.6 pixel format. The value <code><a href="ft2-glyph_management.html#ft_glyph_bbox_mode">FT_GLYPH_BBOX_SUBPIXELS</a></code> is another name for this constant.</p>
  938. <p>If the font is tricky and the glyph has been loaded with <code><a href="ft2-base_interface.html#ft_load_xxx">FT_LOAD_NO_SCALE</a></code>, the resulting CBox is meaningless. To get reasonable values for the CBox it is necessary to load the glyph at a large ppem value (so that the hinting instructions can properly shift and scale the subglyphs), then extracting the CBox, which can be eventually converted back to font units.</p>
  939. <p>Note that the maximum coordinates are exclusive, which means that one can compute the width and height of the glyph image (be it in integer or 26.6 pixels) as:
  940. <div class="highlight"><pre><span></span><code> width = bbox.xMax - bbox.xMin;
  941. height = bbox.yMax - bbox.yMin;
  942. </code></pre></div></p>
  943. <p>Note also that for 26.6 coordinates, if <code>bbox_mode</code> is set to <code><a href="ft2-glyph_management.html#ft_glyph_bbox_mode">FT_GLYPH_BBOX_GRIDFIT</a></code>, the coordinates will also be grid-fitted, which corresponds to:
  944. <div class="highlight"><pre><span></span><code> bbox.xMin = FLOOR(bbox.xMin);
  945. bbox.yMin = FLOOR(bbox.yMin);
  946. bbox.xMax = CEILING(bbox.xMax);
  947. bbox.yMax = CEILING(bbox.yMax);
  948. </code></pre></div></p>
  949. <p>To get the bbox in pixel coordinates, set <code>bbox_mode</code> to <code><a href="ft2-glyph_management.html#ft_glyph_bbox_mode">FT_GLYPH_BBOX_TRUNCATE</a></code>.</p>
  950. <p>To get the bbox in grid-fitted pixel coordinates, set <code>bbox_mode</code> to <code><a href="ft2-glyph_management.html#ft_glyph_bbox_mode">FT_GLYPH_BBOX_PIXELS</a></code>.</p>
  951. <hr>
  952. <h2 id="ft_glyph_to_bitmap">FT_Glyph_To_Bitmap<a class="headerlink" href="#ft_glyph_to_bitmap" title="Permanent link">&para;</a></h2>
  953. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  954. <div class = "codehilite"><pre><code> FT_EXPORT( <a href="ft2-basic_types.html#ft_error">FT_Error</a> )
  955. <b>FT_Glyph_To_Bitmap</b>( <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a>* the_glyph,
  956. <a href="ft2-base_interface.html#ft_render_mode">FT_Render_Mode</a> render_mode,
  957. <a href="ft2-basic_types.html#ft_vector">FT_Vector</a>* origin,
  958. <a href="ft2-basic_types.html#ft_bool">FT_Bool</a> destroy );
  959. </code></pre></div>
  960. <p>Convert a given glyph object to a bitmap glyph object.</p>
  961. <h4>inout</h4>
  962. <table class="fields">
  963. <tr><td class="val" id="the_glyph">the_glyph</td><td class="desc">
  964. <p>A pointer to a handle to the target glyph.</p>
  965. </td></tr>
  966. </table>
  967. <h4>input</h4>
  968. <table class="fields">
  969. <tr><td class="val" id="render_mode">render_mode</td><td class="desc">
  970. <p>An enumeration that describes how the data is rendered.</p>
  971. </td></tr>
  972. <tr><td class="val" id="origin">origin</td><td class="desc">
  973. <p>A pointer to a vector used to translate the glyph image before rendering. Can be&nbsp;0 (if no translation). The origin is expressed in 26.6 pixels.</p>
  974. </td></tr>
  975. <tr><td class="val" id="destroy">destroy</td><td class="desc">
  976. <p>A boolean that indicates that the original glyph image should be destroyed by this function. It is never destroyed in case of error.</p>
  977. </td></tr>
  978. </table>
  979. <h4>return</h4>
  980. <p>FreeType error code. 0&nbsp;means success.</p>
  981. <h4>note</h4>
  982. <p>This function does nothing if the glyph format isn't scalable.</p>
  983. <p>The glyph image is translated with the <code>origin</code> vector before rendering.</p>
  984. <p>The first parameter is a pointer to an <code><a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a></code> handle, that will be <em>replaced</em> by this function (with newly allocated data). Typically, you would use (omitting error handling):
  985. <div class="highlight"><pre><span></span><code> FT_Glyph glyph;
  986. FT_BitmapGlyph glyph_bitmap;
  987. // load glyph
  988. error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAULT );
  989. // extract glyph image
  990. error = FT_Get_Glyph( face-&gt;glyph, &amp;glyph );
  991. // convert to a bitmap (default render mode + destroying old)
  992. if ( glyph-&gt;format != FT_GLYPH_FORMAT_BITMAP )
  993. {
  994. error = FT_Glyph_To_Bitmap( &amp;glyph, FT_RENDER_MODE_NORMAL,
  995. 0, 1 );
  996. if ( error ) // `glyph&#39; unchanged
  997. ...
  998. }
  999. // access bitmap content by typecasting
  1000. glyph_bitmap = (FT_BitmapGlyph)glyph;
  1001. // do funny stuff with it, like blitting/drawing
  1002. ...
  1003. // discard glyph image (bitmap or not)
  1004. FT_Done_Glyph( glyph );
  1005. </code></pre></div></p>
  1006. <p>Here is another example, again without error handling:
  1007. <div class="highlight"><pre><span></span><code> FT_Glyph glyphs[MAX_GLYPHS]
  1008. ...
  1009. for ( idx = 0; i &lt; MAX_GLYPHS; i++ )
  1010. error = FT_Load_Glyph( face, idx, FT_LOAD_DEFAULT ) ||
  1011. FT_Get_Glyph ( face-&gt;glyph, &amp;glyphs[idx] );
  1012. ...
  1013. for ( idx = 0; i &lt; MAX_GLYPHS; i++ )
  1014. {
  1015. FT_Glyph bitmap = glyphs[idx];
  1016. ...
  1017. // after this call, `bitmap&#39; no longer points into
  1018. // the `glyphs&#39; array (and the old value isn&#39;t destroyed)
  1019. FT_Glyph_To_Bitmap( &amp;bitmap, FT_RENDER_MODE_MONO, 0, 0 );
  1020. ...
  1021. FT_Done_Glyph( bitmap );
  1022. }
  1023. ...
  1024. for ( idx = 0; i &lt; MAX_GLYPHS; i++ )
  1025. FT_Done_Glyph( glyphs[idx] );
  1026. </code></pre></div></p>
  1027. <hr>
  1028. <h2 id="ft_done_glyph">FT_Done_Glyph<a class="headerlink" href="#ft_done_glyph" title="Permanent link">&para;</a></h2>
  1029. <p>Defined in FT_GLYPH_H (freetype/ftglyph.h).</p>
  1030. <div class = "codehilite"><pre><code> FT_EXPORT( <span class="keyword">void</span> )
  1031. <b>FT_Done_Glyph</b>( <a href="ft2-glyph_management.html#ft_glyph">FT_Glyph</a> glyph );
  1032. </code></pre></div>
  1033. <p>Destroy a given glyph.</p>
  1034. <h4>input</h4>
  1035. <table class="fields">
  1036. <tr><td class="val" id="glyph">glyph</td><td class="desc">
  1037. <p>A handle to the target glyph object.</p>
  1038. </td></tr>
  1039. </table>
  1040. <hr>
  1041. </article>
  1042. </div>
  1043. </div>
  1044. </main>
  1045. <footer class="md-footer">
  1046. <nav class="md-footer__inner md-grid" aria-label="Footer">
  1047. <a href="ft2-layer_management.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: Glyph Layer Management" rel="prev">
  1048. <div class="md-footer__button md-icon">
  1049. <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>
  1050. </div>
  1051. <div class="md-footer__title">
  1052. <div class="md-ellipsis">
  1053. <span class="md-footer__direction">
  1054. Previous
  1055. </span>
  1056. Glyph Layer Management
  1057. </div>
  1058. </div>
  1059. </a>
  1060. <a href="ft2-mac_specific.html" class="md-footer__link md-footer__link--next" aria-label="Next: Mac Specific Interface" rel="next">
  1061. <div class="md-footer__title">
  1062. <div class="md-ellipsis">
  1063. <span class="md-footer__direction">
  1064. Next
  1065. </span>
  1066. Mac Specific Interface
  1067. </div>
  1068. </div>
  1069. <div class="md-footer__button md-icon">
  1070. <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>
  1071. </div>
  1072. </a>
  1073. </nav>
  1074. <div class="md-footer-meta md-typeset">
  1075. <div class="md-footer-meta__inner md-grid">
  1076. <div class="md-footer-copyright">
  1077. <div class="md-footer-copyright__highlight">
  1078. Copyright 2021 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
  1079. </div>
  1080. Made with
  1081. <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
  1082. Material for MkDocs
  1083. </a>
  1084. </div>
  1085. </div>
  1086. </div>
  1087. </footer>
  1088. </div>
  1089. <div class="md-dialog" data-md-component="dialog">
  1090. <div class="md-dialog__inner md-typeset"></div>
  1091. </div>
  1092. <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>
  1093. <script src="assets/javascripts/bundle.82b56eb2.min.js"></script>
  1094. <script src="javascripts/extra.js"></script>
  1095. </body>
  1096. </html>