diff options
author | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-05-17 18:14:19 +0300 |
---|---|---|
committer | bruvzg <7645683+bruvzg@users.noreply.github.com> | 2022-05-17 18:39:31 +0300 |
commit | 93fba7ead33b45a6f9904ab6a69ada72e8564230 (patch) | |
tree | 2d29c9b6ebaec415bdce2100e2319fcb651d8bbe /thirdparty/harfbuzz | |
parent | 7ea8cde9834b0fda4a928217b7880da3dd330214 (diff) |
Update HarfBuzz, ICU and FreeType.
HarfBuzz: Update to version 4.2.1
FreeType: Update to version 2.12.1
ICU: Update to version 71.1
Diffstat (limited to 'thirdparty/harfbuzz')
-rw-r--r-- | thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh | 4 | ||||
-rw-r--r-- | thirdparty/harfbuzz/src/hb-blob.cc | 4 | ||||
-rw-r--r-- | thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh | 14 | ||||
-rw-r--r-- | thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc | 9 | ||||
-rw-r--r-- | thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc | 3 | ||||
-rw-r--r-- | thirdparty/harfbuzz/src/hb-ot-shape.cc | 26 | ||||
-rw-r--r-- | thirdparty/harfbuzz/src/hb-version.h | 4 |
7 files changed, 38 insertions, 26 deletions
diff --git a/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh b/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh index 2f99510925..b77c1f4d44 100644 --- a/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh +++ b/thirdparty/harfbuzz/src/hb-aat-layout-morx-table.hh @@ -1038,12 +1038,12 @@ struct Chain goto skip; if (reverse) - _hb_ot_layout_reverse_graphemes (c->buffer); + c->buffer->reverse (); subtable->apply (c); if (reverse) - _hb_ot_layout_reverse_graphemes (c->buffer); + c->buffer->reverse (); (void) c->buffer->message (c->font, "end chainsubtable %d", c->lookup_index); diff --git a/thirdparty/harfbuzz/src/hb-blob.cc b/thirdparty/harfbuzz/src/hb-blob.cc index f120002d17..65e44c7f6a 100644 --- a/thirdparty/harfbuzz/src/hb-blob.cc +++ b/thirdparty/harfbuzz/src/hb-blob.cc @@ -631,7 +631,7 @@ hb_blob_create_from_file_or_fail (const char *file_name) Allison Lortie permission but changed a lot to suit our need. */ #if defined(HAVE_MMAP) && !defined(HB_NO_MMAP) hb_mapped_file_t *file = (hb_mapped_file_t *) hb_calloc (1, sizeof (hb_mapped_file_t)); - if (unlikely (!file)) return hb_blob_get_empty (); + if (unlikely (!file)) return nullptr; int fd = open (file_name, O_RDONLY | O_BINARY, 0); if (unlikely (fd == -1)) goto fail_without_close; @@ -671,7 +671,7 @@ fail_without_close: #elif defined(_WIN32) && !defined(HB_NO_MMAP) hb_mapped_file_t *file = (hb_mapped_file_t *) hb_calloc (1, sizeof (hb_mapped_file_t)); - if (unlikely (!file)) return hb_blob_get_empty (); + if (unlikely (!file)) return nullptr; HANDLE fd; unsigned int size = strlen (file_name) + 1; diff --git a/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh b/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh index 3faa1e53d5..56e8c5b006 100644 --- a/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh +++ b/thirdparty/harfbuzz/src/hb-ot-layout-gsubgpos.hh @@ -1415,11 +1415,6 @@ static inline void apply_lookup (hb_ot_apply_context_t *c, if (idx >= count) continue; - /* Don't recurse to ourself at same position. - * Note that this test is too naive, it doesn't catch longer loops. */ - if (unlikely (idx == 0 && lookupRecord[i].lookupListIndex == c->lookup_index)) - continue; - unsigned int orig_len = buffer->backtrack_len () + buffer->lookahead_len (); /* This can happen if earlier recursed lookups deleted many entries. */ @@ -1457,11 +1452,10 @@ static inline void apply_lookup (hb_ot_apply_context_t *c, * NOT the one after it. * * - If buffer length was decreased by n, it does not necessarily - * mean that n match positions where removed, as there might - * have been marks and default-ignorables in the sequence. We - * should instead drop match positions between current-position - * and current-position + n instead. Though, am not sure which - * one is better. Both cases have valid uses. Sigh. + * mean that n match positions where removed, as there recursed-to + * lookup might had a different LookupFlag. Here's a constructed + * case of that: + * https://github.com/harfbuzz/harfbuzz/discussions/3538 * * It should be possible to construct tests for both of these cases. */ diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc b/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc index d7ec1632ea..a7d5bf574b 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shape-complex-khmer.cc @@ -110,7 +110,14 @@ collect_features_khmer (hb_ot_shape_planner_t *plan) map->enable_feature (HB_TAG('l','o','c','l'), F_PER_SYLLABLE); map->enable_feature (HB_TAG('c','c','m','p'), F_PER_SYLLABLE); - for (unsigned i = 0; i < KHMER_NUM_FEATURES; i++) + unsigned int i = 0; + for (; i < KHMER_BASIC_FEATURES; i++) + map->add_feature (khmer_features[i]); + + /* https://github.com/harfbuzz/harfbuzz/issues/3531 */ + map->add_gsub_pause (nullptr); + + for (; i < KHMER_NUM_FEATURES; i++) map->add_feature (khmer_features[i]); } diff --git a/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc b/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc index c7aa80a79a..13beaf4d4c 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shape-complex-myanmar.cc @@ -105,8 +105,7 @@ setup_masks_myanmar (const hb_ot_shape_plan_t *plan HB_UNUSED, HB_BUFFER_ALLOCATE_VAR (buffer, myanmar_category); HB_BUFFER_ALLOCATE_VAR (buffer, myanmar_position); - /* We cannot setup masks here. We save information about characters - * and setup masks later on in a pause-callback. */ + /* No masks, we just save information about characters. */ unsigned int count = buffer->len; hb_glyph_info_t *info = buffer->info; diff --git a/thirdparty/harfbuzz/src/hb-ot-shape.cc b/thirdparty/harfbuzz/src/hb-ot-shape.cc index 298cf47786..99aadab3f0 100644 --- a/thirdparty/harfbuzz/src/hb-ot-shape.cc +++ b/thirdparty/harfbuzz/src/hb-ot-shape.cc @@ -47,6 +47,9 @@ #include "hb-aat-layout.hh" +static inline bool +_hb_codepoint_is_regional_indicator (hb_codepoint_t u) +{ return hb_in_range<hb_codepoint_t> (u, 0x1F1E6u, 0x1F1FFu); } #ifndef HB_NO_AAT_SHAPE static inline bool @@ -504,9 +507,9 @@ hb_set_unicode_props (hb_buffer_t *buffer) } /* Regional_Indicators are hairy as hell... * https://github.com/harfbuzz/harfbuzz/issues/2265 */ - else if (unlikely (i && hb_in_range<hb_codepoint_t> (info[i].codepoint, 0x1F1E6u, 0x1F1FFu))) + else if (unlikely (i && _hb_codepoint_is_regional_indicator (info[i].codepoint))) { - if (hb_in_range<hb_codepoint_t> (info[i - 1].codepoint, 0x1F1E6u, 0x1F1FFu) && + if (_hb_codepoint_is_regional_indicator (info[i - 1].codepoint) && !_hb_glyph_info_is_continuation (&info[i - 1])) _hb_glyph_info_set_continuation (&info[i]); } @@ -598,24 +601,33 @@ hb_ensure_native_direction (hb_buffer_t *buffer) * direction, so that features like ligatures will work as intended. * * https://github.com/harfbuzz/harfbuzz/issues/501 + * + * Similar thing about Regional_Indicators; They are bidi=L, but Script=Common. + * If they are present in a run of natively-RTL text, they get assigned a script + * with natively RTL direction, which would result in wrong shaping if we + * assign such native RTL direction to them then. Detect that as well. + * + * https://github.com/harfbuzz/harfbuzz/issues/3314 */ if (unlikely (horiz_dir == HB_DIRECTION_RTL && direction == HB_DIRECTION_LTR)) { - bool found_number = false, found_letter = false; + bool found_number = false, found_letter = false, found_ri = false; const auto* info = buffer->info; const auto count = buffer->len; for (unsigned i = 0; i < count; i++) { auto gc = _hb_glyph_info_get_general_category (&info[i]); if (gc == HB_UNICODE_GENERAL_CATEGORY_DECIMAL_NUMBER) - found_number = true; + found_number = true; else if (HB_UNICODE_GENERAL_CATEGORY_IS_LETTER (gc)) { - found_letter = true; - break; + found_letter = true; + break; } + else if (_hb_codepoint_is_regional_indicator (info[i].codepoint)) + found_ri = true; } - if (found_number && !found_letter) + if ((found_number || found_ri) && !found_letter) horiz_dir = HB_DIRECTION_LTR; } diff --git a/thirdparty/harfbuzz/src/hb-version.h b/thirdparty/harfbuzz/src/hb-version.h index 39fbde45c1..94c73e15bf 100644 --- a/thirdparty/harfbuzz/src/hb-version.h +++ b/thirdparty/harfbuzz/src/hb-version.h @@ -53,14 +53,14 @@ HB_BEGIN_DECLS * * The micro component of the library version available at compile-time. */ -#define HB_VERSION_MICRO 0 +#define HB_VERSION_MICRO 1 /** * HB_VERSION_STRING: * * A string literal containing the library version available at compile-time. */ -#define HB_VERSION_STRING "4.2.0" +#define HB_VERSION_STRING "4.2.1" /** * HB_VERSION_ATLEAST: |