Skip to content

Commit 991b741

Browse files
committed
Merge pull request godotengine#97677 from bruvzg/hb1001
Update HarfBuzz to 10.0.1
2 parents 2bd0fd8 + b6a369d commit 991b741

File tree

85 files changed

+6998
-4760
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

85 files changed

+6998
-4760
lines changed

modules/text_server_adv/SCsub

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ if env["builtin_harfbuzz"]:
126126
"src/hb-ucd.cc",
127127
"src/hb-unicode.cc",
128128
# "src/hb-uniscribe.cc",
129+
"src/OT/Var/VARC/VARC.cc",
129130
]
130131

131132
if freetype_enabled:

modules/text_server_adv/gdextension_build/SConstruct

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,6 +387,7 @@ thirdparty_harfbuzz_sources = [
387387
"src/hb-ucd.cc",
388388
"src/hb-unicode.cc",
389389
# "src/hb-uniscribe.cc",
390+
"src/OT/Var/VARC/VARC.cc",
390391
]
391392

392393
if env["freetype_enabled"]:

thirdparty/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ Files extracted from upstream source:
388388
## harfbuzz
389389

390390
- Upstream: https://github.com/harfbuzz/harfbuzz
391-
- Version: 8.5.0 (30485ee8c3d43c553afb9d78b9924cb71c8d2f19, 2024)
391+
- Version: 10.0.1 (a1d9bfe62818ef0fa9cf63b6e6d51436b1c93cbc, 2024)
392392
- License: MIT
393393

394394
Files extracted from upstream source:

thirdparty/harfbuzz/src/OT/Color/COLR/COLR.hh

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public:
7272
hb_map_t current_glyphs;
7373
hb_map_t current_layers;
7474
int depth_left = HB_MAX_NESTING_LEVEL;
75-
int edge_count = HB_COLRV1_MAX_EDGE_COUNT;
75+
int edge_count = HB_MAX_GRAPH_EDGE_COUNT;
7676

7777
hb_paint_context_t (const void *base_,
7878
hb_paint_funcs_t *funcs_,
@@ -2339,15 +2339,21 @@ struct COLR
23392339
c->plan->colrv1_varstore_inner_maps.as_array ()))
23402340
return_trace (false);
23412341

2342-
if (!out->varStore.serialize_serialize (c->serializer,
2342+
/* do not serialize varStore if there's no variation data after
2343+
* instancing: region_list or var_data is empty */
2344+
if (item_vars.get_region_list () &&
2345+
item_vars.get_vardata_encodings () &&
2346+
!out->varStore.serialize_serialize (c->serializer,
23432347
item_vars.has_long_word (),
23442348
c->plan->axis_tags,
23452349
item_vars.get_region_list (),
23462350
item_vars.get_vardata_encodings ()))
23472351
return_trace (false);
23482352

23492353
/* if varstore is optimized, update colrv1_new_deltaset_idx_varidx_map in
2350-
* subset plan */
2354+
* subset plan.
2355+
* If varstore is empty after instancing, varidx_map would be empty and
2356+
* all var_idxes will be updated to VarIdx::NO_VARIATION */
23512357
if (optimize)
23522358
{
23532359
const hb_map_t &varidx_map = item_vars.get_varidx_map ();
@@ -2579,10 +2585,6 @@ struct COLR
25792585
{
25802586
// COLRv1 glyph
25812587

2582-
ItemVarStoreInstancer instancer (&(this+varStore),
2583-
&(this+varIdxMap),
2584-
hb_array (font->coords, font->num_coords));
2585-
25862588
bool is_bounded = true;
25872589
if (clip)
25882590
{

thirdparty/harfbuzz/src/OT/Layout/GDEF/GDEF.hh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -633,8 +633,8 @@ struct GDEFVersion1_2
633633
ligCaretList.sanitize (c, this) &&
634634
markAttachClassDef.sanitize (c, this) &&
635635
hb_barrier () &&
636-
(version.to_int () < 0x00010002u || markGlyphSetsDef.sanitize (c, this)) &&
637-
(version.to_int () < 0x00010003u || varStore.sanitize (c, this)));
636+
((version.to_int () < 0x00010002u && hb_barrier ()) || markGlyphSetsDef.sanitize (c, this)) &&
637+
((version.to_int () < 0x00010003u && hb_barrier ()) || varStore.sanitize (c, this)));
638638
}
639639

640640
static void remap_varidx_after_instantiation (const hb_map_t& varidx_map,
@@ -668,13 +668,13 @@ struct GDEFVersion1_2
668668
// the end of the GDEF table.
669669
// See: https://github.com/harfbuzz/harfbuzz/issues/4636
670670
auto snapshot_version0 = c->serializer->snapshot ();
671-
if (unlikely (version.to_int () >= 0x00010002u && !c->serializer->embed (markGlyphSetsDef)))
671+
if (unlikely (version.to_int () >= 0x00010002u && hb_barrier () && !c->serializer->embed (markGlyphSetsDef)))
672672
return_trace (false);
673673

674674
bool subset_varstore = false;
675675
unsigned varstore_index = (unsigned) -1;
676676
auto snapshot_version2 = c->serializer->snapshot ();
677-
if (version.to_int () >= 0x00010003u)
677+
if (version.to_int () >= 0x00010003u && hb_barrier ())
678678
{
679679
if (unlikely (!c->serializer->embed (varStore))) return_trace (false);
680680
if (c->plan->all_axes_pinned)
@@ -712,7 +712,7 @@ struct GDEFVersion1_2
712712
}
713713

714714
bool subset_markglyphsetsdef = false;
715-
if (version.to_int () >= 0x00010002u)
715+
if (version.to_int () >= 0x00010002u && hb_barrier ())
716716
{
717717
subset_markglyphsetsdef = out->markGlyphSetsDef.serialize_subset (c, markGlyphSetsDef, this);
718718
}
@@ -875,7 +875,7 @@ struct GDEF
875875
bool has_mark_glyph_sets () const
876876
{
877877
switch (u.version.major) {
878-
case 1: return u.version.to_int () >= 0x00010002u && u.version1.markGlyphSetsDef != 0;
878+
case 1: return u.version.to_int () >= 0x00010002u && hb_barrier () && u.version1.markGlyphSetsDef != 0;
879879
#ifndef HB_NO_BEYOND_64K
880880
case 2: return u.version2.markGlyphSetsDef != 0;
881881
#endif
@@ -885,7 +885,7 @@ struct GDEF
885885
const MarkGlyphSets &get_mark_glyph_sets () const
886886
{
887887
switch (u.version.major) {
888-
case 1: return u.version.to_int () >= 0x00010002u ? this+u.version1.markGlyphSetsDef : Null(MarkGlyphSets);
888+
case 1: return u.version.to_int () >= 0x00010002u && hb_barrier () ? this+u.version1.markGlyphSetsDef : Null(MarkGlyphSets);
889889
#ifndef HB_NO_BEYOND_64K
890890
case 2: return this+u.version2.markGlyphSetsDef;
891891
#endif
@@ -895,7 +895,7 @@ struct GDEF
895895
bool has_var_store () const
896896
{
897897
switch (u.version.major) {
898-
case 1: return u.version.to_int () >= 0x00010003u && u.version1.varStore != 0;
898+
case 1: return u.version.to_int () >= 0x00010003u && hb_barrier () && u.version1.varStore != 0;
899899
#ifndef HB_NO_BEYOND_64K
900900
case 2: return u.version2.varStore != 0;
901901
#endif
@@ -905,7 +905,7 @@ struct GDEF
905905
const ItemVariationStore &get_var_store () const
906906
{
907907
switch (u.version.major) {
908-
case 1: return u.version.to_int () >= 0x00010003u ? this+u.version1.varStore : Null(ItemVariationStore);
908+
case 1: return u.version.to_int () >= 0x00010003u && hb_barrier () ? this+u.version1.varStore : Null(ItemVariationStore);
909909
#ifndef HB_NO_BEYOND_64K
910910
case 2: return this+u.version2.varStore;
911911
#endif

thirdparty/harfbuzz/src/OT/Layout/GPOS/PairPosFormat2.hh

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -139,14 +139,8 @@ struct PairPosFormat2_4 : ValueBase
139139
return_trace (false);
140140
}
141141

142-
unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint);
143-
if (!klass2)
144-
{
145-
buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1);
146-
return_trace (false);
147-
}
148-
149142
unsigned int klass1 = (this+classDef1).get_class (buffer->cur().codepoint);
143+
unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint);
150144
if (unlikely (klass1 >= class1Count || klass2 >= class2Count))
151145
{
152146
buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1);

0 commit comments

Comments
 (0)