3 <html lang="en" class="no-js">
7 <meta name="viewport" content="width=device-width,initial-scale=1">
9 <meta name="description" content="API Reference Documentation for FreeType-2.13.2">
13 <meta name="author" content="FreeType Contributors">
16 <link rel="icon" href="images/favico.ico">
17 <meta name="generator" content="mkdocs-1.4.3, mkdocs-material-7.1.9">
21 <title>Basic Data Types - FreeType-2.13.2 API Reference</title>
25 <link rel="stylesheet" href="assets/stylesheets/main.ca7ac06f.min.css">
28 <link rel="stylesheet" href="assets/stylesheets/palette.f1a3b89f.min.css">
32 <meta name="theme-color" content="#4cae4f">
40 <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
41 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Noto+Serif:300,400,400i,700%7CRoboto+Mono&display=fallback">
42 <style>:root{--md-text-font-family:"Noto Serif";--md-code-font-family:"Roboto Mono"}</style>
47 <link rel="stylesheet" href="stylesheets/extra.css">
63 <body dir="ltr" data-md-color-scheme="" data-md-color-primary="green" data-md-color-accent="green">
66 <script>function __prefix(e){return new URL(".",location).pathname+"."+e}function __get(e,t=localStorage){return JSON.parse(t.getItem(__prefix(e)))}</script>
68 <input class="md-toggle" data-md-toggle="drawer" type="checkbox" id="__drawer" autocomplete="off">
69 <input class="md-toggle" data-md-toggle="search" type="checkbox" id="__search" autocomplete="off">
70 <label class="md-overlay" for="__drawer"></label>
71 <div data-md-component="skip">
74 <a href="#basic-data-types" class="md-skip">
79 <div data-md-component="announce">
83 <header class="md-header" data-md-component="header">
84 <nav class="md-header__inner md-grid" aria-label="Header">
85 <a href="index.html" title="FreeType-2.13.2 API Reference" class="md-header__button md-logo" aria-label="FreeType-2.13.2 API Reference" data-md-component="logo">
87 <img src="images/favico.ico" alt="logo">
90 <label class="md-header__button md-icon" for="__drawer">
91 <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path d="M3 6h18v2H3V6m0 5h18v2H3v-2m0 5h18v2H3v-2z"/></svg>
93 <div class="md-header__title" data-md-component="header-title">
94 <div class="md-header__ellipsis">
95 <div class="md-header__topic">
96 <span class="md-ellipsis">
97 FreeType-2.13.2 API Reference
100 <div class="md-header__topic" data-md-component="header-topic">
101 <span class="md-ellipsis">
112 <label class="md-header__button md-icon" for="__search">
113 <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>
116 <div class="md-search" data-md-component="search" role="dialog">
117 <label class="md-search__overlay" for="__search"></label>
118 <div class="md-search__inner" role="search">
119 <form class="md-search__form" name="search">
120 <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>
121 <label class="md-search__icon md-icon" for="__search">
122 <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>
123 <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>
125 <button type="reset" class="md-search__icon md-icon" aria-label="Clear" tabindex="-1">
126 <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>
129 <div class="md-search__output">
130 <div class="md-search__scrollwrap" data-md-scrollfix>
131 <div class="md-search-result" data-md-component="search-result">
132 <div class="md-search-result__meta">
135 <ol class="md-search-result__list"></ol>
146 <div class="md-container" data-md-component="container">
151 <main class="md-main" data-md-component="main">
152 <div class="md-main__inner md-grid">
156 <div class="md-sidebar md-sidebar--primary" data-md-component="sidebar" data-md-type="navigation" >
157 <div class="md-sidebar__scrollwrap">
158 <div class="md-sidebar__inner">
162 <nav class="md-nav md-nav--primary" aria-label="Navigation" data-md-level="0">
163 <label class="md-nav__title" for="__drawer">
164 <a href="index.html" title="FreeType-2.13.2 API Reference" class="md-nav__button md-logo" aria-label="FreeType-2.13.2 API Reference" data-md-component="logo">
166 <img src="images/favico.ico" alt="logo">
169 FreeType-2.13.2 API Reference
172 <ul class="md-nav__list" data-md-scrollfix>
181 <li class="md-nav__item">
182 <a href="index.html" class="md-nav__link">
196 <li class="md-nav__item">
197 <a href="ft2-index.html" class="md-nav__link">
212 <li class="md-nav__item md-nav__item--nested">
215 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_3" type="checkbox" id="__nav_3" >
217 <label class="md-nav__link" for="__nav_3">
219 <span class="md-nav__icon md-icon"></span>
221 <nav class="md-nav" aria-label="General Remarks" data-md-level="1">
222 <label class="md-nav__title" for="__nav_3">
223 <span class="md-nav__icon md-icon"></span>
226 <ul class="md-nav__list" data-md-scrollfix>
232 <li class="md-nav__item">
233 <a href="ft2-preamble.html" class="md-nav__link">
244 <li class="md-nav__item">
245 <a href="ft2-header_inclusion.html" class="md-nav__link">
246 FreeType's header inclusion scheme
256 <li class="md-nav__item">
257 <a href="ft2-user_allocation.html" class="md-nav__link">
280 <li class="md-nav__item md-nav__item--active md-nav__item--nested">
283 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_4" type="checkbox" id="__nav_4" checked>
285 <label class="md-nav__link" for="__nav_4">
287 <span class="md-nav__icon md-icon"></span>
289 <nav class="md-nav" aria-label="Core API" data-md-level="1">
290 <label class="md-nav__title" for="__nav_4">
291 <span class="md-nav__icon md-icon"></span>
294 <ul class="md-nav__list" data-md-scrollfix>
302 <li class="md-nav__item md-nav__item--active">
304 <input class="md-nav__toggle md-toggle" data-md-toggle="toc" type="checkbox" id="__toc">
310 <label class="md-nav__link md-nav__link--active" for="__toc">
312 <span class="md-nav__icon md-icon"></span>
315 <a href="ft2-basic_types.html" class="md-nav__link md-nav__link--active">
320 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
327 <label class="md-nav__title" for="__toc">
328 <span class="md-nav__icon md-icon"></span>
331 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
333 <li class="md-nav__item">
334 <a href="#synopsis" class="md-nav__link">
340 <li class="md-nav__item">
341 <a href="#ft_byte" class="md-nav__link">
347 <li class="md-nav__item">
348 <a href="#ft_bytes" class="md-nav__link">
354 <li class="md-nav__item">
355 <a href="#ft_char" class="md-nav__link">
361 <li class="md-nav__item">
362 <a href="#ft_int" class="md-nav__link">
368 <li class="md-nav__item">
369 <a href="#ft_uint" class="md-nav__link">
375 <li class="md-nav__item">
376 <a href="#ft_int16" class="md-nav__link">
382 <li class="md-nav__item">
383 <a href="#ft_uint16" class="md-nav__link">
389 <li class="md-nav__item">
390 <a href="#ft_int32" class="md-nav__link">
396 <li class="md-nav__item">
397 <a href="#ft_uint32" class="md-nav__link">
403 <li class="md-nav__item">
404 <a href="#ft_int64" class="md-nav__link">
410 <li class="md-nav__item">
411 <a href="#ft_uint64" class="md-nav__link">
417 <li class="md-nav__item">
418 <a href="#ft_short" class="md-nav__link">
424 <li class="md-nav__item">
425 <a href="#ft_ushort" class="md-nav__link">
431 <li class="md-nav__item">
432 <a href="#ft_long" class="md-nav__link">
438 <li class="md-nav__item">
439 <a href="#ft_ulong" class="md-nav__link">
445 <li class="md-nav__item">
446 <a href="#ft_bool" class="md-nav__link">
452 <li class="md-nav__item">
453 <a href="#ft_offset" class="md-nav__link">
459 <li class="md-nav__item">
460 <a href="#ft_ptrdist" class="md-nav__link">
466 <li class="md-nav__item">
467 <a href="#ft_string" class="md-nav__link">
473 <li class="md-nav__item">
474 <a href="#ft_tag" class="md-nav__link">
480 <li class="md-nav__item">
481 <a href="#ft_error" class="md-nav__link">
487 <li class="md-nav__item">
488 <a href="#ft_fixed" class="md-nav__link">
494 <li class="md-nav__item">
495 <a href="#ft_pointer" class="md-nav__link">
501 <li class="md-nav__item">
502 <a href="#ft_pos" class="md-nav__link">
508 <li class="md-nav__item">
509 <a href="#ft_vector" class="md-nav__link">
515 <li class="md-nav__item">
516 <a href="#ft_bbox" class="md-nav__link">
522 <li class="md-nav__item">
523 <a href="#ft_matrix" class="md-nav__link">
529 <li class="md-nav__item">
530 <a href="#ft_fword" class="md-nav__link">
536 <li class="md-nav__item">
537 <a href="#ft_ufword" class="md-nav__link">
543 <li class="md-nav__item">
544 <a href="#ft_f2dot14" class="md-nav__link">
550 <li class="md-nav__item">
551 <a href="#ft_unitvector" class="md-nav__link">
557 <li class="md-nav__item">
558 <a href="#ft_f26dot6" class="md-nav__link">
564 <li class="md-nav__item">
565 <a href="#ft_data" class="md-nav__link">
571 <li class="md-nav__item">
572 <a href="#ft_make_tag" class="md-nav__link">
578 <li class="md-nav__item">
579 <a href="#ft_generic" class="md-nav__link">
585 <li class="md-nav__item">
586 <a href="#ft_generic_finalizer" class="md-nav__link">
592 <li class="md-nav__item">
593 <a href="#ft_bitmap" class="md-nav__link">
599 <li class="md-nav__item">
600 <a href="#ft_pixel_mode" class="md-nav__link">
606 <li class="md-nav__item">
607 <a href="#ft_glyph_format" class="md-nav__link">
613 <li class="md-nav__item">
614 <a href="#ft_image_tag" class="md-nav__link">
632 <li class="md-nav__item">
633 <a href="ft2-library_setup.html" class="md-nav__link">
644 <li class="md-nav__item">
645 <a href="ft2-face_creation.html" class="md-nav__link">
656 <li class="md-nav__item">
657 <a href="ft2-font_testing_macros.html" class="md-nav__link">
668 <li class="md-nav__item">
669 <a href="ft2-sizing_and_scaling.html" class="md-nav__link">
680 <li class="md-nav__item">
681 <a href="ft2-glyph_retrieval.html" class="md-nav__link">
692 <li class="md-nav__item">
693 <a href="ft2-character_mapping.html" class="md-nav__link">
704 <li class="md-nav__item">
705 <a href="ft2-information_retrieval.html" class="md-nav__link">
706 Information Retrieval
716 <li class="md-nav__item">
717 <a href="ft2-other_api_data.html" class="md-nav__link">
738 <li class="md-nav__item md-nav__item--nested">
741 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_5" type="checkbox" id="__nav_5" >
743 <label class="md-nav__link" for="__nav_5">
745 <span class="md-nav__icon md-icon"></span>
747 <nav class="md-nav" aria-label="Extended API" data-md-level="1">
748 <label class="md-nav__title" for="__nav_5">
749 <span class="md-nav__icon md-icon"></span>
752 <ul class="md-nav__list" data-md-scrollfix>
758 <li class="md-nav__item">
759 <a href="ft2-glyph_variants.html" class="md-nav__link">
760 Unicode Variation Sequences
770 <li class="md-nav__item">
771 <a href="ft2-color_management.html" class="md-nav__link">
772 Glyph Color Management
782 <li class="md-nav__item">
783 <a href="ft2-layer_management.html" class="md-nav__link">
784 Glyph Layer Management
794 <li class="md-nav__item">
795 <a href="ft2-glyph_management.html" class="md-nav__link">
806 <li class="md-nav__item">
807 <a href="ft2-mac_specific.html" class="md-nav__link">
808 Mac Specific Interface
818 <li class="md-nav__item">
819 <a href="ft2-sizes_management.html" class="md-nav__link">
830 <li class="md-nav__item">
831 <a href="ft2-header_file_macros.html" class="md-nav__link">
852 <li class="md-nav__item md-nav__item--nested">
855 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_6" type="checkbox" id="__nav_6" >
857 <label class="md-nav__link" for="__nav_6">
859 <span class="md-nav__icon md-icon"></span>
861 <nav class="md-nav" aria-label="Format-Specific API" data-md-level="1">
862 <label class="md-nav__title" for="__nav_6">
863 <span class="md-nav__icon md-icon"></span>
866 <ul class="md-nav__list" data-md-scrollfix>
872 <li class="md-nav__item">
873 <a href="ft2-multiple_masters.html" class="md-nav__link">
884 <li class="md-nav__item">
885 <a href="ft2-truetype_tables.html" class="md-nav__link">
896 <li class="md-nav__item">
897 <a href="ft2-type1_tables.html" class="md-nav__link">
908 <li class="md-nav__item">
909 <a href="ft2-sfnt_names.html" class="md-nav__link">
920 <li class="md-nav__item">
921 <a href="ft2-bdf_fonts.html" class="md-nav__link">
932 <li class="md-nav__item">
933 <a href="ft2-cid_fonts.html" class="md-nav__link">
944 <li class="md-nav__item">
945 <a href="ft2-pfr_fonts.html" class="md-nav__link">
956 <li class="md-nav__item">
957 <a href="ft2-winfnt_fonts.html" class="md-nav__link">
968 <li class="md-nav__item">
969 <a href="ft2-svg_fonts.html" class="md-nav__link">
980 <li class="md-nav__item">
981 <a href="ft2-font_formats.html" class="md-nav__link">
992 <li class="md-nav__item">
993 <a href="ft2-gasp_table.html" class="md-nav__link">
1014 <li class="md-nav__item md-nav__item--nested">
1017 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_7" type="checkbox" id="__nav_7" >
1019 <label class="md-nav__link" for="__nav_7">
1020 Controlling FreeType Modules
1021 <span class="md-nav__icon md-icon"></span>
1023 <nav class="md-nav" aria-label="Controlling FreeType Modules" data-md-level="1">
1024 <label class="md-nav__title" for="__nav_7">
1025 <span class="md-nav__icon md-icon"></span>
1026 Controlling FreeType Modules
1028 <ul class="md-nav__list" data-md-scrollfix>
1034 <li class="md-nav__item">
1035 <a href="ft2-auto_hinter.html" class="md-nav__link">
1046 <li class="md-nav__item">
1047 <a href="ft2-cff_driver.html" class="md-nav__link">
1058 <li class="md-nav__item">
1059 <a href="ft2-t1_cid_driver.html" class="md-nav__link">
1060 The Type 1 and CID drivers
1070 <li class="md-nav__item">
1071 <a href="ft2-tt_driver.html" class="md-nav__link">
1082 <li class="md-nav__item">
1083 <a href="ft2-pcf_driver.html" class="md-nav__link">
1094 <li class="md-nav__item">
1095 <a href="ft2-ot_svg_driver.html" class="md-nav__link">
1106 <li class="md-nav__item">
1107 <a href="ft2-properties.html" class="md-nav__link">
1118 <li class="md-nav__item">
1119 <a href="ft2-parameter_tags.html" class="md-nav__link">
1130 <li class="md-nav__item">
1131 <a href="ft2-lcd_rendering.html" class="md-nav__link">
1152 <li class="md-nav__item md-nav__item--nested">
1155 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_8" type="checkbox" id="__nav_8" >
1157 <label class="md-nav__link" for="__nav_8">
1159 <span class="md-nav__icon md-icon"></span>
1161 <nav class="md-nav" aria-label="Cache Sub-System" data-md-level="1">
1162 <label class="md-nav__title" for="__nav_8">
1163 <span class="md-nav__icon md-icon"></span>
1166 <ul class="md-nav__list" data-md-scrollfix>
1172 <li class="md-nav__item">
1173 <a href="ft2-cache_subsystem.html" class="md-nav__link">
1194 <li class="md-nav__item md-nav__item--nested">
1197 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_9" type="checkbox" id="__nav_9" >
1199 <label class="md-nav__link" for="__nav_9">
1201 <span class="md-nav__icon md-icon"></span>
1203 <nav class="md-nav" aria-label="Support API" data-md-level="1">
1204 <label class="md-nav__title" for="__nav_9">
1205 <span class="md-nav__icon md-icon"></span>
1208 <ul class="md-nav__list" data-md-scrollfix>
1214 <li class="md-nav__item">
1215 <a href="ft2-computations.html" class="md-nav__link">
1226 <li class="md-nav__item">
1227 <a href="ft2-list_processing.html" class="md-nav__link">
1238 <li class="md-nav__item">
1239 <a href="ft2-outline_processing.html" class="md-nav__link">
1250 <li class="md-nav__item">
1251 <a href="ft2-quick_advance.html" class="md-nav__link">
1252 Quick retrieval of advance values
1262 <li class="md-nav__item">
1263 <a href="ft2-bitmap_handling.html" class="md-nav__link">
1274 <li class="md-nav__item">
1275 <a href="ft2-raster.html" class="md-nav__link">
1286 <li class="md-nav__item">
1287 <a href="ft2-glyph_stroker.html" class="md-nav__link">
1298 <li class="md-nav__item">
1299 <a href="ft2-system_interface.html" class="md-nav__link">
1310 <li class="md-nav__item">
1311 <a href="ft2-module_management.html" class="md-nav__link">
1322 <li class="md-nav__item">
1323 <a href="ft2-gzip.html" class="md-nav__link">
1334 <li class="md-nav__item">
1335 <a href="ft2-lzw.html" class="md-nav__link">
1346 <li class="md-nav__item">
1347 <a href="ft2-bzip2.html" class="md-nav__link">
1358 <li class="md-nav__item">
1359 <a href="ft2-debugging_apis.html" class="md-nav__link">
1360 External Debugging APIs
1380 <li class="md-nav__item md-nav__item--nested">
1383 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_10" type="checkbox" id="__nav_10" >
1385 <label class="md-nav__link" for="__nav_10">
1387 <span class="md-nav__icon md-icon"></span>
1389 <nav class="md-nav" aria-label="Error Codes" data-md-level="1">
1390 <label class="md-nav__title" for="__nav_10">
1391 <span class="md-nav__icon md-icon"></span>
1394 <ul class="md-nav__list" data-md-scrollfix>
1400 <li class="md-nav__item">
1401 <a href="ft2-error_enumerations.html" class="md-nav__link">
1412 <li class="md-nav__item">
1413 <a href="ft2-error_code_values.html" class="md-nav__link">
1434 <li class="md-nav__item md-nav__item--nested">
1437 <input class="md-nav__toggle md-toggle" data-md-toggle="__nav_11" type="checkbox" id="__nav_11" >
1439 <label class="md-nav__link" for="__nav_11">
1441 <span class="md-nav__icon md-icon"></span>
1443 <nav class="md-nav" aria-label="Miscellaneous" data-md-level="1">
1444 <label class="md-nav__title" for="__nav_11">
1445 <span class="md-nav__icon md-icon"></span>
1448 <ul class="md-nav__list" data-md-scrollfix>
1454 <li class="md-nav__item">
1455 <a href="ft2-gx_validation.html" class="md-nav__link">
1456 TrueTypeGX/AAT Validation
1466 <li class="md-nav__item">
1467 <a href="ft2-incremental.html" class="md-nav__link">
1478 <li class="md-nav__item">
1479 <a href="ft2-truetype_engine.html" class="md-nav__link">
1490 <li class="md-nav__item">
1491 <a href="ft2-ot_validation.html" class="md-nav__link">
1512 <div class="md-sidebar md-sidebar--secondary" data-md-component="sidebar" data-md-type="toc" >
1513 <div class="md-sidebar__scrollwrap">
1514 <div class="md-sidebar__inner">
1516 <nav class="md-nav md-nav--secondary" aria-label="Table of contents">
1523 <label class="md-nav__title" for="__toc">
1524 <span class="md-nav__icon md-icon"></span>
1527 <ul class="md-nav__list" data-md-component="toc" data-md-scrollfix>
1529 <li class="md-nav__item">
1530 <a href="#synopsis" class="md-nav__link">
1536 <li class="md-nav__item">
1537 <a href="#ft_byte" class="md-nav__link">
1543 <li class="md-nav__item">
1544 <a href="#ft_bytes" class="md-nav__link">
1550 <li class="md-nav__item">
1551 <a href="#ft_char" class="md-nav__link">
1557 <li class="md-nav__item">
1558 <a href="#ft_int" class="md-nav__link">
1564 <li class="md-nav__item">
1565 <a href="#ft_uint" class="md-nav__link">
1571 <li class="md-nav__item">
1572 <a href="#ft_int16" class="md-nav__link">
1578 <li class="md-nav__item">
1579 <a href="#ft_uint16" class="md-nav__link">
1585 <li class="md-nav__item">
1586 <a href="#ft_int32" class="md-nav__link">
1592 <li class="md-nav__item">
1593 <a href="#ft_uint32" class="md-nav__link">
1599 <li class="md-nav__item">
1600 <a href="#ft_int64" class="md-nav__link">
1606 <li class="md-nav__item">
1607 <a href="#ft_uint64" class="md-nav__link">
1613 <li class="md-nav__item">
1614 <a href="#ft_short" class="md-nav__link">
1620 <li class="md-nav__item">
1621 <a href="#ft_ushort" class="md-nav__link">
1627 <li class="md-nav__item">
1628 <a href="#ft_long" class="md-nav__link">
1634 <li class="md-nav__item">
1635 <a href="#ft_ulong" class="md-nav__link">
1641 <li class="md-nav__item">
1642 <a href="#ft_bool" class="md-nav__link">
1648 <li class="md-nav__item">
1649 <a href="#ft_offset" class="md-nav__link">
1655 <li class="md-nav__item">
1656 <a href="#ft_ptrdist" class="md-nav__link">
1662 <li class="md-nav__item">
1663 <a href="#ft_string" class="md-nav__link">
1669 <li class="md-nav__item">
1670 <a href="#ft_tag" class="md-nav__link">
1676 <li class="md-nav__item">
1677 <a href="#ft_error" class="md-nav__link">
1683 <li class="md-nav__item">
1684 <a href="#ft_fixed" class="md-nav__link">
1690 <li class="md-nav__item">
1691 <a href="#ft_pointer" class="md-nav__link">
1697 <li class="md-nav__item">
1698 <a href="#ft_pos" class="md-nav__link">
1704 <li class="md-nav__item">
1705 <a href="#ft_vector" class="md-nav__link">
1711 <li class="md-nav__item">
1712 <a href="#ft_bbox" class="md-nav__link">
1718 <li class="md-nav__item">
1719 <a href="#ft_matrix" class="md-nav__link">
1725 <li class="md-nav__item">
1726 <a href="#ft_fword" class="md-nav__link">
1732 <li class="md-nav__item">
1733 <a href="#ft_ufword" class="md-nav__link">
1739 <li class="md-nav__item">
1740 <a href="#ft_f2dot14" class="md-nav__link">
1746 <li class="md-nav__item">
1747 <a href="#ft_unitvector" class="md-nav__link">
1753 <li class="md-nav__item">
1754 <a href="#ft_f26dot6" class="md-nav__link">
1760 <li class="md-nav__item">
1761 <a href="#ft_data" class="md-nav__link">
1767 <li class="md-nav__item">
1768 <a href="#ft_make_tag" class="md-nav__link">
1774 <li class="md-nav__item">
1775 <a href="#ft_generic" class="md-nav__link">
1781 <li class="md-nav__item">
1782 <a href="#ft_generic_finalizer" class="md-nav__link">
1783 FT_Generic_Finalizer
1788 <li class="md-nav__item">
1789 <a href="#ft_bitmap" class="md-nav__link">
1795 <li class="md-nav__item">
1796 <a href="#ft_pixel_mode" class="md-nav__link">
1802 <li class="md-nav__item">
1803 <a href="#ft_glyph_format" class="md-nav__link">
1809 <li class="md-nav__item">
1810 <a href="#ft_image_tag" class="md-nav__link">
1824 <div class="md-content" data-md-component="content">
1825 <article class="md-content__inner md-typeset">
1829 <p><a href="https://www.freetype.org">FreeType</a> » <a href="../">Docs</a> » <a href="index.html#core-api">Core API</a> » Basic Data Types</p>
1831 <h1 id="basic-data-types">Basic Data Types<a class="headerlink" href="#basic-data-types" title="Permanent link">¶</a></h1>
1832 <h2 id="synopsis">Synopsis<a class="headerlink" href="#synopsis" title="Permanent link">¶</a></h2>
1833 <p>This section contains the basic data types defined by FreeType 2, ranging from simple scalar types to bitmap descriptors. More font-specific structures are defined in a different section. Note that FreeType does not use floating-point data types. Fractional values are represented by fixed-point integers, with lower bits storing the fractional part.</p>
1834 <h2 id="ft_byte">FT_Byte<a class="headerlink" href="#ft_byte" title="Permanent link">¶</a></h2>
1835 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1836 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <b>FT_Byte</b>;
1839 <p>A simple typedef for the <em>unsigned</em> char type.</p>
1842 <h2 id="ft_bytes">FT_Bytes<a class="headerlink" href="#ft_bytes" title="Permanent link">¶</a></h2>
1843 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1844 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">const</span> <a href="ft2-basic_types.html#ft_byte">FT_Byte</a>* <b>FT_Bytes</b>;
1847 <p>A typedef for constant memory areas.</p>
1850 <h2 id="ft_char">FT_Char<a class="headerlink" href="#ft_char" title="Permanent link">¶</a></h2>
1851 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1852 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">char</span> <b>FT_Char</b>;
1855 <p>A simple typedef for the <em>signed</em> char type.</p>
1858 <h2 id="ft_int">FT_Int<a class="headerlink" href="#ft_int" title="Permanent link">¶</a></h2>
1859 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1860 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">int</span> <b>FT_Int</b>;
1863 <p>A typedef for the int type.</p>
1866 <h2 id="ft_uint">FT_UInt<a class="headerlink" href="#ft_uint" title="Permanent link">¶</a></h2>
1867 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1868 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">int</span> <b>FT_UInt</b>;
1871 <p>A typedef for the unsigned int type.</p>
1874 <h2 id="ft_int16">FT_Int16<a class="headerlink" href="#ft_int16" title="Permanent link">¶</a></h2>
1875 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">short</span> <b>FT_Int16</b>;
1878 <p>A typedef for a 16bit signed integer type.</p>
1881 <h2 id="ft_uint16">FT_UInt16<a class="headerlink" href="#ft_uint16" title="Permanent link">¶</a></h2>
1882 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">short</span> <b>FT_UInt16</b>;
1885 <p>A typedef for a 16bit unsigned integer type.</p>
1888 <h2 id="ft_int32">FT_Int32<a class="headerlink" href="#ft_int32" title="Permanent link">¶</a></h2>
1889 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> XXX <b>FT_Int32</b>;
1892 <p>A typedef for a 32bit signed integer type. The size depends on the configuration.</p>
1895 <h2 id="ft_uint32">FT_UInt32<a class="headerlink" href="#ft_uint32" title="Permanent link">¶</a></h2>
1896 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">unsigned</span> XXX <b>FT_UInt32</b>;
1900 <h2 id="ft_int64">FT_Int64<a class="headerlink" href="#ft_int64" title="Permanent link">¶</a></h2>
1901 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> XXX <b>FT_Int64</b>;
1905 <h2 id="ft_uint64">FT_UInt64<a class="headerlink" href="#ft_uint64" title="Permanent link">¶</a></h2>
1906 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">unsigned</span> XXX <b>FT_UInt64</b>;
1910 <h2 id="ft_short">FT_Short<a class="headerlink" href="#ft_short" title="Permanent link">¶</a></h2>
1911 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1912 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">short</span> <b>FT_Short</b>;
1915 <p>A typedef for signed short.</p>
1918 <h2 id="ft_ushort">FT_UShort<a class="headerlink" href="#ft_ushort" title="Permanent link">¶</a></h2>
1919 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1920 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">short</span> <b>FT_UShort</b>;
1923 <p>A typedef for unsigned short.</p>
1926 <h2 id="ft_long">FT_Long<a class="headerlink" href="#ft_long" title="Permanent link">¶</a></h2>
1927 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1928 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">long</span> <b>FT_Long</b>;
1931 <p>A typedef for signed long.</p>
1934 <h2 id="ft_ulong">FT_ULong<a class="headerlink" href="#ft_ulong" title="Permanent link">¶</a></h2>
1935 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1936 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">long</span> <b>FT_ULong</b>;
1939 <p>A typedef for unsigned long.</p>
1942 <h2 id="ft_bool">FT_Bool<a class="headerlink" href="#ft_bool" title="Permanent link">¶</a></h2>
1943 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1944 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">char</span> <b>FT_Bool</b>;
1947 <p>A typedef of unsigned char, used for simple booleans. As usual, values 1 and 0 represent true and false, respectively.</p>
1950 <h2 id="ft_offset">FT_Offset<a class="headerlink" href="#ft_offset" title="Permanent link">¶</a></h2>
1951 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1952 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> size_t <b>FT_Offset</b>;
1955 <p>This is equivalent to the ANSI C <code>size_t</code> type, i.e., the largest <em>unsigned</em> integer type used to express a file size or position, or a memory block size.</p>
1958 <h2 id="ft_ptrdist">FT_PtrDist<a class="headerlink" href="#ft_ptrdist" title="Permanent link">¶</a></h2>
1959 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1960 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> ft_ptrdiff_t <b>FT_PtrDist</b>;
1963 <p>This is equivalent to the ANSI C <code>ptrdiff_t</code> type, i.e., the largest <em>signed</em> integer type used to express the distance between two pointers.</p>
1966 <h2 id="ft_string">FT_String<a class="headerlink" href="#ft_string" title="Permanent link">¶</a></h2>
1967 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1968 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">char</span> <b>FT_String</b>;
1971 <p>A simple typedef for the char type, usually used for strings.</p>
1974 <h2 id="ft_tag">FT_Tag<a class="headerlink" href="#ft_tag" title="Permanent link">¶</a></h2>
1975 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1976 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <a href="ft2-basic_types.html#ft_uint32">FT_UInt32</a> <b>FT_Tag</b>;
1979 <p>A typedef for 32-bit tags (as used in the SFNT format).</p>
1982 <h2 id="ft_error">FT_Error<a class="headerlink" href="#ft_error" title="Permanent link">¶</a></h2>
1983 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1984 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">int</span> <b>FT_Error</b>;
1987 <p>The FreeType error code type. A value of 0 is always interpreted as a successful operation.</p>
1990 <h2 id="ft_fixed">FT_Fixed<a class="headerlink" href="#ft_fixed" title="Permanent link">¶</a></h2>
1991 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
1992 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">long</span> <b>FT_Fixed</b>;
1995 <p>This type is used to store 16.16 fixed-point values, like scaling values or matrix coefficients.</p>
1998 <h2 id="ft_pointer">FT_Pointer<a class="headerlink" href="#ft_pointer" title="Permanent link">¶</a></h2>
1999 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2000 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">void</span>* <b>FT_Pointer</b>;
2003 <p>A simple typedef for a typeless pointer.</p>
2006 <h2 id="ft_pos">FT_Pos<a class="headerlink" href="#ft_pos" title="Permanent link">¶</a></h2>
2007 <p>Defined in FT_IMAGE_H (freetype/ftimage.h).</p>
2008 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">long</span> <b>FT_Pos</b>;
2011 <p>The type FT_Pos is used to store vectorial coordinates. Depending on the context, these can represent distances in integer font units, or 16.16, or 26.6 fixed-point pixel coordinates.</p>
2014 <h2 id="ft_vector">FT_Vector<a class="headerlink" href="#ft_vector" title="Permanent link">¶</a></h2>
2015 <p>Defined in FT_IMAGE_H (freetype/ftimage.h).</p>
2016 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Vector_
2018 <a href="ft2-basic_types.html#ft_pos">FT_Pos</a> x;
2019 <a href="ft2-basic_types.html#ft_pos">FT_Pos</a> y;
2024 <p>A simple structure used to store a 2D vector; coordinates are of the FT_Pos type.</p>
2026 <table class="fields">
2027 <tr><td class="val" id="x">x</td><td class="desc">
2028 <p>The horizontal coordinate.</p>
2030 <tr><td class="val" id="y">y</td><td class="desc">
2031 <p>The vertical coordinate.</p>
2037 <h2 id="ft_bbox">FT_BBox<a class="headerlink" href="#ft_bbox" title="Permanent link">¶</a></h2>
2038 <p>Defined in FT_IMAGE_H (freetype/ftimage.h).</p>
2039 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_BBox_
2041 <a href="ft2-basic_types.html#ft_pos">FT_Pos</a> xMin, yMin;
2042 <a href="ft2-basic_types.html#ft_pos">FT_Pos</a> xMax, yMax;
2047 <p>A structure used to hold an outline's bounding box, i.e., the coordinates of its extrema in the horizontal and vertical directions.</p>
2049 <table class="fields">
2050 <tr><td class="val" id="xmin">xMin</td><td class="desc">
2051 <p>The horizontal minimum (left-most).</p>
2053 <tr><td class="val" id="ymin">yMin</td><td class="desc">
2054 <p>The vertical minimum (bottom-most).</p>
2056 <tr><td class="val" id="xmax">xMax</td><td class="desc">
2057 <p>The horizontal maximum (right-most).</p>
2059 <tr><td class="val" id="ymax">yMax</td><td class="desc">
2060 <p>The vertical maximum (top-most).</p>
2066 <p>The bounding box is specified with the coordinates of the lower left and the upper right corner. In PostScript, those values are often called (llx,lly) and (urx,ury), respectively.</p>
2067 <p>If <code>yMin</code> is negative, this value gives the glyph's descender. Otherwise, the glyph doesn't descend below the baseline. Similarly, if <code>ymax</code> is positive, this value gives the glyph's ascender.</p>
2068 <p><code>xMin</code> gives the horizontal distance from the glyph's origin to the left edge of the glyph's bounding box. If <code>xMin</code> is negative, the glyph extends to the left of the origin.</p>
2071 <h2 id="ft_matrix">FT_Matrix<a class="headerlink" href="#ft_matrix" title="Permanent link">¶</a></h2>
2072 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2073 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Matrix_
2075 <a href="ft2-basic_types.html#ft_fixed">FT_Fixed</a> xx, xy;
2076 <a href="ft2-basic_types.html#ft_fixed">FT_Fixed</a> yx, yy;
2081 <p>A simple structure used to store a 2x2 matrix. Coefficients are in 16.16 fixed-point format. The computation performed is:
2082 <div class="highlight"><pre><span></span><code> x' = x*xx + y*xy
2083 y' = x*yx + y*yy
2084 </code></pre></div></p>
2086 <table class="fields">
2087 <tr><td class="val" id="xx">xx</td><td class="desc">
2088 <p>Matrix coefficient.</p>
2090 <tr><td class="val" id="xy">xy</td><td class="desc">
2091 <p>Matrix coefficient.</p>
2093 <tr><td class="val" id="yx">yx</td><td class="desc">
2094 <p>Matrix coefficient.</p>
2096 <tr><td class="val" id="yy">yy</td><td class="desc">
2097 <p>Matrix coefficient.</p>
2103 <h2 id="ft_fword">FT_FWord<a class="headerlink" href="#ft_fword" title="Permanent link">¶</a></h2>
2104 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2105 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">short</span> <b>FT_FWord</b>; /* distance in FUnits */
2108 <p>A signed 16-bit integer used to store a distance in original font units.</p>
2111 <h2 id="ft_ufword">FT_UFWord<a class="headerlink" href="#ft_ufword" title="Permanent link">¶</a></h2>
2112 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2113 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">unsigned</span> <span class="keyword">short</span> <b>FT_UFWord</b>; /* <span class="keyword">unsigned</span> distance */
2116 <p>An unsigned 16-bit integer used to store a distance in original font units.</p>
2119 <h2 id="ft_f2dot14">FT_F2Dot14<a class="headerlink" href="#ft_f2dot14" title="Permanent link">¶</a></h2>
2120 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2121 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">short</span> <b>FT_F2Dot14</b>;
2124 <p>A signed 2.14 fixed-point type used for unit vectors.</p>
2127 <h2 id="ft_unitvector">FT_UnitVector<a class="headerlink" href="#ft_unitvector" title="Permanent link">¶</a></h2>
2128 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2129 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_UnitVector_
2131 <a href="ft2-basic_types.html#ft_f2dot14">FT_F2Dot14</a> x;
2132 <a href="ft2-basic_types.html#ft_f2dot14">FT_F2Dot14</a> y;
2134 } <b>FT_UnitVector</b>;
2137 <p>A simple structure used to store a 2D vector unit vector. Uses FT_F2Dot14 types.</p>
2139 <table class="fields">
2140 <tr><td class="val" id="x">x</td><td class="desc">
2141 <p>Horizontal coordinate.</p>
2143 <tr><td class="val" id="y">y</td><td class="desc">
2144 <p>Vertical coordinate.</p>
2150 <h2 id="ft_f26dot6">FT_F26Dot6<a class="headerlink" href="#ft_f26dot6" title="Permanent link">¶</a></h2>
2151 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2152 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">signed</span> <span class="keyword">long</span> <b>FT_F26Dot6</b>;
2155 <p>A signed 26.6 fixed-point type used for vectorial pixel coordinates.</p>
2158 <h2 id="ft_data">FT_Data<a class="headerlink" href="#ft_data" title="Permanent link">¶</a></h2>
2159 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2160 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Data_
2162 <span class="keyword">const</span> <a href="ft2-basic_types.html#ft_byte">FT_Byte</a>* pointer;
2163 <a href="ft2-basic_types.html#ft_uint">FT_UInt</a> length;
2168 <p>Read-only binary data represented as a pointer and a length.</p>
2170 <table class="fields">
2171 <tr><td class="val" id="pointer">pointer</td><td class="desc">
2174 <tr><td class="val" id="length">length</td><td class="desc">
2175 <p>The length of the data in bytes.</p>
2181 <h2 id="ft_make_tag">FT_MAKE_TAG<a class="headerlink" href="#ft_make_tag" title="Permanent link">¶</a></h2>
2182 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2183 <div class = "codehilite"><pre><code>#<span class="keyword">define</span> <b>FT_MAKE_TAG</b>( _x1, _x2, _x3, _x4 ) \
2184 ( ( FT_STATIC_BYTE_CAST( <a href="ft2-basic_types.html#ft_tag">FT_Tag</a>, _x1 ) << 24 ) | \
2185 ( FT_STATIC_BYTE_CAST( <a href="ft2-basic_types.html#ft_tag">FT_Tag</a>, _x2 ) << 16 ) | \
2186 ( FT_STATIC_BYTE_CAST( <a href="ft2-basic_types.html#ft_tag">FT_Tag</a>, _x3 ) << 8 ) | \
2187 FT_STATIC_BYTE_CAST( <a href="ft2-basic_types.html#ft_tag">FT_Tag</a>, _x4 ) )
2190 <p>This macro converts four-letter tags that are used to label TrueType tables into an <code>FT_Tag</code> type, to be used within FreeType.</p>
2193 <p>The produced values <strong>must</strong> be 32-bit integers. Don't redefine this macro.</p>
2196 <h2 id="ft_generic">FT_Generic<a class="headerlink" href="#ft_generic" title="Permanent link">¶</a></h2>
2197 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2198 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Generic_
2200 <span class="keyword">void</span>* data;
2201 <a href="ft2-basic_types.html#ft_generic_finalizer">FT_Generic_Finalizer</a> finalizer;
2203 } <b>FT_Generic</b>;
2206 <p>Client applications often need to associate their own data to a variety of FreeType core objects. For example, a text layout API might want to associate a glyph cache to a given size object.</p>
2207 <p>Some FreeType object contains a <code>generic</code> field, of type <code>FT_Generic</code>, which usage is left to client applications and font servers.</p>
2208 <p>It can be used to store a pointer to client-specific data, as well as the address of a ‘finalizer’ function, which will be called by FreeType when the object is destroyed (for example, the previous client example would put the address of the glyph cache destructor in the <code>finalizer</code> field).</p>
2210 <table class="fields">
2211 <tr><td class="val" id="data">data</td><td class="desc">
2212 <p>A typeless pointer to any client-specified data. This field is completely ignored by the FreeType library.</p>
2214 <tr><td class="val" id="finalizer">finalizer</td><td class="desc">
2215 <p>A pointer to a ‘generic finalizer’ function, which will be called when the object is destroyed. If this field is set to <code>NULL</code>, no code will be called.</p>
2221 <h2 id="ft_generic_finalizer">FT_Generic_Finalizer<a class="headerlink" href="#ft_generic_finalizer" title="Permanent link">¶</a></h2>
2222 <p>Defined in FT_TYPES_H (freetype/fttypes.h).</p>
2223 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">void</span> (*<b>FT_Generic_Finalizer</b>)( <span class="keyword">void</span>* object );
2226 <p>Describe a function used to destroy the ‘client’ data of any FreeType object. See the description of the <code><a href="ft2-basic_types.html#ft_generic">FT_Generic</a></code> type for details of usage.</p>
2229 <p>The address of the FreeType object that is under finalization. Its client data is accessed through its <code>generic</code> field.</p>
2232 <h2 id="ft_bitmap">FT_Bitmap<a class="headerlink" href="#ft_bitmap" title="Permanent link">¶</a></h2>
2233 <p>Defined in FT_IMAGE_H (freetype/ftimage.h).</p>
2234 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Bitmap_
2236 <span class="keyword">unsigned</span> <span class="keyword">int</span> rows;
2237 <span class="keyword">unsigned</span> <span class="keyword">int</span> width;
2238 <span class="keyword">int</span> pitch;
2239 <span class="keyword">unsigned</span> <span class="keyword">char</span>* buffer;
2240 <span class="keyword">unsigned</span> <span class="keyword">short</span> num_grays;
2241 <span class="keyword">unsigned</span> <span class="keyword">char</span> pixel_mode;
2242 <span class="keyword">unsigned</span> <span class="keyword">char</span> palette_mode;
2243 <span class="keyword">void</span>* palette;
2248 <p>A structure used to describe a bitmap or pixmap to the raster. Note that we now manage pixmaps of various depths through the <code>pixel_mode</code> field.</p>
2250 <table class="fields">
2251 <tr><td class="val" id="rows">rows</td><td class="desc">
2252 <p>The number of bitmap rows.</p>
2254 <tr><td class="val" id="width">width</td><td class="desc">
2255 <p>The number of pixels in bitmap row.</p>
2257 <tr><td class="val" id="pitch">pitch</td><td class="desc">
2258 <p>The pitch's absolute value is the number of bytes taken by one bitmap row, including padding. However, the pitch is positive when the bitmap has a ‘down’ flow, and negative when it has an ‘up’ flow. In all cases, the pitch is an offset to add to a bitmap pointer in order to go down one row.</p>
2259 <p>Note that ‘padding’ means the alignment of a bitmap to a byte border, and FreeType functions normally align to the smallest possible integer value.</p>
2260 <p>For the B/W rasterizer, <code>pitch</code> is always an even number.</p>
2261 <p>To change the pitch of a bitmap (say, to make it a multiple of 4), use <code><a href="ft2-bitmap_handling.html#ft_bitmap_convert">FT_Bitmap_Convert</a></code>. Alternatively, you might use callback functions to directly render to the application's surface; see the file <code>example2.cpp</code> in the tutorial for a demonstration.</p>
2263 <tr><td class="val" id="buffer">buffer</td><td class="desc">
2264 <p>A typeless pointer to the bitmap buffer. This value should be aligned on 32-bit boundaries in most cases.</p>
2266 <tr><td class="val" id="num_grays">num_grays</td><td class="desc">
2267 <p>This field is only used with <code><a href="ft2-basic_types.html#ft_pixel_mode">FT_PIXEL_MODE_GRAY</a></code>; it gives the number of gray levels used in the bitmap.</p>
2269 <tr><td class="val" id="pixel_mode">pixel_mode</td><td class="desc">
2270 <p>The pixel mode, i.e., how pixel bits are stored. See <code><a href="ft2-basic_types.html#ft_pixel_mode">FT_Pixel_Mode</a></code> for possible values.</p>
2272 <tr><td class="val" id="palette_mode">palette_mode</td><td class="desc">
2273 <p>This field is intended for paletted pixel modes; it indicates how the palette is stored. Not used currently.</p>
2275 <tr><td class="val" id="palette">palette</td><td class="desc">
2276 <p>A typeless pointer to the bitmap palette; this field is intended for paletted pixel modes. Not used currently.</p>
2282 <p><code>width</code> and <code>rows</code> refer to the <em>physical</em> size of the bitmap, not the <em>logical</em> one. For example, if <code><a href="ft2-basic_types.html#ft_pixel_mode">FT_Pixel_Mode</a></code> is set to <code>FT_PIXEL_MODE_LCD</code>, the logical width is a just a third of the physical one.</p>
2285 <h2 id="ft_pixel_mode">FT_Pixel_Mode<a class="headerlink" href="#ft_pixel_mode" title="Permanent link">¶</a></h2>
2286 <p>Defined in FT_IMAGE_H (freetype/ftimage.h).</p>
2287 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">enum</span> FT_Pixel_Mode_
2289 <a href="ft2-basic_types.html#ft_pixel_mode_none">FT_PIXEL_MODE_NONE</a> = 0,
2290 <a href="ft2-basic_types.html#ft_pixel_mode_mono">FT_PIXEL_MODE_MONO</a>,
2291 <a href="ft2-basic_types.html#ft_pixel_mode_gray">FT_PIXEL_MODE_GRAY</a>,
2292 <a href="ft2-basic_types.html#ft_pixel_mode_gray2">FT_PIXEL_MODE_GRAY2</a>,
2293 <a href="ft2-basic_types.html#ft_pixel_mode_gray4">FT_PIXEL_MODE_GRAY4</a>,
2294 <a href="ft2-basic_types.html#ft_pixel_mode_lcd">FT_PIXEL_MODE_LCD</a>,
2295 <a href="ft2-basic_types.html#ft_pixel_mode_lcd_v">FT_PIXEL_MODE_LCD_V</a>,
2296 <a href="ft2-basic_types.html#ft_pixel_mode_bgra">FT_PIXEL_MODE_BGRA</a>,
2298 FT_PIXEL_MODE_MAX /* do not remove */
2300 } <b>FT_Pixel_Mode</b>;
2303 /* these constants are deprecated; use the corresponding `<b>FT_Pixel_Mode</b>` */
2304 /* values instead. */
2305 #<span class="keyword">define</span> ft_pixel_mode_none <a href="ft2-basic_types.html#ft_pixel_mode_none">FT_PIXEL_MODE_NONE</a>
2306 #<span class="keyword">define</span> ft_pixel_mode_mono <a href="ft2-basic_types.html#ft_pixel_mode_mono">FT_PIXEL_MODE_MONO</a>
2307 #<span class="keyword">define</span> ft_pixel_mode_grays <a href="ft2-basic_types.html#ft_pixel_mode_gray">FT_PIXEL_MODE_GRAY</a>
2308 #<span class="keyword">define</span> ft_pixel_mode_pal2 <a href="ft2-basic_types.html#ft_pixel_mode_gray2">FT_PIXEL_MODE_GRAY2</a>
2309 #<span class="keyword">define</span> ft_pixel_mode_pal4 <a href="ft2-basic_types.html#ft_pixel_mode_gray4">FT_PIXEL_MODE_GRAY4</a>
2312 <p>An enumeration type used to describe the format of pixels in a given bitmap. Note that additional formats may be added in the future.</p>
2314 <table class="fields">
2315 <tr><td class="val" id="ft_pixel_mode_none">FT_PIXEL_MODE_NONE</td><td class="desc">
2316 <p>Value 0 is reserved.</p>
2318 <tr><td class="val" id="ft_pixel_mode_mono">FT_PIXEL_MODE_MONO</td><td class="desc">
2319 <p>A monochrome bitmap, using 1 bit per pixel. Note that pixels are stored in most-significant order (MSB), which means that the left-most pixel in a byte has value 128.</p>
2321 <tr><td class="val" id="ft_pixel_mode_gray">FT_PIXEL_MODE_GRAY</td><td class="desc">
2322 <p>An 8-bit bitmap, generally used to represent anti-aliased glyph images. Each pixel is stored in one byte. Note that the number of ‘gray’ levels is stored in the <code>num_grays</code> field of the <code><a href="ft2-basic_types.html#ft_bitmap">FT_Bitmap</a></code> structure (it generally is 256).</p>
2324 <tr><td class="val" id="ft_pixel_mode_gray2">FT_PIXEL_MODE_GRAY2</td><td class="desc">
2325 <p>A 2-bit per pixel bitmap, used to represent embedded anti-aliased bitmaps in font files according to the OpenType specification. We haven't found a single font using this format, however.</p>
2327 <tr><td class="val" id="ft_pixel_mode_gray4">FT_PIXEL_MODE_GRAY4</td><td class="desc">
2328 <p>A 4-bit per pixel bitmap, representing embedded anti-aliased bitmaps in font files according to the OpenType specification. We haven't found a single font using this format, however.</p>
2330 <tr><td class="val" id="ft_pixel_mode_lcd">FT_PIXEL_MODE_LCD</td><td class="desc">
2331 <p>An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on LCD displays; the bitmap is three times wider than the original glyph image. See also <code><a href="ft2-glyph_retrieval.html#ft_render_mode">FT_RENDER_MODE_LCD</a></code>.</p>
2333 <tr><td class="val" id="ft_pixel_mode_lcd_v">FT_PIXEL_MODE_LCD_V</td><td class="desc">
2334 <p>An 8-bit bitmap, representing RGB or BGR decimated glyph images used for display on rotated LCD displays; the bitmap is three times taller than the original glyph image. See also <code><a href="ft2-glyph_retrieval.html#ft_render_mode">FT_RENDER_MODE_LCD_V</a></code>.</p>
2336 <tr><td class="val" id="ft_pixel_mode_bgra">FT_PIXEL_MODE_BGRA</td><td class="desc">
2337 <p>[Since 2.5] An image with four 8-bit channels per pixel, representing a color image (such as emoticons) with alpha channel. For each pixel, the format is BGRA, which means, the blue channel comes first in memory. The color channels are pre-multiplied and in the sRGB colorspace. For example, full red at half-translucent opacity will be represented as ‘00,00,80,80’, not ‘00,00,FF,80’. See also <code><a href="ft2-glyph_retrieval.html#ft_load_xxx">FT_LOAD_COLOR</a></code>.</p>
2343 <h2 id="ft_glyph_format">FT_Glyph_Format<a class="headerlink" href="#ft_glyph_format" title="Permanent link">¶</a></h2>
2344 <p>Defined in FT_IMAGE_H (freetype/ftimage.h).</p>
2345 <div class = "codehilite"><pre><code> <span class="keyword">typedef</span> <span class="keyword">enum</span> FT_Glyph_Format_
2347 <a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_none">FT_GLYPH_FORMAT_NONE</a>, 0, 0, 0, 0 ),
2349 <a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_composite">FT_GLYPH_FORMAT_COMPOSITE</a>, 'c', 'o', 'm', 'p' ),
2350 <a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_bitmap">FT_GLYPH_FORMAT_BITMAP</a>, 'b', 'i', 't', 's' ),
2351 <a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_outline">FT_GLYPH_FORMAT_OUTLINE</a>, 'o', 'u', 't', 'l' ),
2352 <a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_plotter">FT_GLYPH_FORMAT_PLOTTER</a>, 'p', 'l', 'o', 't' ),
2353 <a href="ft2-basic_types.html#ft_image_tag">FT_IMAGE_TAG</a>( <a href="ft2-basic_types.html#ft_glyph_format_svg">FT_GLYPH_FORMAT_SVG</a>, 'S', 'V', 'G', ' ' )
2355 } <b>FT_Glyph_Format</b>;
2358 /* these constants are deprecated; use the corresponding */
2359 /* `<b>FT_Glyph_Format</b>` values instead. */
2360 #<span class="keyword">define</span> ft_glyph_format_none <a href="ft2-basic_types.html#ft_glyph_format_none">FT_GLYPH_FORMAT_NONE</a>
2361 #<span class="keyword">define</span> ft_glyph_format_composite <a href="ft2-basic_types.html#ft_glyph_format_composite">FT_GLYPH_FORMAT_COMPOSITE</a>
2362 #<span class="keyword">define</span> ft_glyph_format_bitmap <a href="ft2-basic_types.html#ft_glyph_format_bitmap">FT_GLYPH_FORMAT_BITMAP</a>
2363 #<span class="keyword">define</span> ft_glyph_format_outline <a href="ft2-basic_types.html#ft_glyph_format_outline">FT_GLYPH_FORMAT_OUTLINE</a>
2364 #<span class="keyword">define</span> ft_glyph_format_plotter <a href="ft2-basic_types.html#ft_glyph_format_plotter">FT_GLYPH_FORMAT_PLOTTER</a>
2367 <p>An enumeration type used to describe the format of a given glyph image. Note that this version of FreeType only supports two image formats, even though future font drivers will be able to register their own format.</p>
2369 <table class="fields">
2370 <tr><td class="val" id="ft_glyph_format_none">FT_GLYPH_FORMAT_NONE</td><td class="desc">
2371 <p>The value 0 is reserved.</p>
2373 <tr><td class="val" id="ft_glyph_format_composite">FT_GLYPH_FORMAT_COMPOSITE</td><td class="desc">
2374 <p>The glyph image is a composite of several other images. This format is <em>only</em> used with <code><a href="ft2-glyph_retrieval.html#ft_load_xxx">FT_LOAD_NO_RECURSE</a></code>, and is used to report compound glyphs (like accented characters).</p>
2376 <tr><td class="val" id="ft_glyph_format_bitmap">FT_GLYPH_FORMAT_BITMAP</td><td class="desc">
2377 <p>The glyph image is a bitmap, and can be described as an <code><a href="ft2-basic_types.html#ft_bitmap">FT_Bitmap</a></code>. You generally need to access the <code>bitmap</code> field of the <code><a href="ft2-glyph_retrieval.html#ft_glyphslotrec">FT_GlyphSlotRec</a></code> structure to read it.</p>
2379 <tr><td class="val" id="ft_glyph_format_outline">FT_GLYPH_FORMAT_OUTLINE</td><td class="desc">
2380 <p>The glyph image is a vectorial outline made of line segments and Bezier arcs; it can be described as an <code><a href="ft2-outline_processing.html#ft_outline">FT_Outline</a></code>; you generally want to access the <code>outline</code> field of the <code><a href="ft2-glyph_retrieval.html#ft_glyphslotrec">FT_GlyphSlotRec</a></code> structure to read it.</p>
2382 <tr><td class="val" id="ft_glyph_format_plotter">FT_GLYPH_FORMAT_PLOTTER</td><td class="desc">
2383 <p>The glyph image is a vectorial path with no inside and outside contours. Some Type 1 fonts, like those in the Hershey family, contain glyphs in this format. These are described as <code><a href="ft2-outline_processing.html#ft_outline">FT_Outline</a></code>, but FreeType isn't currently capable of rendering them correctly.</p>
2385 <tr><td class="val" id="ft_glyph_format_svg">FT_GLYPH_FORMAT_SVG</td><td class="desc">
2386 <p>[Since 2.12] The glyph is represented by an SVG document in the ‘SVG ’ table.</p>
2392 <h2 id="ft_image_tag">FT_IMAGE_TAG<a class="headerlink" href="#ft_image_tag" title="Permanent link">¶</a></h2>
2393 <p>Defined in FT_IMAGE_H (freetype/ftimage.h).</p>
2394 <div class = "codehilite"><pre><code>#<span class="keyword">ifndef</span> <b>FT_IMAGE_TAG</b>
2396 #<span class="keyword">define</span> <b>FT_IMAGE_TAG</b>( value, _x1, _x2, _x3, _x4 ) \
2397 value = ( ( FT_STATIC_BYTE_CAST( <span class="keyword">unsigned</span> <span class="keyword">long</span>, _x1 ) << 24 ) | \
2398 ( FT_STATIC_BYTE_CAST( <span class="keyword">unsigned</span> <span class="keyword">long</span>, _x2 ) << 16 ) | \
2399 ( FT_STATIC_BYTE_CAST( <span class="keyword">unsigned</span> <span class="keyword">long</span>, _x3 ) << 8 ) | \
2400 FT_STATIC_BYTE_CAST( <span class="keyword">unsigned</span> <span class="keyword">long</span>, _x4 ) )
2402 #<span class="keyword">endif</span> /* <b>FT_IMAGE_TAG</b> */
2405 <p>This macro converts four-letter tags to an unsigned long type.</p>
2408 <p>Since many 16-bit compilers don't like 32-bit enumerations, you should redefine this macro in case of problems to something like this:
2409 <div class="highlight"><pre><span></span><code> #define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) value
2410 </code></pre></div></p>
2411 <p>to get a simple enumeration without assigning special numbers.</p>
2427 <footer class="md-footer">
2429 <nav class="md-footer__inner md-grid" aria-label="Footer">
2432 <a href="ft2-user_allocation.html" class="md-footer__link md-footer__link--prev" aria-label="Previous: User allocation" rel="prev">
2433 <div class="md-footer__button md-icon">
2434 <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>
2436 <div class="md-footer__title">
2437 <div class="md-ellipsis">
2438 <span class="md-footer__direction">
2448 <a href="ft2-library_setup.html" class="md-footer__link md-footer__link--next" aria-label="Next: Library Setup" rel="next">
2449 <div class="md-footer__title">
2450 <div class="md-ellipsis">
2451 <span class="md-footer__direction">
2457 <div class="md-footer__button md-icon">
2458 <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>
2464 <div class="md-footer-meta md-typeset">
2465 <div class="md-footer-meta__inner md-grid">
2466 <div class="md-footer-copyright">
2468 <div class="md-footer-copyright__highlight">
2469 Copyright 2023 <a href = "https://www.freetype.org/license.html">The FreeType Project</a>.
2473 <a href="https://squidfunk.github.io/mkdocs-material/" target="_blank" rel="noopener">
2484 <div class="md-dialog" data-md-component="dialog">
2485 <div class="md-dialog__inner md-typeset"></div>
2487 <script id="__config" type="application/json">{"base": ".", "features": [], "search": "assets/javascripts/workers/search.477d984a.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "trimmer, stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}, "version": null}</script>
2490 <script src="assets/javascripts/bundle.82b56eb2.min.js"></script>
2492 <script src="javascripts/extra.js"></script>