summaryrefslogtreecommitdiff
path: root/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc')
-rw-r--r--Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc54
1 files changed, 26 insertions, 28 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc
index 7b821b46d5e..8cf7898a164 100644
--- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc
+++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode.cc
@@ -33,6 +33,20 @@
#include "hb-unicode.hh"
+/**
+ * SECTION: hb-unicode
+ * @title: hb-unicode
+ * @short_description: Unicode character property access
+ * @include: hb.h
+ *
+ * Unicode functions are used to access Unicode character properties.
+ * Client can pass its own Unicode functions to HarfBuzz, or access
+ * the built-in Unicode functions that come with HarfBuzz.
+ *
+ * With the Unicode functions, one can query variour Unicode character
+ * properties, such as General Category, Script, Combining Class, etc.
+ **/
+
/*
* hb_unicode_funcs_t
@@ -109,40 +123,23 @@ hb_unicode_decompose_compatibility_nil (hb_unicode_funcs_t *ufuncs HB_UNUSED
}
-#define HB_UNICODE_FUNCS_IMPLEMENT_SET \
- HB_UNICODE_FUNCS_IMPLEMENT (glib) \
- HB_UNICODE_FUNCS_IMPLEMENT (icu) \
- HB_UNICODE_FUNCS_IMPLEMENT (ucdn) \
- HB_UNICODE_FUNCS_IMPLEMENT (nil) \
- /* ^--- Add new callbacks before nil */
-
-#define hb_nil_get_unicode_funcs hb_unicode_funcs_get_empty
-
-/* Prototype them all */
-#define HB_UNICODE_FUNCS_IMPLEMENT(set) \
-extern "C" hb_unicode_funcs_t *hb_##set##_get_unicode_funcs (void);
-HB_UNICODE_FUNCS_IMPLEMENT_SET
-#undef HB_UNICODE_FUNCS_IMPLEMENT
-
+extern "C" hb_unicode_funcs_t *hb_glib_get_unicode_funcs (void);
+extern "C" hb_unicode_funcs_t *hb_icu_get_unicode_funcs (void);
+extern "C" hb_unicode_funcs_t *hb_ucdn_get_unicode_funcs (void);
hb_unicode_funcs_t *
hb_unicode_funcs_get_default (void)
{
-#define HB_UNICODE_FUNCS_IMPLEMENT(set) \
- return hb_##set##_get_unicode_funcs ();
-
#if defined(HAVE_UCDN)
- HB_UNICODE_FUNCS_IMPLEMENT(ucdn)
+ return hb_ucdn_get_unicode_funcs ();
#elif defined(HAVE_GLIB)
- HB_UNICODE_FUNCS_IMPLEMENT(glib)
+ return hb_glib_get_unicode_funcs ();
#elif defined(HAVE_ICU) && defined(HAVE_ICU_BUILTIN)
- HB_UNICODE_FUNCS_IMPLEMENT(icu)
+ return hb_icu_get_unicode_funcs ();
#else
#define HB_UNICODE_FUNCS_NIL 1
- HB_UNICODE_FUNCS_IMPLEMENT(nil)
+ return hb_unicode_funcs_get_empty ();
#endif
-
-#undef HB_UNICODE_FUNCS_IMPLEMENT
}
#if !defined(HB_NO_UNICODE_FUNCS) && defined(HB_UNICODE_FUNCS_NIL)
@@ -442,6 +439,7 @@ hb_unicode_decompose (hb_unicode_funcs_t *ufuncs,
* Return value:
*
* Since: 0.9.2
+ * Deprecated: 2.0.0
**/
unsigned int
hb_unicode_decompose_compatibility (hb_unicode_funcs_t *ufuncs,
@@ -575,8 +573,8 @@ _hb_modified_combining_class[256] =
bool
_hb_unicode_is_emoji_Extended_Pictographic (hb_codepoint_t cp)
{
- return hb_bsearch_r (&cp, _hb_unicode_emoji_Extended_Pictographic_table,
- ARRAY_LENGTH (_hb_unicode_emoji_Extended_Pictographic_table),
- sizeof (hb_unicode_range_t),
- hb_unicode_range_t::cmp, nullptr);
+ return hb_bsearch (&cp, _hb_unicode_emoji_Extended_Pictographic_table,
+ ARRAY_LENGTH (_hb_unicode_emoji_Extended_Pictographic_table),
+ sizeof (hb_unicode_range_t),
+ hb_unicode_range_t::cmp);
}