Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
hb-ot-var.h
Go to the documentation of this file.
1/*
2 * Copyright © 2017 Google, Inc.
3 *
4 * This is part of HarfBuzz, a text shaping library.
5 *
6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software.
11 *
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
16 * DAMAGE.
17 *
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
23 *
24 * Red Hat Author(s): Behdad Esfahbod
25 */
26
27#if !defined(HB_OT_H_IN) && !defined(HB_NO_SINGLE_HEADER_ERROR)
28#error "Include <hb-ot.h> instead."
29#endif
30
31#ifndef HB_OT_VAR_H
32#define HB_OT_VAR_H
33
34#include "hb.h"
35
37
38/**
39 * HB_OT_TAG_VAR_AXIS_ITALIC:
40 *
41 * Registered tag for the roman/italic axis.
42 */
43#define HB_OT_TAG_VAR_AXIS_ITALIC HB_TAG('i','t','a','l')
44
45/**
46 * HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE:
47 *
48 * Registered tag for the optical-size axis.
49 * <note>Note: The optical-size axis supersedes the OpenType `size` feature.</note>
50 */
51#define HB_OT_TAG_VAR_AXIS_OPTICAL_SIZE HB_TAG('o','p','s','z')
52
53/**
54 * HB_OT_TAG_VAR_AXIS_SLANT:
55 *
56 * Registered tag for the slant axis
57 */
58#define HB_OT_TAG_VAR_AXIS_SLANT HB_TAG('s','l','n','t')
59
60/**
61 * HB_OT_TAG_VAR_AXIS_WIDTH:
62 *
63 * Registered tag for the width axis.
64 */
65#define HB_OT_TAG_VAR_AXIS_WIDTH HB_TAG('w','d','t','h')
66
67/**
68 * HB_OT_TAG_VAR_AXIS_WEIGHT:
69 *
70 * Registered tag for the weight axis.
71 */
72#define HB_OT_TAG_VAR_AXIS_WEIGHT HB_TAG('w','g','h','t')
73
74
75/*
76 * fvar / avar
77 */
78
81
82
83/*
84 * Variation axes.
85 */
86
87
88HB_EXTERN unsigned int
90
91/**
92 * hb_ot_var_axis_flags_t:
93 * @HB_OT_VAR_AXIS_FLAG_HIDDEN: The axis should not be exposed directly in user interfaces.
94 *
95 * Flags for #hb_ot_var_axis_info_t.
96 *
97 * Since: 2.2.0
98 */
99typedef enum { /*< flags >*/
101
102 /*< private >*/
105
106/**
107 * hb_ot_var_axis_info_t:
108 * @axis_index: Index of the axis in the variation-axis array
109 * @tag: The #hb_tag_t tag identifying the design variation of the axis
110 * @name_id: The `name` table Name ID that provides display names for the axis
111 * @flags: The #hb_ot_var_axis_flags_t flags for the axis
112 * @min_value: The minimum value on the variation axis that the font covers
113 * @default_value: The position on the variation axis corresponding to the font's defaults
114 * @max_value: The maximum value on the variation axis that the font covers
115 *
116 * Data type for holding variation-axis values.
117 *
118 * The minimum, default, and maximum values are in un-normalized, user scales.
119 *
120 * <note>Note: at present, the only flag defined for @flags is
121 * #HB_OT_VAR_AXIS_FLAG_HIDDEN.</note>
122 *
123 * Since: 2.2.0
124 */
136
137HB_EXTERN unsigned int
139 unsigned int start_offset,
140 unsigned int *axes_count /* IN/OUT */,
141 hb_ot_var_axis_info_t *axes_array /* OUT */);
142
145 hb_tag_t axis_tag,
146 hb_ot_var_axis_info_t *axis_info);
147
148
149/*
150 * Named instances.
151 */
152
153HB_EXTERN unsigned int
155
158 unsigned int instance_index);
159
162 unsigned int instance_index);
163
164HB_EXTERN unsigned int
166 unsigned int instance_index,
167 unsigned int *coords_length, /* IN/OUT */
168 float *coords /* OUT */);
169
170
171/*
172 * Conversions.
173 */
174
175HB_EXTERN void
177 const hb_variation_t *variations, /* IN */
178 unsigned int variations_length,
179 int *coords, /* OUT */
180 unsigned int coords_length);
181
182HB_EXTERN void
184 unsigned int coords_length,
185 const float *design_coords, /* IN */
186 int *normalized_coords /* OUT */);
187
188
190
191#endif /* HB_OT_VAR_H */
HB_BEGIN_DECLS typedef int hb_bool_t
Definition hb-common.h:94
#define HB_TAG_MAX_SIGNED
Definition hb-common.h:210
#define HB_BEGIN_DECLS
Definition hb-common.h:45
uint32_t hb_tag_t
Definition hb-common.h:164
#define HB_END_DECLS
Definition hb-common.h:46
#define HB_EXTERN
Definition hb-common.h:37
struct hb_face_t hb_face_t
Definition hb-face.h:56
unsigned int hb_ot_name_id_t
Definition hb-ot-name.h:115
HB_EXTERN unsigned int hb_ot_var_get_axis_infos(hb_face_t *face, unsigned int start_offset, unsigned int *axes_count, hb_ot_var_axis_info_t *axes_array)
HB_EXTERN unsigned int hb_ot_var_get_named_instance_count(hb_face_t *face)
hb_ot_var_axis_flags_t
Definition hb-ot-var.h:99
@ _HB_OT_VAR_AXIS_FLAG_MAX_VALUE
Definition hb-ot-var.h:103
@ HB_OT_VAR_AXIS_FLAG_HIDDEN
Definition hb-ot-var.h:100
HB_EXTERN void hb_ot_var_normalize_coords(hb_face_t *face, unsigned int coords_length, const float *design_coords, int *normalized_coords)
HB_EXTERN hb_ot_name_id_t hb_ot_var_named_instance_get_postscript_name_id(hb_face_t *face, unsigned int instance_index)
struct hb_ot_var_axis_info_t hb_ot_var_axis_info_t
HB_EXTERN void hb_ot_var_normalize_variations(hb_face_t *face, const hb_variation_t *variations, unsigned int variations_length, int *coords, unsigned int coords_length)
HB_EXTERN unsigned int hb_ot_var_named_instance_get_design_coords(hb_face_t *face, unsigned int instance_index, unsigned int *coords_length, float *coords)
HB_EXTERN unsigned int hb_ot_var_get_axis_count(hb_face_t *face)
HB_EXTERN hb_bool_t hb_ot_var_has_data(hb_face_t *face)
HB_EXTERN hb_ot_name_id_t hb_ot_var_named_instance_get_subfamily_name_id(hb_face_t *face, unsigned int instance_index)
HB_EXTERN hb_bool_t hb_ot_var_find_axis_info(hb_face_t *face, hb_tag_t axis_tag, hb_ot_var_axis_info_t *axis_info)
unsigned int axis_index
Definition hb-ot-var.h:126
hb_ot_var_axis_flags_t flags
Definition hb-ot-var.h:129
unsigned int reserved
Definition hb-ot-var.h:134
hb_ot_name_id_t name_id
Definition hb-ot-var.h:128