diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-03-17 23:34:33 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-03-17 23:34:33 +0000 |
commit | ef4330f77c5622e5e2e9c9935279775d1a42cb98 (patch) | |
tree | 3b89476ac846751f832db80c1792c0b9a1822463 /Build/source/libs/harfbuzz/harfbuzz-src/src | |
parent | c3e45a18cd1d6e3912efb68c36588ff0c86ce75f (diff) |
harfbuzz 1.2.4
git-svn-id: svn://tug.org/texlive/trunk@40059 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/harfbuzz/harfbuzz-src/src')
15 files changed, 103 insertions, 143 deletions
diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am index 2a3d6c79aa7..8cfe4ac7c38 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/Makefile.am @@ -130,7 +130,7 @@ pkgconfig_DATA = harfbuzz.pc EXTRA_DIST += harfbuzz.pc.in FUZZING_CPPFLAGS= \ - -DNDEBUG \ + -DHB_NDEBUG \ -DHB_MAX_NESTING_LEVEL=3 \ -DHB_SANITIZE_MAX_EDITS=3 \ -DHB_BUFFER_MAX_EXPANSION_FACTOR=3 \ @@ -147,6 +147,12 @@ EXTRA_libharfbuzz_fuzzing_la_DEPENDENCIES = $(EXTRA_libharfbuzz_la_DEPENDENCIES) CLEANFILES += libharfbuzz-fuzzing.la if HAVE_ICU +if HAVE_ICU_BUILTIN +HBCFLAGS += $(ICU_CFLAGS) +HBLIBS += $(ICU_LIBS) +HBSOURCES += $(HB_ICU_sources) +HBHEADERS += $(HB_ICU_headers) +else lib_LTLIBRARIES += libharfbuzz-icu.la libharfbuzz_icu_la_SOURCES = $(HB_ICU_sources) libharfbuzz_icu_la_CPPFLAGS = $(ICU_CFLAGS) @@ -155,6 +161,7 @@ libharfbuzz_icu_la_LIBADD = $(ICU_LIBS) libharfbuzz.la pkginclude_HEADERS += $(HB_ICU_headers) pkgconfig_DATA += harfbuzz-icu.pc endif +endif EXTRA_DIST += harfbuzz-icu.pc.in if HAVE_GOBJECT diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-private.hh index c3184cf7653..ed592f4481f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-private.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer-private.hh @@ -124,18 +124,46 @@ struct hb_buffer_t { void *message_data; hb_destroy_func_t message_destroy; -#ifndef NDEBUG /* Internal debugging. */ - /* These reflect current allocations of the bytes in glyph_info_t's var1 and var2. */ - uint8_t allocated_var_bytes[8]; - const char *allocated_var_owner[8]; - HB_INTERNAL void allocate_var (unsigned int byte_i, unsigned int count, const char *owner); - HB_INTERNAL void deallocate_var (unsigned int byte_i, unsigned int count, const char *owner); - HB_INTERNAL void assert_var (unsigned int byte_i, unsigned int count, const char *owner); - HB_INTERNAL void deallocate_var_all (void); -#else - inline void deallocate_var_all (void) {} + /* The bits here reflect current allocations of the bytes in glyph_info_t's var1 and var2. */ +#ifndef HB_NDEBUG + uint8_t allocated_var_bits; #endif + inline void allocate_var (unsigned int start, unsigned int count) + { +#ifndef HB_NDEBUG + unsigned int end = start + count; + assert (end <= 8); + unsigned int bits = (1<<end) - (1<<start); + assert (0 == (allocated_var_bits & bits)); + allocated_var_bits |= bits; +#endif + } + inline void deallocate_var (unsigned int start, unsigned int count) + { +#ifndef HB_NDEBUG + unsigned int end = start + count; + assert (end <= 8); + unsigned int bits = (1<<end) - (1<<start); + assert (bits == (allocated_var_bits & bits)); + allocated_var_bits &= ~bits; +#endif + } + inline void assert_var (unsigned int start, unsigned int count) + { +#ifndef HB_NDEBUG + unsigned int end = start + count; + assert (end <= 8); + unsigned int bits = (1<<end) - (1<<start); + assert (bits == (allocated_var_bits & bits)); +#endif + } + inline void deallocate_var_all (void) + { +#ifndef HB_NDEBUG + allocated_var_bits = 0; +#endif + } /* Methods */ @@ -257,21 +285,12 @@ struct hb_buffer_t { }; -#define HB_BUFFER_XALLOCATE_VAR(b, func, var, owner) \ +#define HB_BUFFER_XALLOCATE_VAR(b, func, var) \ b->func (offsetof (hb_glyph_info_t, var) - offsetof(hb_glyph_info_t, var1), \ - sizeof (b->info[0].var), owner) -#ifndef NDEBUG -#define HB_BUFFER_ALLOCATE_VAR(b, var) \ - HB_BUFFER_XALLOCATE_VAR (b, allocate_var, var (), #var) -#define HB_BUFFER_DEALLOCATE_VAR(b, var) \ - HB_BUFFER_XALLOCATE_VAR (b, deallocate_var, var (), #var) -#define HB_BUFFER_ASSERT_VAR(b, var) \ - HB_BUFFER_XALLOCATE_VAR (b, assert_var, var (), #var) -#else -#define HB_BUFFER_ALLOCATE_VAR(b, var) -#define HB_BUFFER_DEALLOCATE_VAR(b, var) -#define HB_BUFFER_ASSERT_VAR(b, var) -#endif + sizeof (b->info[0].var)) +#define HB_BUFFER_ALLOCATE_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, allocate_var, var ()) +#define HB_BUFFER_DEALLOCATE_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, deallocate_var, var ()) +#define HB_BUFFER_ASSERT_VAR(b, var) HB_BUFFER_XALLOCATE_VAR (b, assert_var, var ()) #endif /* HB_BUFFER_PRIVATE_HH */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc index ea2a70d5b07..406db9c84fc 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-buffer.cc @@ -661,76 +661,6 @@ hb_buffer_t::guess_segment_properties (void) } -#ifndef NDEBUG -static inline void -dump_var_allocation (const hb_buffer_t *buffer) -{ - char buf[80]; - for (unsigned int i = 0; i < 8; i++) - buf[i] = '0' + buffer->allocated_var_bytes[7 - i]; - buf[8] = '\0'; - DEBUG_MSG (BUFFER, buffer, - "Current var allocation: %s", - buf); -} - -void hb_buffer_t::allocate_var (unsigned int byte_i, unsigned int count, const char *owner) -{ - assert (byte_i < 8 && byte_i + count <= 8); - - if (DEBUG_ENABLED (BUFFER)) - dump_var_allocation (this); - DEBUG_MSG (BUFFER, this, - "Allocating var bytes %d..%d for %s", - byte_i, byte_i + count - 1, owner); - - for (unsigned int i = byte_i; i < byte_i + count; i++) { - assert (!allocated_var_bytes[i]); - allocated_var_bytes[i]++; - allocated_var_owner[i] = owner; - } -} - -void hb_buffer_t::deallocate_var (unsigned int byte_i, unsigned int count, const char *owner) -{ - if (DEBUG_ENABLED (BUFFER)) - dump_var_allocation (this); - - DEBUG_MSG (BUFFER, this, - "Deallocating var bytes %d..%d for %s", - byte_i, byte_i + count - 1, owner); - - assert (byte_i < 8 && byte_i + count <= 8); - for (unsigned int i = byte_i; i < byte_i + count; i++) { - assert (allocated_var_bytes[i]); - assert (0 == strcmp (allocated_var_owner[i], owner)); - allocated_var_bytes[i]--; - } -} - -void hb_buffer_t::assert_var (unsigned int byte_i, unsigned int count, const char *owner) -{ - if (DEBUG_ENABLED (BUFFER)) - dump_var_allocation (this); - - DEBUG_MSG (BUFFER, this, - "Asserting var bytes %d..%d for %s", - byte_i, byte_i + count - 1, owner); - - assert (byte_i < 8 && byte_i + count <= 8); - for (unsigned int i = byte_i; i < byte_i + count; i++) { - assert (allocated_var_bytes[i]); - assert (0 == strcmp (allocated_var_owner[i], owner)); - } -} - -void hb_buffer_t::deallocate_var_all (void) -{ - memset (allocated_var_bytes, 0, sizeof (allocated_var_bytes)); - memset (allocated_var_owner, 0, sizeof (allocated_var_owner)); -} -#endif /* NDEBUG */ - /* Public API */ /** diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc index 4953d00f245..6a4823ab5f4 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-font.cc @@ -1538,6 +1538,8 @@ hb_font_get_ppem (hb_font_t *font, } +#ifndef HB_DISABLE_DEPRECATED + /* * Deprecated get_glyph_func(): */ @@ -1660,3 +1662,5 @@ hb_font_funcs_set_glyph_func (hb_font_funcs_t *ffuncs, trampoline, trampoline_destroy); } + +#endif /* HB_DISABLE_DEPRECATED */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc index 24cec9d7266..ee54721fd4c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-icu.cc @@ -36,6 +36,7 @@ #include <unicode/uchar.h> #include <unicode/unorm.h> #include <unicode/ustring.h> +#include <unicode/utf16.h> #include <unicode/uversion.h> diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh index 6a5200087f3..0754ef0ef8e 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-open-type-private.hh @@ -662,6 +662,15 @@ typedef SHORT FWORD; /* 16-bit unsigned integer (USHORT) that describes a quantity in FUnits. */ typedef USHORT UFWORD; +/* 16-bit signed fixed number with the low 14 bits of fraction (2.14). */ +struct F2DOT14 : SHORT +{ + //inline float to_float (void) const { return ???; } + //inline void set_float (float f) { v.set (f * ???); } + public: + DEFINE_SIZE_STATIC (2); +}; + /* Date represented in number of seconds since 12:00 midnight, January 1, * 1904. The value is represented as a signed 64-bit integer. */ struct LONGDATETIME diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh index 9e5af6d10df..dc7aa8469a0 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-glyf-table.hh @@ -90,10 +90,10 @@ struct glyfGlyphHeader * greater than or equal to zero, * this is a simple glyph; if negative, * this is a composite glyph. */ - SHORT xMin; /* Minimum x for coordinate data. */ - SHORT yMin; /* Minimum y for coordinate data. */ - SHORT xMax; /* Maximum x for coordinate data. */ - SHORT yMax; /* Maximum y for coordinate data. */ + FWORD xMin; /* Minimum x for coordinate data. */ + FWORD yMin; /* Minimum y for coordinate data. */ + FWORD xMax; /* Maximum x for coordinate data. */ + FWORD yMax; /* Maximum y for coordinate data. */ DEFINE_SIZE_STATIC (10); }; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh index 49056e67691..a9606b3d27f 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-hmtx-table.hh @@ -44,8 +44,8 @@ namespace OT { struct LongMetric { - USHORT advance; /* Advance width/height. */ - SHORT lsb; /* Leading (left/top) side bearing. */ + UFWORD advance; /* Advance width/height. */ + FWORD lsb; /* Leading (left/top) side bearing. */ public: DEFINE_SIZE_STATIC (4); }; @@ -74,7 +74,7 @@ struct _mtx * be in the array, but that entry is * required. The last entry applies to * all subsequent glyphs. */ - SHORT leadingBearingX[VAR]; /* Here the advance is assumed + FWORD leadingBearingX[VAR]; /* Here the advance is assumed * to be the same as the advance * for the last entry above. The * number of entries in this array is diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh index 38c2c6405a3..7de56cf2a2b 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-layout-gsub-table.hh @@ -1288,10 +1288,28 @@ GSUB::substitute_start (hb_font_t *font, hb_buffer_t *buffer) const GDEF &gdef = *hb_ot_layout_from_face (font->face)->gdef; unsigned int count = buffer->len; + hb_glyph_info_t *info = buffer->info; for (unsigned int i = 0; i < count; i++) { - _hb_glyph_info_set_glyph_props (&buffer->info[i], gdef.get_glyph_props (buffer->info[i].codepoint)); - _hb_glyph_info_clear_lig_props (&buffer->info[i]); + unsigned int props = gdef.get_glyph_props (info[i].codepoint); + if (!props) + { + /* Never mark default-ignorables as marks. + * They won't get in the way of lookups anyway, + * but having them as mark will cause them to be skipped + * over if the lookup-flag says so, but at least for the + * Mongolian variation selectors, looks like Uniscribe + * marks them as non-mark. Some Mongolian fonts without + * GDEF rely on this. Another notable character that + * this applies to is COMBINING GRAPHEME JOINER. */ + props = (_hb_glyph_info_get_general_category (&info[i]) != + HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK || + _hb_glyph_info_is_default_ignorable (&info[i])) ? + HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH : + HB_OT_LAYOUT_GLYPH_PROPS_MARK; + } + _hb_glyph_info_set_glyph_props (&info[i], props); + _hb_glyph_info_clear_lig_props (&info[i]); buffer->info[i].syllable() = 0; } } diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc index 7bdeddbe12b..7822cef8b3c 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-map.cc @@ -204,11 +204,8 @@ hb_ot_map_builder_t::compile (hb_ot_map_t &m) for (unsigned int table_index = 0; table_index < 2; table_index++) { if (required_feature_tag[table_index] == info->tag) - { required_feature_stage[table_index] = info->stage[table_index]; - found = true; - continue; - } + found |= hb_ot_layout_language_find_feature (face, table_tags[table_index], script_index[table_index], diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic.cc index c8fc2b5b675..1e151a77868 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-indic.cc @@ -742,10 +742,6 @@ initial_reordering_consonant_syllable (const hb_ot_shape_plan_t *plan, switch (indic_plan->config->base_pos) { - default: - assert (false); - HB_FALLTHROUGH; - case BASE_POS_LAST: { /* -> starting from the end of the syllable, move backwards */ diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-thai.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-thai.cc index 58392b6a9e1..4322b0d1d63 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-thai.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape-complex-thai.cc @@ -139,7 +139,6 @@ thai_pua_shape (hb_codepoint_t u, thai_action_t action, hb_font_t *font) }; switch (action) { - default: assert (false); HB_FALLTHROUGH; case NOP: return u; case SD: pua_mappings = SD_mappings; break; case SDL: pua_mappings = SDL_mappings; break; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc index 2ba9b78a321..7811cb7f8e8 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-ot-shape.cc @@ -524,32 +524,6 @@ hb_ot_map_glyphs_fast (hb_buffer_t *buffer) } static inline void -hb_synthesize_glyph_classes (hb_ot_shape_context_t *c) -{ - unsigned int count = c->buffer->len; - hb_glyph_info_t *info = c->buffer->info; - for (unsigned int i = 0; i < count; i++) - { - hb_ot_layout_glyph_props_flags_t klass; - - /* Never mark default-ignorables as marks. - * They won't get in the way of lookups anyway, - * but having them as mark will cause them to be skipped - * over if the lookup-flag says so, but at least for the - * Mongolian variation selectors, looks like Uniscribe - * marks them as non-mark. Some Mongolian fonts without - * GDEF rely on this. Another notable character that - * this applies to is COMBINING GRAPHEME JOINER. */ - klass = (_hb_glyph_info_get_general_category (&info[i]) != - HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK || - _hb_glyph_info_is_default_ignorable (&info[i])) ? - HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH : - HB_OT_LAYOUT_GLYPH_PROPS_MARK; - _hb_glyph_info_set_glyph_props (&info[i], klass); - } -} - -static inline void hb_ot_substitute_default (hb_ot_shape_context_t *c) { hb_buffer_t *buffer = c->buffer; @@ -580,9 +554,6 @@ hb_ot_substitute_complex (hb_ot_shape_context_t *c) hb_ot_layout_substitute_start (c->font, buffer); - if (!hb_ot_layout_has_glyph_classes (c->face)) - hb_synthesize_glyph_classes (c); - c->plan->substitute (c->font, buffer); return; diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh index 7afb25803fb..179e4e9f741 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-private.hh @@ -611,6 +611,15 @@ static inline unsigned char TOLOWER (unsigned char c) /* Debug */ +/* HB_NDEBUG disables some sanity checks that are very safe to disable and + * should be disabled in production systems. If NDEBUG is defined, enable + * HB_NDEBUG; but if it's desirable that normal assert()s (which are very + * light-weight) to be enabled, then HB_DEBUG can be defined to disable + * the costlier checks. */ +#ifdef NDEBUG +#define HB_NDEBUG +#endif + #ifndef HB_DEBUG #define HB_DEBUG 0 #endif diff --git a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-private.hh b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-private.hh index 44fbe582e93..ed45374b749 100644 --- a/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-private.hh +++ b/Build/source/libs/harfbuzz/harfbuzz-src/src/hb-unicode-private.hh @@ -224,7 +224,7 @@ HB_UNICODE_FUNCS_IMPLEMENT_CALLBACKS_SIMPLE switch (u) { /* All GC=Zs chars that can use a fallback. */ - default: return NOT_SPACE; /* Shouldn't happen. */ + default: return NOT_SPACE; /* U+1680 OGHAM SPACE MARK */ case 0x0020u: return SPACE; /* U+0020 SPACE */ case 0x00A0u: return SPACE; /* U+00A0 NO-BREAK SPACE */ case 0x2000u: return SPACE_EM_2; /* U+2000 EN QUAD */ |