docs/harfbuzz-sections.txt | 2 ++ src/hb-common.cc | 4 ++-- src/hb-common.h | 13 +++++++++++++ src/hb-dsalgs.hh | 20 ++++++++++++++++++++ src/hb-open-type.hh | 1 - 5 files changed, 37 insertions(+), 3 deletions(-)
New commits: commit becd84aa2f2902ea9d2d1677b28945e103a68816 Author: Behdad Esfahbod <beh...@behdad.org> Date: Tue Sep 11 01:26:18 2018 +0200 Add HB_FEATURE_GLOBAL_START/END Fixes https://github.com/harfbuzz/harfbuzz/issues/1141 New API: HB_FEATURE_GLOBAL_START HB_FEATURE_GLOBAL_END diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index ca0e908f..b69c1686 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -582,6 +582,8 @@ hb_set_union <SECTION> <FILE>hb-shape</FILE> +HB_FEATURE_GLOBAL_END +HB_FEATURE_GLOBAL_START hb_feature_t hb_feature_from_string hb_feature_to_string diff --git a/src/hb-common.cc b/src/hb-common.cc index ed3fed2a..c1651232 100644 --- a/src/hb-common.cc +++ b/src/hb-common.cc @@ -877,8 +877,8 @@ parse_feature_indices (const char **pp, const char *end, hb_feature_t *feature) bool has_start; - feature->start = 0; - feature->end = (unsigned int) -1; + feature->start = HB_FEATURE_GLOBAL_START; + feature->end = HB_FEATURE_GLOBAL_END; if (!parse_char (pp, end, '[')) return true; diff --git a/src/hb-common.h b/src/hb-common.h index 5dc1ebcd..fdceff9d 100644 --- a/src/hb-common.h +++ b/src/hb-common.h @@ -379,6 +379,19 @@ typedef void (*hb_destroy_func_t) (void *user_data); /* Font features and variations. */ +/** + * HB_FEATURE_GLOBAL_START + * + * Since: REPLACEME + */ +#define HB_FEATURE_GLOBAL_START 0 +/** + * HB_FEATURE_GLOBAL_END + * + * Since: REPLACEME + */ +#define HB_FEATURE_GLOBAL_END ((unsigned int) -1) + typedef struct hb_feature_t { hb_tag_t tag; uint32_t value; commit 13a8786c7c580651d8a6db9345b9aa85ca8ed956 Author: Behdad Esfahbod <beh...@behdad.org> Date: Tue Sep 11 01:07:06 2018 +0200 Add (unused) hb_array_t<> diff --git a/src/hb-dsalgs.hh b/src/hb-dsalgs.hh index 7e06ff17..def968eb 100644 --- a/src/hb-dsalgs.hh +++ b/src/hb-dsalgs.hh @@ -29,6 +29,8 @@ #include "hb.hh" +#include "hb-null.hh" + /* Void! For when we need a expression-type of void. */ typedef const struct _hb_void_t *hb_void_t; @@ -507,6 +509,24 @@ struct hb_auto_t : Type void fini (void) {} }; +template <typename T> +struct hb_array_t +{ + inline hb_array_t (void) : arrayZ (nullptr), len (0) {} + inline hb_array_t (const T *array_, unsigned int len_) : arrayZ (array_), len (len_) {} + + inline const T& operator [] (unsigned int i) const + { + if (unlikely (i >= len)) return Null(T); + return arrayZ[i]; + } + + inline void free (void) { ::free ((void *) arrayZ); arrayZ = nullptr; len = 0; } + + const T *arrayZ; + unsigned int len; +}; + struct hb_bytes_t { inline hb_bytes_t (void) : bytes (nullptr), len (0) {} commit bccf3e1827eec07433340eea705597201b6d0a32 Author: Behdad Esfahbod <beh...@behdad.org> Date: Tue Sep 11 01:04:50 2018 +0200 Minor diff --git a/src/hb-open-type.hh b/src/hb-open-type.hh index 27ec7720..5d09c520 100644 --- a/src/hb-open-type.hh +++ b/src/hb-open-type.hh @@ -299,7 +299,6 @@ static inline Type& operator + (Base &base, OffsetTo<Type, OffsetType> &offset) * Array Types */ -/* TODO Use it in ArrayOf, HeadlessArrayOf, and other places around the code base?? */ template <typename Type> struct UnsizedArrayOf { _______________________________________________ HarfBuzz mailing list HarfBuzz@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/harfbuzz