Skip to content

Commit ec8084d

Browse files
committed
HarfBuzz: Update to version 5.2.0, add new Unicode 15 blocks and scripts.
1 parent 4ab3fdc commit ec8084d

File tree

88 files changed

+6623
-3937
lines changed

Some content is hidden

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

88 files changed

+6623
-3937
lines changed

core/string/locales.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1072,6 +1072,7 @@ static const char *script_list[][2] = {
10721072
{ "Jurchen", "Jurc" },
10731073
{ "Kayah Li", "Kali" },
10741074
{ "Katakana", "Kana" },
1075+
{ "Kawi", "Kawi" },
10751076
{ "Kharoshthi", "Khar" },
10761077
{ "Khmer", "Khmr" },
10771078
{ "Khojki", "Khoj" },
@@ -1110,6 +1111,7 @@ static const char *script_list[][2] = {
11101111
{ "Meitei Mayek", "Mtei" },
11111112
{ "Multani", "Mult" },
11121113
{ "Myanmar (Burmese)", "Mymr" },
1114+
{ "​Nag Mundari", "Nagm" },
11131115
{ "Nandinagari", "Nand" },
11141116
{ "Old North Arabian", "Narb" },
11151117
{ "Nabataean", "Nbat" },

editor/import/dynamic_font_import_settings.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,7 @@ static UniRange unicode_ranges[] = {
302302
{ 0x10D00, 0x10D3F, U"Hanifi Rohingya" },
303303
{ 0x10E60, 0x10E7F, U"Rumi Numeral Symbols" },
304304
{ 0x10E80, 0x10EBF, U"Yezidi" },
305+
{ 0x10EC0, 0x10EFF, U"Arabic Extended-C" },
305306
{ 0x10F00, 0x10F2F, U"Old Sogdian" },
306307
{ 0x10F30, 0x10F6F, U"Sogdian" },
307308
{ 0x10F70, 0x10FAF, U"Old Uyghur" },
@@ -333,11 +334,13 @@ static UniRange unicode_ranges[] = {
333334
{ 0x11A50, 0x11AAF, U"Soyombo" },
334335
{ 0x11AB0, 0x11ABF, U"Unified Canadian Aboriginal Syllabics Extended-A" },
335336
{ 0x11AC0, 0x11AFF, U"Pau Cin Hau" },
337+
{ 0x11B00, 0x11B5F, U"Devanagari Extended-A" },
336338
{ 0x11C00, 0x11C6F, U"Bhaiksuki" },
337339
{ 0x11C70, 0x11CBF, U"Marchen" },
338340
{ 0x11D00, 0x11D5F, U"Masaram Gondi" },
339341
{ 0x11D60, 0x11DAF, U"Gunjala Gondi" },
340342
{ 0x11EE0, 0x11EFF, U"Makasar" },
343+
{ 0x11F00, 0x11F5F, U"Kawi" },
341344
{ 0x11FB0, 0x11FBF, U"Lisu Supplement" },
342345
{ 0x11FC0, 0x11FFF, U"Tamil Supplement" },
343346
{ 0x12000, 0x123FF, U"Cuneiform" },
@@ -370,16 +373,19 @@ static UniRange unicode_ranges[] = {
370373
{ 0x1D000, 0x1D0FF, U"Byzantine Musical Symbols" },
371374
{ 0x1D100, 0x1D1FF, U"Musical Symbols" },
372375
{ 0x1D200, 0x1D24F, U"Ancient Greek Musical Notation" },
376+
{ 0x1D2C0, 0x1D2DF, U"Kaktovik Numerals" },
373377
{ 0x1D2E0, 0x1D2FF, U"Mayan Numerals" },
374378
{ 0x1D300, 0x1D35F, U"Tai Xuan Jing Symbols" },
375379
{ 0x1D360, 0x1D37F, U"Counting Rod Numerals" },
376380
{ 0x1D400, 0x1D7FF, U"Mathematical Alphanumeric Symbols" },
377381
{ 0x1D800, 0x1DAAF, U"Sutton SignWriting" },
378382
{ 0x1DF00, 0x1DFFF, U"Latin Extended-G" },
379383
{ 0x1E000, 0x1E02F, U"Glagolitic Supplement" },
384+
{ 0x1E030, 0x1E08F, U"Cyrillic Extended-D" },
380385
{ 0x1E100, 0x1E14F, U"Nyiakeng Puachue Hmong" },
381386
{ 0x1E290, 0x1E2BF, U"Toto" },
382387
{ 0x1E2C0, 0x1E2FF, U"Wancho" },
388+
{ 0x1E4D0, 0x1E4FF, U"Nag Mundari" },
383389
{ 0x1E7E0, 0x1E7FF, U"Ethiopic Extended-B" },
384390
{ 0x1E800, 0x1E8DF, U"Mende Kikakui" },
385391
{ 0x1E900, 0x1E95F, U"Adlam" },
@@ -409,6 +415,7 @@ static UniRange unicode_ranges[] = {
409415
{ 0x2CEB0, 0x2EBEF, U"CJK Unified Ideographs Extension F" },
410416
{ 0x2F800, 0x2FA1F, U"CJK Compatibility Ideographs Supplement" },
411417
{ 0x30000, 0x3134F, U"CJK Unified Ideographs Extension G" },
418+
{ 0x31350, 0x323AF, U"CJK Unified Ideographs Extension H" },
412419
//{ 0xE0000, 0xE007F, U"Tags" },
413420
//{ 0xE0100, 0xE01EF, U"Variation Selectors Supplement" },
414421
{ 0xF0000, 0xFFFFF, U"Supplementary Private Use Area-A" },

thirdparty/README.md

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

216216
- Upstream: https://github.com/harfbuzz/harfbuzz
217-
- Version: 5.1.0 (f1f2be776bcd994fa9262622e1a7098a066e5cf7, 2022)
217+
- Version: 5.2.0 (4a1d891c6317d2c83e5f3c2607ec5f5ccedffcde, 2022)
218218
- License: MIT
219219

220220
Files extracted from upstream source:

thirdparty/harfbuzz/src/OT/Layout/Common/Coverage.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ struct Coverage
206206

207207
template <typename IterableOut,
208208
hb_requires (hb_is_sink_of (IterableOut, hb_codepoint_t))>
209-
void intersect_set (const hb_set_t &glyphs, IterableOut &intersect_glyphs) const
209+
void intersect_set (const hb_set_t &glyphs, IterableOut&& intersect_glyphs) const
210210
{
211211
switch (u.format)
212212
{

thirdparty/harfbuzz/src/OT/Layout/Common/CoverageFormat1.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ struct CoverageFormat1_3
8888

8989
template <typename IterableOut,
9090
hb_requires (hb_is_sink_of (IterableOut, hb_codepoint_t))>
91-
void intersect_set (const hb_set_t &glyphs, IterableOut &intersect_glyphs) const
91+
void intersect_set (const hb_set_t &glyphs, IterableOut&& intersect_glyphs) const
9292
{
9393
unsigned count = glyphArray.len;
9494
for (unsigned i = 0; i < count; i++)

thirdparty/harfbuzz/src/OT/Layout/Common/CoverageFormat2.hh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ struct CoverageFormat2_4
140140

141141
template <typename IterableOut,
142142
hb_requires (hb_is_sink_of (IterableOut, hb_codepoint_t))>
143-
void intersect_set (const hb_set_t &glyphs, IterableOut &intersect_glyphs) const
143+
void intersect_set (const hb_set_t &glyphs, IterableOut&& intersect_glyphs) const
144144
{
145145
for (const auto& range : rangeRecord)
146146
{

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

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ struct Anchor
5858
return_trace (bool (reinterpret_cast<Anchor *> (u.format1.copy (c->serializer))));
5959
}
6060
return_trace (bool (reinterpret_cast<Anchor *> (u.format2.copy (c->serializer))));
61-
case 3: return_trace (bool (reinterpret_cast<Anchor *> (u.format3.copy (c->serializer,
62-
c->plan->layout_variation_idx_map))));
61+
case 3: return_trace (u.format3.subset (c));
6362
default:return_trace (false);
6463
}
6564
}

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

Lines changed: 40 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -41,24 +41,54 @@ struct AnchorFormat3
4141
*y += (this+yDeviceTable).get_y_delta (font, c->var_store, c->var_store_cache);
4242
}
4343

44-
AnchorFormat3* copy (hb_serialize_context_t *c,
45-
const hb_map_t *layout_variation_idx_map) const
44+
bool subset (hb_subset_context_t *c) const
4645
{
47-
TRACE_SERIALIZE (this);
48-
if (!layout_variation_idx_map) return_trace (nullptr);
46+
TRACE_SUBSET (this);
47+
auto *out = c->serializer->start_embed (*this);
48+
if (unlikely (!out)) return_trace (false);
49+
if (unlikely (!c->serializer->embed (format))) return_trace (false);
50+
if (unlikely (!c->serializer->embed (xCoordinate))) return_trace (false);
51+
if (unlikely (!c->serializer->embed (yCoordinate))) return_trace (false);
4952

50-
auto *out = c->embed<AnchorFormat3> (this);
51-
if (unlikely (!out)) return_trace (nullptr);
53+
unsigned x_varidx = xDeviceTable ? (this+xDeviceTable).get_variation_index () : HB_OT_LAYOUT_NO_VARIATIONS_INDEX;
54+
if (c->plan->layout_variation_idx_delta_map->has (x_varidx))
55+
{
56+
int delta = hb_second (c->plan->layout_variation_idx_delta_map->get (x_varidx));
57+
if (delta != 0)
58+
{
59+
if (!c->serializer->check_assign (out->xCoordinate, xCoordinate + delta,
60+
HB_SERIALIZE_ERROR_INT_OVERFLOW))
61+
return_trace (false);
62+
}
63+
}
5264

53-
out->xDeviceTable.serialize_copy (c, xDeviceTable, this, 0, hb_serialize_context_t::Head, layout_variation_idx_map);
54-
out->yDeviceTable.serialize_copy (c, yDeviceTable, this, 0, hb_serialize_context_t::Head, layout_variation_idx_map);
65+
unsigned y_varidx = yDeviceTable ? (this+yDeviceTable).get_variation_index () : HB_OT_LAYOUT_NO_VARIATIONS_INDEX;
66+
if (c->plan->layout_variation_idx_delta_map->has (y_varidx))
67+
{
68+
int delta = hb_second (c->plan->layout_variation_idx_delta_map->get (y_varidx));
69+
if (delta != 0)
70+
{
71+
if (!c->serializer->check_assign (out->yCoordinate, yCoordinate + delta,
72+
HB_SERIALIZE_ERROR_INT_OVERFLOW))
73+
return_trace (false);
74+
}
75+
}
76+
77+
if (c->plan->all_axes_pinned)
78+
return_trace (c->serializer->check_assign (out->format, 1, HB_SERIALIZE_ERROR_INT_OVERFLOW));
79+
80+
if (!c->serializer->embed (xDeviceTable)) return_trace (false);
81+
if (!c->serializer->embed (yDeviceTable)) return_trace (false);
82+
83+
out->xDeviceTable.serialize_copy (c->serializer, xDeviceTable, this, 0, hb_serialize_context_t::Head, c->plan->layout_variation_idx_delta_map);
84+
out->yDeviceTable.serialize_copy (c->serializer, yDeviceTable, this, 0, hb_serialize_context_t::Head, c->plan->layout_variation_idx_delta_map);
5585
return_trace (out);
5686
}
5787

5888
void collect_variation_indices (hb_collect_variation_indices_context_t *c) const
5989
{
60-
(this+xDeviceTable).collect_variation_indices (c->layout_variation_indices);
61-
(this+yDeviceTable).collect_variation_indices (c->layout_variation_indices);
90+
(this+xDeviceTable).collect_variation_indices (c);
91+
(this+yDeviceTable).collect_variation_indices (c);
6292
}
6393
};
6494

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ template<typename Iterator, typename SrcLookup>
2222
static void SinglePos_serialize (hb_serialize_context_t *c,
2323
const SrcLookup *src,
2424
Iterator it,
25-
const hb_map_t *layout_variation_idx_map);
25+
const hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map,
26+
bool all_axes_pinned);
2627

2728

2829
}

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ struct MarkRecord
99
{
1010
friend struct MarkArray;
1111

12-
protected:
12+
public:
1313
HBUINT16 klass; /* Class defined for this mark */
1414
Offset16To<Anchor>
1515
markAnchor; /* Offset to Anchor table--from

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,12 @@ struct PairPosFormat1_3
127127
out->valueFormat[1] = newFormats.second;
128128
}
129129

130+
if (c->plan->all_axes_pinned)
131+
{
132+
out->valueFormat[0] = out->valueFormat[0].drop_device_table_flags ();
133+
out->valueFormat[1] = out->valueFormat[1].drop_device_table_flags ();
134+
}
135+
130136
hb_sorted_vector_t<hb_codepoint_t> new_coverage;
131137

132138
+ hb_zip (this+coverage, pairSet)

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

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -274,13 +274,19 @@ struct PairPosFormat2_4
274274
out->valueFormat1 = newFormats.first;
275275
out->valueFormat2 = newFormats.second;
276276

277+
if (c->plan->all_axes_pinned)
278+
{
279+
out->valueFormat1 = out->valueFormat1.drop_device_table_flags ();
280+
out->valueFormat2 = out->valueFormat2.drop_device_table_flags ();
281+
}
282+
277283
for (unsigned class1_idx : + hb_range ((unsigned) class1Count) | hb_filter (klass1_map))
278284
{
279285
for (unsigned class2_idx : + hb_range ((unsigned) class2Count) | hb_filter (klass2_map))
280286
{
281287
unsigned idx = (class1_idx * (unsigned) class2Count + class2_idx) * (len1 + len2);
282-
valueFormat1.copy_values (c->serializer, newFormats.first, this, &values[idx], c->plan->layout_variation_idx_map);
283-
valueFormat2.copy_values (c->serializer, newFormats.second, this, &values[idx + len1], c->plan->layout_variation_idx_map);
288+
valueFormat1.copy_values (c->serializer, out->valueFormat1, this, &values[idx], c->plan->layout_variation_idx_delta_map);
289+
valueFormat2.copy_values (c->serializer, out->valueFormat2, this, &values[idx + len1], c->plan->layout_variation_idx_delta_map);
284290
}
285291
}
286292

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ struct PairSet
163163
newFormats,
164164
len1,
165165
&glyph_map,
166-
c->plan->layout_variation_idx_map
166+
c->plan->layout_variation_idx_delta_map
167167
};
168168

169169
const PairValueRecord *record = &firstPairValueRecord;

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ struct PairValueRecord
3434
const ValueFormat *newFormats;
3535
unsigned len1; /* valueFormats[0].get_len() */
3636
const hb_map_t *glyph_map;
37-
const hb_map_t *layout_variation_idx_map;
37+
const hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map;
3838
};
3939

4040
bool subset (hb_subset_context_t *c,
@@ -50,12 +50,12 @@ struct PairValueRecord
5050
closure->valueFormats[0].copy_values (s,
5151
closure->newFormats[0],
5252
closure->base, &values[0],
53-
closure->layout_variation_idx_map);
53+
closure->layout_variation_idx_delta_map);
5454
closure->valueFormats[1].copy_values (s,
5555
closure->newFormats[1],
5656
closure->base,
5757
&values[closure->len1],
58-
closure->layout_variation_idx_map);
58+
closure->layout_variation_idx_delta_map);
5959

6060
return_trace (true);
6161
}

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

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,16 @@ struct SinglePos
3838
void serialize (hb_serialize_context_t *c,
3939
const SrcLookup* src,
4040
Iterator glyph_val_iter_pairs,
41-
const hb_map_t *layout_variation_idx_map)
41+
const hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map,
42+
bool all_axes_pinned)
4243
{
4344
if (unlikely (!c->extend_min (u.format))) return;
4445
unsigned format = 2;
4546
ValueFormat new_format = src->get_value_format ();
4647

48+
if (all_axes_pinned)
49+
new_format = new_format.drop_device_table_flags ();
50+
4751
if (glyph_val_iter_pairs)
4852
format = get_format (glyph_val_iter_pairs);
4953

@@ -53,13 +57,13 @@ struct SinglePos
5357
src,
5458
glyph_val_iter_pairs,
5559
new_format,
56-
layout_variation_idx_map);
60+
layout_variation_idx_delta_map);
5761
return;
5862
case 2: u.format2.serialize (c,
5963
src,
6064
glyph_val_iter_pairs,
6165
new_format,
62-
layout_variation_idx_map);
66+
layout_variation_idx_delta_map);
6367
return;
6468
default:return;
6569
}
@@ -84,8 +88,9 @@ static void
8488
SinglePos_serialize (hb_serialize_context_t *c,
8589
const SrcLookup *src,
8690
Iterator it,
87-
const hb_map_t *layout_variation_idx_map)
88-
{ c->start_embed<SinglePos> ()->serialize (c, src, it, layout_variation_idx_map); }
91+
const hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map,
92+
bool all_axes_pinned)
93+
{ c->start_embed<SinglePos> ()->serialize (c, src, it, layout_variation_idx_delta_map, all_axes_pinned); }
8994

9095

9196
}

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ struct SinglePosFormat1
8787
const SrcLookup *src,
8888
Iterator it,
8989
ValueFormat newFormat,
90-
const hb_map_t *layout_variation_idx_map)
90+
const hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map)
9191
{
9292
if (unlikely (!c->extend_min (this))) return;
9393
if (unlikely (!c->check_assign (valueFormat,
@@ -96,7 +96,7 @@ struct SinglePosFormat1
9696

9797
for (const hb_array_t<const Value>& _ : + it | hb_map (hb_second))
9898
{
99-
src->get_value_format ().copy_values (c, newFormat, src, &_, layout_variation_idx_map);
99+
src->get_value_format ().copy_values (c, newFormat, src, &_, layout_variation_idx_delta_map);
100100
// Only serialize the first entry in the iterator, the rest are assumed to
101101
// be the same.
102102
break;
@@ -126,7 +126,7 @@ struct SinglePosFormat1
126126
;
127127

128128
bool ret = bool (it);
129-
SinglePos_serialize (c->serializer, this, it, c->plan->layout_variation_idx_map);
129+
SinglePos_serialize (c->serializer, this, it, c->plan->layout_variation_idx_delta_map, c->plan->all_axes_pinned);
130130
return_trace (ret);
131131
}
132132
};

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ struct SinglePosFormat2
9999
const SrcLookup *src,
100100
Iterator it,
101101
ValueFormat newFormat,
102-
const hb_map_t *layout_variation_idx_map)
102+
const hb_hashmap_t<unsigned, hb_pair_t<unsigned, int>> *layout_variation_idx_delta_map)
103103
{
104104
auto out = c->extend_min (this);
105105
if (unlikely (!out)) return;
@@ -109,7 +109,7 @@ struct SinglePosFormat2
109109
+ it
110110
| hb_map (hb_second)
111111
| hb_apply ([&] (hb_array_t<const Value> _)
112-
{ src->get_value_format ().copy_values (c, newFormat, src, &_, layout_variation_idx_map); })
112+
{ src->get_value_format ().copy_values (c, newFormat, src, &_, layout_variation_idx_delta_map); })
113113
;
114114

115115
auto glyphs =
@@ -141,7 +141,7 @@ struct SinglePosFormat2
141141
;
142142

143143
bool ret = bool (it);
144-
SinglePos_serialize (c->serializer, this, it, c->plan->layout_variation_idx_map);
144+
SinglePos_serialize (c->serializer, this, it, c->plan->layout_variation_idx_delta_map, c->plan->all_axes_pinned);
145145
return_trace (ret);
146146
}
147147
};

0 commit comments

Comments
 (0)