< prev index next >
src/java.desktop/share/native/libfontmanager/harfbuzz/hb-unicode.hh
Print this page
@@ -26,15 +26,14 @@
* Red Hat Author(s): Behdad Esfahbod
* Codethink Author(s): Ryan Lortie
* Google Author(s): Behdad Esfahbod
*/
-#ifndef HB_UNICODE_PRIVATE_HH
-#define HB_UNICODE_PRIVATE_HH
+#ifndef HB_UNICODE_HH
+#define HB_UNICODE_HH
-#include "hb-private.hh"
-#include "hb-object-private.hh"
+#include "hb.hh"
extern HB_INTERNAL const uint8_t _hb_modified_combining_class[256];
/*
@@ -59,39 +58,37 @@
HB_UNICODE_FUNC_IMPLEMENT (hb_unicode_general_category_t, general_category) \
HB_UNICODE_FUNC_IMPLEMENT (hb_codepoint_t, mirroring) \
HB_UNICODE_FUNC_IMPLEMENT (hb_script_t, script) \
/* ^--- Add new simple callbacks here */
-struct hb_unicode_funcs_t {
+struct hb_unicode_funcs_t
+{
hb_object_header_t header;
- ASSERT_POD ();
hb_unicode_funcs_t *parent;
- bool immutable;
-
#define HB_UNICODE_FUNC_IMPLEMENT(return_type, name) \
- inline return_type name (hb_codepoint_t unicode) { return func.name (this, unicode, user_data.name); }
+ return_type name (hb_codepoint_t unicode) { return func.name (this, unicode, user_data.name); }
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE
#undef HB_UNICODE_FUNC_IMPLEMENT
- inline hb_bool_t compose (hb_codepoint_t a, hb_codepoint_t b,
+ hb_bool_t compose (hb_codepoint_t a, hb_codepoint_t b,
hb_codepoint_t *ab)
{
*ab = 0;
if (unlikely (!a || !b)) return false;
return func.compose (this, a, b, ab, user_data.compose);
}
- inline hb_bool_t decompose (hb_codepoint_t ab,
+ hb_bool_t decompose (hb_codepoint_t ab,
hb_codepoint_t *a, hb_codepoint_t *b)
{
*a = ab; *b = 0;
return func.decompose (this, ab, a, b, user_data.decompose);
}
- inline unsigned int decompose_compatibility (hb_codepoint_t u,
+ unsigned int decompose_compatibility (hb_codepoint_t u,
hb_codepoint_t *decomposed)
{
unsigned int ret = func.decompose_compatibility (this, u, decomposed, user_data.decompose_compatibility);
if (ret == 1 && u == decomposed[0]) {
decomposed[0] = 0;
@@ -99,31 +96,30 @@
}
decomposed[ret] = 0;
return ret;
}
-
- inline unsigned int
- modified_combining_class (hb_codepoint_t unicode)
+ unsigned int
+ modified_combining_class (hb_codepoint_t u)
{
/* XXX This hack belongs to the Myanmar shaper. */
- if (unlikely (unicode == 0x1037u)) unicode = 0x103Au;
+ if (unlikely (u == 0x1037u)) u = 0x103Au;
/* XXX This hack belongs to the USE shaper (for Tai Tham):
* Reorder SAKOT to ensure it comes after any tone marks. */
- if (unlikely (unicode == 0x1A60u)) return 254;
+ if (unlikely (u == 0x1A60u)) return 254;
/* XXX This hack belongs to the Tibetan shaper:
* Reorder PADMA to ensure it comes after any vowel marks. */
- if (unlikely (unicode == 0x0FC6u)) return 254;
+ if (unlikely (u == 0x0FC6u)) return 254;
/* Reorder TSA -PHRU to reorder before U+0F74 */
- if (unlikely (unicode == 0x0F39u)) return 127;
+ if (unlikely (u == 0x0F39u)) return 127;
- return _hb_modified_combining_class[combining_class (unicode)];
+ return _hb_modified_combining_class[combining_class (u)];
}
- static inline hb_bool_t
+ static hb_bool_t
is_variation_selector (hb_codepoint_t unicode)
{
/* U+180B..180D MONGOLIAN FREE VARIATION SELECTORs are handled in the
* Arabic shaper. No need to match them here. */
return unlikely (hb_in_ranges<hb_codepoint_t> (unicode,
@@ -166,11 +162,11 @@
* E0020..E007F # Cf [96] TAG SPACE..CANCEL TAG
* E0080..E00FF # Cn [128] <reserved-E0080>..<reserved-E00FF>
* E0100..E01EF # Mn [240] VARIATION SELECTOR-17..VARIATION SELECTOR-256
* E01F0..E0FFF # Cn [3600] <reserved-E01F0>..<reserved-E0FFF>
*/
- static inline hb_bool_t
+ static hb_bool_t
is_default_ignorable (hb_codepoint_t ch)
{
hb_codepoint_t plane = ch >> 16;
if (likely (plane == 0))
{
@@ -218,11 +214,11 @@
SPACE,
SPACE_FIGURE,
SPACE_PUNCTUATION,
SPACE_NARROW,
};
- static inline space_t
+ static space_t
space_fallback_type (hb_codepoint_t u)
{
switch (u)
{
/* All GC=Zs chars that can use a fallback. */
@@ -262,16 +258,16 @@
#define HB_UNICODE_FUNC_IMPLEMENT(name) hb_destroy_func_t name;
HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS
#undef HB_UNICODE_FUNC_IMPLEMENT
} destroy;
};
+DECLARE_NULL_INSTANCE (hb_unicode_funcs_t);
-extern HB_INTERNAL const hb_unicode_funcs_t _hb_unicode_funcs_nil;
-
-
-/* Modified combining marks */
+/*
+ * Modified combining marks
+ */
/* Hebrew
*
* We permute the "fixed-position" classes 10-26 into the order
* described in the SBL Hebrew manual:
@@ -360,12 +356,39 @@
(FLAG_UNSAFE (gen_cat) & \
(FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK) | \
FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK)))
-#define HB_UNICODE_GENERAL_CATEGORY_IS_NON_ENCLOSING_MARK_OR_MODIFIER_SYMBOL(gen_cat) \
- (FLAG_UNSAFE (gen_cat) & \
- (FLAG (HB_UNICODE_GENERAL_CATEGORY_SPACING_MARK) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) | \
- FLAG (HB_UNICODE_GENERAL_CATEGORY_MODIFIER_SYMBOL)))
-#endif /* HB_UNICODE_PRIVATE_HH */
+/*
+ * Ranges, used for bsearch tables.
+ */
+
+struct hb_unicode_range_t
+{
+ static int
+ cmp (const void *_key, const void *_item)
+ {
+ hb_codepoint_t cp = *((hb_codepoint_t *) _key);
+ const hb_unicode_range_t *range = (hb_unicode_range_t *) _item;
+
+ if (cp < range->start)
+ return -1;
+ else if (cp <= range->end)
+ return 0;
+ else
+ return +1;
+ }
+
+ hb_codepoint_t start;
+ hb_codepoint_t end;
+};
+
+/*
+ * Emoji.
+ */
+
+HB_INTERNAL bool
+_hb_unicode_is_emoji_Extended_Pictographic (hb_codepoint_t cp);
+
+
+#endif /* HB_UNICODE_HH */
< prev index next >