From 1fc077211771c752768f63f178116d2b8f2f7d03 Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Sat, 11 May 2019 01:24:23 -0700 Subject: [PATCH] [config] HB_NO_OT_NAME_LANGUAGE AAT --- src/hb-config.hh | 4 ++-- src/hb-ot-name-language-static.hh | 3 +++ src/hb-ot-name-table.hh | 4 +++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/hb-config.hh b/src/hb-config.hh index 09f71155b..40a0baef1 100644 --- a/src/hb-config.hh +++ b/src/hb-config.hh @@ -49,7 +49,7 @@ #define HB_NO_COLOR #define HB_NO_GETENV #define HB_NO_MATH -#define HB_NO_NAME_TABLE_AAT +#define HB_NO_OT_NAME_LANGUAGE #define HB_NO_OT_LAYOUT_UNUSED #endif @@ -67,7 +67,7 @@ #endif #ifdef HB_NO_AAT -#define HB_NO_NAME_TABLE_AAT +#define HB_NO_OT_NAME_LANGUAGE_AAT #define HB_NO_SHAPE_AAT #endif diff --git a/src/hb-ot-name-language-static.hh b/src/hb-ot-name-language-static.hh index fac317856..580e7637b 100644 --- a/src/hb-ot-name-language-static.hh +++ b/src/hb-ot-name-language-static.hh @@ -430,6 +430,9 @@ _hb_ot_name_language_for (unsigned int code, const hb_ot_language_map_t *array, unsigned int len) { +#ifdef HB_NO_OT_NAME_LANGUAGE + return HB_LANGUAGE_INVALID; +#endif const hb_ot_language_map_t *entry = (const hb_ot_language_map_t *) hb_bsearch (&code, array, diff --git a/src/hb-ot-name-table.hh b/src/hb-ot-name-table.hh index e7e32ecf8..332f48533 100644 --- a/src/hb-ot-name-table.hh +++ b/src/hb-ot-name-table.hh @@ -51,6 +51,7 @@ struct NameRecord { hb_language_t language (hb_face_t *face) const { +#ifndef HB_NO_OT_NAME_LANGUAGE unsigned int p = platformID; unsigned int l = languageID; @@ -60,11 +61,12 @@ struct NameRecord if (p == 1) return _hb_ot_name_language_for_mac_code (l); -#ifndef HB_NO_NAME_TABLE_AAT +#ifndef HB_NO_OT_NAME_LANGUAGE_AAT if (p == 0) return _hb_aat_language_get (face, l); #endif +#endif return HB_LANGUAGE_INVALID; }