2 * Copyright © 2009,2010 Red Hat, Inc.
3 * Copyright © 2011,2012 Google, Inc.
5 * This is part of HarfBuzz, a text shaping library.
7 * Permission is hereby granted, without written agreement and without
8 * license or royalty fees, to use, copy, modify, and distribute this
9 * software and its documentation for any purpose, provided that the
10 * above copyright notice and the following two paragraphs appear in
11 * all copies of this software.
13 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
19 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
22 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
25 * Red Hat Author(s): Behdad Esfahbod
26 * Google Author(s): Behdad Esfahbod
31 #include "hb-machinery.hh"
42 * @short_description: Common data types
45 * Common data types used across HarfBuzz are defined here.
51 hb_atomic_int_t _hb_options;
58 u.opts.initialized = true;
60 const char *c = getenv ("HB_OPTIONS");
65 const char *p = strchr (c, ':');
69 #define OPTION(name, symbol) \
70 if (0 == strncmp (c, name, p - c) && strlen (name) == p - c) u.opts.symbol = true;
72 OPTION ("uniscribe-bug-compatible", uniscribe_bug_compatible);
82 /* This is idempotent and threadsafe. */
83 _hb_options.set_relaxed (u.i);
91 * @str: (array length=len) (element-type uint8_t):
101 hb_tag_from_string (const char *str, int len)
106 if (!str || !len || !*str)
109 if (len < 0 || len > 4)
111 for (i = 0; i < (unsigned) len && str[i]; i++)
116 return HB_TAG (tag[0], tag[1], tag[2], tag[3]);
122 * @buf: (out caller-allocates) (array fixed-size=4) (element-type uint8_t):
129 hb_tag_to_string (hb_tag_t tag, char *buf)
131 buf[0] = (char) (uint8_t) (tag >> 24);
132 buf[1] = (char) (uint8_t) (tag >> 16);
133 buf[2] = (char) (uint8_t) (tag >> 8);
134 buf[3] = (char) (uint8_t) (tag >> 0);
140 const char direction_strings[][4] = {
148 * hb_direction_from_string:
149 * @str: (array length=len) (element-type uint8_t):
159 hb_direction_from_string (const char *str, int len)
161 if (unlikely (!str || !len || !*str))
162 return HB_DIRECTION_INVALID;
164 /* Lets match loosely: just match the first letter, such that
165 * all of "ltr", "left-to-right", etc work!
167 char c = TOLOWER (str[0]);
168 for (unsigned int i = 0; i < ARRAY_LENGTH (direction_strings); i++)
169 if (c == direction_strings[i][0])
170 return (hb_direction_t) (HB_DIRECTION_LTR + i);
172 return HB_DIRECTION_INVALID;
176 * hb_direction_to_string:
181 * Return value: (transfer none):
186 hb_direction_to_string (hb_direction_t direction)
188 if (likely ((unsigned int) (direction - HB_DIRECTION_LTR)
189 < ARRAY_LENGTH (direction_strings)))
190 return direction_strings[direction - HB_DIRECTION_LTR];
198 struct hb_language_impl_t {
202 static const char canon_map[256] = {
203 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
204 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
205 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, '-', 0, 0,
206 '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 0, 0, 0, 0, 0, 0,
207 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
208 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, '-',
209 0, 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o',
210 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z', 0, 0, 0, 0, 0
214 lang_equal (hb_language_t v1,
217 const unsigned char *p1 = (const unsigned char *) v1;
218 const unsigned char *p2 = (const unsigned char *) v2;
220 while (*p1 && *p1 == canon_map[*p2]) {
225 return *p1 == canon_map[*p2];
230 lang_hash (const void *key)
232 const unsigned char *p = key;
234 while (canon_map[*p])
236 h = (h << 5) - h + canon_map[*p];
245 struct hb_language_item_t {
247 struct hb_language_item_t *next;
250 bool operator == (const char *s) const
251 { return lang_equal (lang, s); }
253 hb_language_item_t & operator = (const char *s) {
254 /* If a custom allocated is used calling strdup() pairs
255 badly with a call to the custom free() in fini() below.
256 Therefore don't call strdup(), implement its behavior.
258 size_t len = strlen(s) + 1;
259 lang = (hb_language_t) malloc(len);
262 memcpy((unsigned char *) lang, s, len);
263 for (unsigned char *p = (unsigned char *) lang; *p; p++)
270 void fini () { free ((void *) lang); }
274 /* Thread-safe lock-free language list */
276 static hb_atomic_ptr_t <hb_language_item_t> langs;
283 hb_language_item_t *first_lang = langs;
284 if (unlikely (!langs.cmpexch (first_lang, nullptr)))
288 hb_language_item_t *next = first_lang->next;
296 static hb_language_item_t *
297 lang_find_or_insert (const char *key)
300 hb_language_item_t *first_lang = langs;
302 for (hb_language_item_t *lang = first_lang; lang; lang = lang->next)
306 /* Not found; allocate one. */
307 hb_language_item_t *lang = (hb_language_item_t *) calloc (1, sizeof (hb_language_item_t));
308 if (unlikely (!lang))
310 lang->next = first_lang;
312 if (unlikely (!lang->lang))
318 if (unlikely (!langs.cmpexch (first_lang, lang)))
327 atexit (free_langs); /* First person registers atexit() callback. */
335 * hb_language_from_string:
336 * @str: (array length=len) (element-type uint8_t): a string representing
337 * a BCP 47 language tag
338 * @len: length of the @str, or -1 if it is %NULL-terminated.
340 * Converts @str representing a BCP 47 language tag to the corresponding
343 * Return value: (transfer none):
344 * The #hb_language_t corresponding to the BCP 47 language tag.
349 hb_language_from_string (const char *str, int len)
351 if (!str || !len || !*str)
352 return HB_LANGUAGE_INVALID;
354 hb_language_item_t *item = nullptr;
357 /* NUL-terminate it. */
359 len = MIN (len, (int) sizeof (strbuf) - 1);
360 memcpy (strbuf, str, len);
362 item = lang_find_or_insert (strbuf);
365 item = lang_find_or_insert (str);
367 return likely (item) ? item->lang : HB_LANGUAGE_INVALID;
371 * hb_language_to_string:
372 * @language: an #hb_language_t to convert.
374 * See hb_language_from_string().
376 * Return value: (transfer none):
377 * A %NULL-terminated string representing the @language. Must not be freed by
383 hb_language_to_string (hb_language_t language)
385 /* This is actually nullptr-safe! */
390 * hb_language_get_default:
392 * Get default language from current locale.
394 * Note that the first time this function is called, it calls
395 * "setlocale (LC_CTYPE, nullptr)" to fetch current locale. The underlying
396 * setlocale function is, in many implementations, NOT threadsafe. To avoid
397 * problems, call this function once before multiple threads can call it.
398 * This function is only used from hb_buffer_guess_segment_properties() by
401 * Return value: (transfer none):
406 hb_language_get_default ()
408 static hb_atomic_ptr_t <hb_language_t> default_language;
410 hb_language_t language = default_language;
411 if (unlikely (language == HB_LANGUAGE_INVALID))
413 language = hb_language_from_string (setlocale (LC_CTYPE, nullptr), -1);
414 (void) default_language.cmpexch (HB_LANGUAGE_INVALID, language);
424 * hb_script_from_iso15924_tag:
425 * @tag: an #hb_tag_t representing an ISO 15924 tag.
427 * Converts an ISO 15924 script tag to a corresponding #hb_script_t.
430 * An #hb_script_t corresponding to the ISO 15924 tag.
435 hb_script_from_iso15924_tag (hb_tag_t tag)
437 if (unlikely (tag == HB_TAG_NONE))
438 return HB_SCRIPT_INVALID;
440 /* Be lenient, adjust case (one capital letter followed by three small letters) */
441 tag = (tag & 0xDFDFDFDFu) | 0x00202020u;
445 /* These graduated from the 'Q' private-area codes, but
446 * the old code is still aliased by Unicode, and the Qaai
447 * one in use by ICU. */
448 case HB_TAG('Q','a','a','i'): return HB_SCRIPT_INHERITED;
449 case HB_TAG('Q','a','a','c'): return HB_SCRIPT_COPTIC;
451 /* Script variants from https://unicode.org/iso15924/ */
452 case HB_TAG('C','y','r','s'): return HB_SCRIPT_CYRILLIC;
453 case HB_TAG('L','a','t','f'): return HB_SCRIPT_LATIN;
454 case HB_TAG('L','a','t','g'): return HB_SCRIPT_LATIN;
455 case HB_TAG('S','y','r','e'): return HB_SCRIPT_SYRIAC;
456 case HB_TAG('S','y','r','j'): return HB_SCRIPT_SYRIAC;
457 case HB_TAG('S','y','r','n'): return HB_SCRIPT_SYRIAC;
460 /* If it looks right, just use the tag as a script */
461 if (((uint32_t) tag & 0xE0E0E0E0u) == 0x40606060u)
462 return (hb_script_t) tag;
464 /* Otherwise, return unknown */
465 return HB_SCRIPT_UNKNOWN;
469 * hb_script_from_string:
470 * @str: (array length=len) (element-type uint8_t): a string representing an
472 * @len: length of the @str, or -1 if it is %NULL-terminated.
474 * Converts a string @str representing an ISO 15924 script tag to a
475 * corresponding #hb_script_t. Shorthand for hb_tag_from_string() then
476 * hb_script_from_iso15924_tag().
479 * An #hb_script_t corresponding to the ISO 15924 tag.
484 hb_script_from_string (const char *str, int len)
486 return hb_script_from_iso15924_tag (hb_tag_from_string (str, len));
490 * hb_script_to_iso15924_tag:
491 * @script: an #hb_script_ to convert.
493 * See hb_script_from_iso15924_tag().
496 * An #hb_tag_t representing an ISO 15924 script tag.
501 hb_script_to_iso15924_tag (hb_script_t script)
503 return (hb_tag_t) script;
507 * hb_script_get_horizontal_direction:
517 hb_script_get_horizontal_direction (hb_script_t script)
519 /* https://docs.google.com/spreadsheets/d/1Y90M0Ie3MUJ6UVCRDOypOtijlMDLNNyyLk36T6iMu0o */
520 switch ((hb_tag_t) script)
522 /* Unicode-1.1 additions */
523 case HB_SCRIPT_ARABIC:
524 case HB_SCRIPT_HEBREW:
526 /* Unicode-3.0 additions */
527 case HB_SCRIPT_SYRIAC:
528 case HB_SCRIPT_THAANA:
530 /* Unicode-4.0 additions */
531 case HB_SCRIPT_CYPRIOT:
533 /* Unicode-4.1 additions */
534 case HB_SCRIPT_KHAROSHTHI:
536 /* Unicode-5.0 additions */
537 case HB_SCRIPT_PHOENICIAN:
540 /* Unicode-5.1 additions */
541 case HB_SCRIPT_LYDIAN:
543 /* Unicode-5.2 additions */
544 case HB_SCRIPT_AVESTAN:
545 case HB_SCRIPT_IMPERIAL_ARAMAIC:
546 case HB_SCRIPT_INSCRIPTIONAL_PAHLAVI:
547 case HB_SCRIPT_INSCRIPTIONAL_PARTHIAN:
548 case HB_SCRIPT_OLD_SOUTH_ARABIAN:
549 case HB_SCRIPT_OLD_TURKIC:
550 case HB_SCRIPT_SAMARITAN:
552 /* Unicode-6.0 additions */
553 case HB_SCRIPT_MANDAIC:
555 /* Unicode-6.1 additions */
556 case HB_SCRIPT_MEROITIC_CURSIVE:
557 case HB_SCRIPT_MEROITIC_HIEROGLYPHS:
559 /* Unicode-7.0 additions */
560 case HB_SCRIPT_MANICHAEAN:
561 case HB_SCRIPT_MENDE_KIKAKUI:
562 case HB_SCRIPT_NABATAEAN:
563 case HB_SCRIPT_OLD_NORTH_ARABIAN:
564 case HB_SCRIPT_PALMYRENE:
565 case HB_SCRIPT_PSALTER_PAHLAVI:
567 /* Unicode-8.0 additions */
568 case HB_SCRIPT_HATRAN:
570 /* Unicode-9.0 additions */
571 case HB_SCRIPT_ADLAM:
573 /* Unicode-11.0 additions */
574 case HB_SCRIPT_HANIFI_ROHINGYA:
575 case HB_SCRIPT_OLD_SOGDIAN:
576 case HB_SCRIPT_SOGDIAN:
578 return HB_DIRECTION_RTL;
581 /* https://github.com/harfbuzz/harfbuzz/issues/1000 */
582 case HB_SCRIPT_OLD_HUNGARIAN:
583 case HB_SCRIPT_OLD_ITALIC:
584 case HB_SCRIPT_RUNIC:
586 return HB_DIRECTION_INVALID;
589 return HB_DIRECTION_LTR;
593 /* hb_user_data_array_t */
596 hb_user_data_array_t::set (hb_user_data_key_t *key,
598 hb_destroy_func_t destroy,
605 if (!data && !destroy) {
606 items.remove (key, lock);
610 hb_user_data_item_t item = {key, data, destroy};
611 bool ret = !!items.replace_or_insert (item, lock, (bool) replace);
617 hb_user_data_array_t::get (hb_user_data_key_t *key)
619 hb_user_data_item_t item = {nullptr, nullptr, nullptr};
621 return items.find (key, &item, lock) ? item.data : nullptr;
631 * @short_description: Information about the version of HarfBuzz in use
634 * These functions and macros allow accessing version of the HarfBuzz
635 * library used at compile- as well as run-time, and to direct code
636 * conditionally based on those versions, again, at compile- or run-time.
642 * @major: (out): Library major version component.
643 * @minor: (out): Library minor version component.
644 * @micro: (out): Library micro version component.
646 * Returns library version as three integer components.
651 hb_version (unsigned int *major,
655 *major = HB_VERSION_MAJOR;
656 *minor = HB_VERSION_MINOR;
657 *micro = HB_VERSION_MICRO;
663 * Returns library version as a string with three components.
665 * Return value: library version string.
672 return HB_VERSION_STRING;
676 * hb_version_atleast:
688 hb_version_atleast (unsigned int major,
692 return HB_VERSION_ATLEAST (major, minor, micro);
697 /* hb_feature_t and hb_variation_t */
700 parse_space (const char **pp, const char *end)
702 while (*pp < end && ISSPACE (**pp))
708 parse_char (const char **pp, const char *end, char c)
710 parse_space (pp, end);
712 if (*pp == end || **pp != c)
720 parse_uint (const char **pp, const char *end, unsigned int *pv)
723 unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp));
724 strncpy (buf, *pp, len);
731 /* Intentionally use strtol instead of strtoul, such that
732 * -1 turns into "big number"... */
734 v = strtol (p, &pend, 0);
735 if (errno || p == pend)
744 parse_uint32 (const char **pp, const char *end, uint32_t *pv)
747 unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp));
748 strncpy (buf, *pp, len);
755 /* Intentionally use strtol instead of strtoul, such that
756 * -1 turns into "big number"... */
758 v = strtol (p, &pend, 0);
759 if (errno || p == pend)
767 #if defined (HAVE_NEWLOCALE) && defined (HAVE_STRTOD_L)
768 #define USE_XLOCALE 1
769 #define HB_LOCALE_T locale_t
770 #define HB_CREATE_LOCALE(locName) newlocale (LC_ALL_MASK, locName, nullptr)
771 #define HB_FREE_LOCALE(loc) freelocale (loc)
772 #elif defined(_MSC_VER)
773 #define USE_XLOCALE 1
774 #define HB_LOCALE_T _locale_t
775 #define HB_CREATE_LOCALE(locName) _create_locale (LC_ALL, locName)
776 #define HB_FREE_LOCALE(loc) _free_locale (loc)
777 #define strtod_l(a, b, c) _strtod_l ((a), (b), (c))
783 static void free_static_C_locale ();
786 static struct hb_C_locale_lazy_loader_t : hb_lazy_loader_t<hb_remove_pointer (HB_LOCALE_T),
787 hb_C_locale_lazy_loader_t>
789 static HB_LOCALE_T create ()
791 HB_LOCALE_T C_locale = HB_CREATE_LOCALE ("C");
794 atexit (free_static_C_locale);
799 static void destroy (HB_LOCALE_T p)
803 static HB_LOCALE_T get_null ()
811 void free_static_C_locale ()
813 static_C_locale.free_instance ();
820 return static_C_locale.get_unconst ();
822 #endif /* USE_XLOCALE */
825 parse_float (const char **pp, const char *end, float *pv)
828 unsigned int len = MIN (ARRAY_LENGTH (buf) - 1, (unsigned int) (end - *pp));
829 strncpy (buf, *pp, len);
838 v = strtod_l (p, &pend, get_C_locale ());
840 v = strtod (p, &pend);
842 if (errno || p == pend)
851 parse_bool (const char **pp, const char *end, uint32_t *pv)
853 parse_space (pp, end);
856 while (*pp < end && ISALPHA(**pp))
859 /* CSS allows on/off as aliases 1/0. */
860 if (*pp - p == 2 && 0 == strncmp (p, "on", 2))
862 else if (*pp - p == 3 && 0 == strncmp (p, "off", 3))
873 parse_feature_value_prefix (const char **pp, const char *end, hb_feature_t *feature)
875 if (parse_char (pp, end, '-'))
878 parse_char (pp, end, '+');
886 parse_tag (const char **pp, const char *end, hb_tag_t *tag)
888 parse_space (pp, end);
892 if (*pp < end && (**pp == '\'' || **pp == '"'))
899 while (*pp < end && (ISALNUM(**pp) || **pp == '_'))
902 if (p == *pp || *pp - p > 4)
905 *tag = hb_tag_from_string (p, *pp - p);
909 /* CSS expects exactly four bytes. And we only allow quotations for
910 * CSS compatibility. So, enforce the length. */
913 if (*pp == end || **pp != quote)
922 parse_feature_indices (const char **pp, const char *end, hb_feature_t *feature)
924 parse_space (pp, end);
928 feature->start = HB_FEATURE_GLOBAL_START;
929 feature->end = HB_FEATURE_GLOBAL_END;
931 if (!parse_char (pp, end, '['))
934 has_start = parse_uint (pp, end, &feature->start);
936 if (parse_char (pp, end, ':') || parse_char (pp, end, ';')) {
937 parse_uint (pp, end, &feature->end);
940 feature->end = feature->start + 1;
943 return parse_char (pp, end, ']');
947 parse_feature_value_postfix (const char **pp, const char *end, hb_feature_t *feature)
949 bool had_equal = parse_char (pp, end, '=');
950 bool had_value = parse_uint32 (pp, end, &feature->value) ||
951 parse_bool (pp, end, &feature->value);
952 /* CSS doesn't use equal-sign between tag and value.
953 * If there was an equal-sign, then there *must* be a value.
954 * A value without an equal-sign is ok, but not required. */
955 return !had_equal || had_value;
959 parse_one_feature (const char **pp, const char *end, hb_feature_t *feature)
961 return parse_feature_value_prefix (pp, end, feature) &&
962 parse_tag (pp, end, &feature->tag) &&
963 parse_feature_indices (pp, end, feature) &&
964 parse_feature_value_postfix (pp, end, feature) &&
965 parse_space (pp, end) &&
970 * hb_feature_from_string:
971 * @str: (array length=len) (element-type uint8_t): a string to parse
972 * @len: length of @str, or -1 if string is %NULL terminated
973 * @feature: (out): the #hb_feature_t to initialize with the parsed values
975 * Parses a string into a #hb_feature_t.
977 * TODO: document the syntax here.
980 * %true if @str is successfully parsed, %false otherwise.
985 hb_feature_from_string (const char *str, int len,
986 hb_feature_t *feature)
993 if (likely (parse_one_feature (&str, str + len, &feat)))
1001 memset (feature, 0, sizeof (*feature));
1006 * hb_feature_to_string:
1007 * @feature: an #hb_feature_t to convert
1008 * @buf: (array length=size) (out): output string
1009 * @size: the allocated size of @buf
1011 * Converts a #hb_feature_t into a %NULL-terminated string in the format
1012 * understood by hb_feature_from_string(). The client in responsible for
1013 * allocating big enough size for @buf, 128 bytes is more than enough.
1018 hb_feature_to_string (hb_feature_t *feature,
1019 char *buf, unsigned int size)
1021 if (unlikely (!size)) return;
1024 unsigned int len = 0;
1025 if (feature->value == 0)
1027 hb_tag_to_string (feature->tag, s + len);
1029 while (len && s[len - 1] == ' ')
1031 if (feature->start != 0 || feature->end != (unsigned int) -1)
1035 len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->start));
1036 if (feature->end != feature->start + 1) {
1038 if (feature->end != (unsigned int) -1)
1039 len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->end));
1043 if (feature->value > 1)
1046 len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%u", feature->value));
1048 assert (len < ARRAY_LENGTH (s));
1049 len = MIN (len, size - 1);
1050 memcpy (buf, s, len);
1054 /* hb_variation_t */
1057 parse_variation_value (const char **pp, const char *end, hb_variation_t *variation)
1059 parse_char (pp, end, '='); /* Optional. */
1060 return parse_float (pp, end, &variation->value);
1064 parse_one_variation (const char **pp, const char *end, hb_variation_t *variation)
1066 return parse_tag (pp, end, &variation->tag) &&
1067 parse_variation_value (pp, end, variation) &&
1068 parse_space (pp, end) &&
1073 * hb_variation_from_string:
1078 hb_variation_from_string (const char *str, int len,
1079 hb_variation_t *variation)
1086 if (likely (parse_one_variation (&str, str + len, &var)))
1094 memset (variation, 0, sizeof (*variation));
1099 * hb_variation_to_string:
1104 hb_variation_to_string (hb_variation_t *variation,
1105 char *buf, unsigned int size)
1107 if (unlikely (!size)) return;
1110 unsigned int len = 0;
1111 hb_tag_to_string (variation->tag, s + len);
1113 while (len && s[len - 1] == ' ')
1116 len += MAX (0, snprintf (s + len, ARRAY_LENGTH (s) - len, "%g", (double) variation->value));
1118 assert (len < ARRAY_LENGTH (s));
1119 len = MIN (len, size - 1);
1120 memcpy (buf, s, len);
1124 /* If there is no visibility control, then hb-static.cc will NOT
1125 * define anything. Instead, we get it to define one set in here
1126 * only, so only libharfbuzz.so defines them, not other libs. */
1127 #ifdef HB_NO_VISIBILITY
1128 #undef HB_NO_VISIBILITY
1129 #include "hb-static.cc"
1130 #define HB_NO_VISIBILITY 1