From 82b12bcadd50c9e86bbe82623a1cbc0b4afdd237 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 25 Aug 2018 22:07:17 -0700 Subject: [PATCH] [unicode] Add HB_UNICODE_MAX New API: HB_UNICODE_MAX --- docs/harfbuzz-sections.txt | 1 + src/hb-ot-cmap-table.hh | 8 ++------ src/hb-unicode.h | 3 +++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/harfbuzz-sections.txt b/docs/harfbuzz-sections.txt index f98e8cc13..043611e97 100644 --- a/docs/harfbuzz-sections.txt +++ b/docs/harfbuzz-sections.txt @@ -605,6 +605,7 @@ hb_shape_plan_t
hb-unicode +HB_UNICODE_MAX HB_UNICODE_MAX_DECOMPOSITION_LEN hb_unicode_combining_class hb_unicode_combining_class_func_t diff --git a/src/hb-ot-cmap-table.hh b/src/hb-ot-cmap-table.hh index 756b22d4c..6ab578c25 100644 --- a/src/hb-ot-cmap-table.hh +++ b/src/hb-ot-cmap-table.hh @@ -37,10 +37,6 @@ */ #define HB_OT_TAG_cmap HB_TAG('c','m','a','p') -#ifndef HB_MAX_UNICODE_CODEPOINT_VALUE -#define HB_MAX_UNICODE_CODEPOINT_VALUE 0x10FFFF -#endif - namespace OT { @@ -478,7 +474,7 @@ struct CmapSubtableLongSegmented for (unsigned int i = 0; i < this->groups.len; i++) { out->add_range (this->groups[i].startCharCode, MIN ((hb_codepoint_t) this->groups[i].endCharCode, - (hb_codepoint_t) HB_MAX_UNICODE_CODEPOINT_VALUE)); + (hb_codepoint_t) HB_UNICODE_MAX)); } } @@ -624,7 +620,7 @@ struct DefaultUVS : SortedArrayOf { hb_codepoint_t first = arrayZ[i].startUnicodeValue; hb_codepoint_t last = MIN ((hb_codepoint_t) (first + arrayZ[i].additionalCount), - (hb_codepoint_t) HB_MAX_UNICODE_CODEPOINT_VALUE); + (hb_codepoint_t) HB_UNICODE_MAX); out->add_range (first, last); } } diff --git a/src/hb-unicode.h b/src/hb-unicode.h index 2657f4813..226c5d5c9 100644 --- a/src/hb-unicode.h +++ b/src/hb-unicode.h @@ -40,6 +40,9 @@ HB_BEGIN_DECLS +#define HB_UNICODE_MAX 0x10FFFFu + + /* hb_unicode_general_category_t */ /* Unicode Character Database property: General_Category (gc) */