diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2018-11-19 12:36:56 -0500 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2018-11-19 12:36:56 -0500 |
commit | 1a2eb108b857de9c5e84cc5de0c12c7657e04498 (patch) | |
tree | 09a32db4ddc37f60813f4db9d0c76e5ef987079c | |
parent | bd6b2ba1d3910cc259db7abeb6c9bd7ed9494857 (diff) |
[ot-var] Add hb_ot_var_axis_get_flags()
Part of https://github.com/harfbuzz/harfbuzz/issues/1241
New API:
+hb_ot_var_axis_flags_t
+hb_ot_var_axis_get_flags
-rw-r--r-- | docs/harfbuzz-sections.txt | 2 | ||||
-rw-r--r-- | src/hb-buffer.h | 2 | ||||
-rw-r--r-- | src/hb-ot-var-fvar-table.hh | 9 | ||||
-rw-r--r-- | src/hb-ot-var.cc | 12 | ||||
-rw-r--r-- | src/hb-ot-var.h | 13 |
5 files changed, 38 insertions, 0 deletions
diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index 6a498e94..63594cfc 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -587,6 +587,8 @@ hb_ot_var_has_data hb_ot_var_find_axis hb_ot_var_get_axis_count hb_ot_var_get_axes +hb_ot_var_axis_flags_t +hb_ot_var_axis_get_flags hb_ot_var_normalize_variations hb_ot_var_normalize_coords </SECTION> diff --git a/src/hb-buffer.h b/src/hb-buffer.h index 99e01716..f989d25d 100644 --- a/src/hb-buffer.h +++ b/src/hb-buffer.h @@ -90,6 +90,8 @@ typedef struct hb_glyph_info_t * the reshaping to a small piece around the * breaking point only. * @HB_GLYPH_FLAG_DEFINED: All the currently defined flags. + * + * Since: 1.5.0 */ typedef enum { /*< flags >*/ HB_GLYPH_FLAG_UNSAFE_TO_BREAK = 0x00000001, diff --git a/src/hb-ot-var-fvar-table.hh b/src/hb-ot-var-fvar-table.hh index 659eb1b6..3c8a3da4 100644 --- a/src/hb-ot-var-fvar-table.hh +++ b/src/hb-ot-var-fvar-table.hh @@ -131,6 +131,15 @@ struct fvar return true; } + inline hb_ot_var_axis_flags_t get_axis_flags (unsigned int index) const + { + if (unlikely (index >= axisCount)) + return (hb_ot_var_axis_flags_t) 0; + + const AxisRecord &axis = get_axes ()[index]; + return (hb_ot_var_axis_flags_t) (unsigned int) axis.flags; + } + inline unsigned int get_axis_infos (unsigned int start_offset, unsigned int *axes_count /* IN/OUT */, hb_ot_var_axis_t *axes_array /* OUT */) const diff --git a/src/hb-ot-var.cc b/src/hb-ot-var.cc index c97e9c49..14c73cfd 100644 --- a/src/hb-ot-var.cc +++ b/src/hb-ot-var.cc @@ -104,6 +104,18 @@ hb_ot_var_find_axis (hb_face_t *face, return face->table.fvar->find_axis (axis_tag, axis_index, axis_info); } +/** + * hb_ot_var_axis_get_flags: + * + * Since: REPLACEME + **/ +hb_ot_var_axis_flags_t +hb_ot_var_axis_get_flags (hb_face_t *face, + unsigned int axis_index) +{ + return face->table.fvar->get_axis_flags (axis_index); +} + /** * hb_ot_var_normalize_variations: diff --git a/src/hb-ot-var.h b/src/hb-ot-var.h index 0c0f61dd..d535a078 100644 --- a/src/hb-ot-var.h +++ b/src/hb-ot-var.h @@ -85,6 +85,19 @@ hb_ot_var_find_axis (hb_face_t *face, unsigned int *axis_index, hb_ot_var_axis_t *axis_info); +/** + * hb_ot_var_axis_flags_t: + * @HB_OT_VAR_AXIS_FLAG_HIDDEN: The axis should not be exposed directly in user interfaces. + * + * Since: REPLACEME + */ +typedef enum { /*< flags >*/ + HB_OT_VAR_AXIS_FLAG_HIDDEN = 0x0001u, +} hb_ot_var_axis_flags_t; + +HB_EXTERN hb_ot_var_axis_flags_t +hb_ot_var_axis_get_flags (hb_face_t *face, + unsigned int axis_index); HB_EXTERN void hb_ot_var_normalize_variations (hb_face_t *face, |