Roll HarfBuzz to version 3.1.1 (flutter/engine#30354)

Also migrates to the HarfBuzz 3.x font subsetting API
(see https://github.com/flutter/engine/pull/29266)
This commit is contained in:
Jason Simmons
2021-12-16 08:13:08 -08:00
committed by GitHub
parent 522e4f06b6
commit de66470b44
6 changed files with 9 additions and 18 deletions

2
DEPS
View File

@@ -114,7 +114,7 @@ deps = {
Var('fuchsia_git') + '/third_party/rapidjson' + '@' + 'ef3564c5c8824989393b87df25355baf35ff544b',
'src/third_party/harfbuzz':
Var('fuchsia_git') + '/third_party/harfbuzz' + '@' + '047b946d1d0a159d7ef9691a44a91bd1253aec6b',
Var('flutter_git') + '/third_party/harfbuzz' + '@' + 'd40d15e994ed60d32bcfc9ab87004dfb028dfbd6',
'src/third_party/libcxx':
Var('fuchsia_git') + '/third_party/libcxx' + '@' + '7524ef50093a376f334a62a7e5cebf5d238d4c99',

View File

@@ -5592,9 +5592,9 @@ TEST_F(ParagraphTest, LINUX_ONLY(KernScaleParagraph)) {
EXPECT_DOUBLE_EQ(paragraph->records_[0].offset().x(), 0);
EXPECT_DOUBLE_EQ(paragraph->records_[1].offset().x(), 0);
EXPECT_DOUBLE_EQ(paragraph->records_[2].offset().x(), 207.359375f);
EXPECT_DOUBLE_EQ(paragraph->records_[3].offset().x(), 230.859375f);
EXPECT_DOUBLE_EQ(paragraph->records_[4].offset().x(), 253.34765625f);
EXPECT_DOUBLE_EQ(paragraph->records_[2].offset().x(), 207.3671875f);
EXPECT_DOUBLE_EQ(paragraph->records_[3].offset().x(), 230.8671875f);
EXPECT_DOUBLE_EQ(paragraph->records_[4].offset().x(), 253.35546875f);
}
TEST_F(ParagraphTest, DISABLE_ON_WINDOWS(NewlineParagraph)) {

View File

@@ -3,6 +3,7 @@
// found in the LICENSE file.
#include <hb-subset.h>
#include <cstdlib>
#include <fstream>
#include <iostream>
@@ -58,27 +59,17 @@ struct HarfBuzzSubset {
// The prior version of harfbuzz automatically dropped layout tables,
// but in the new version they are kept by default. So re-add them to the
// drop list to retain the same behaviour.
hb_set_add(hb_subset_input_drop_tables_set(input),
hb_set_add(hb_subset_input_set(input, HB_SUBSET_SETS_DROP_TABLE_TAG),
HB_TAG('G', 'S', 'U', 'B'));
hb_set_add(hb_subset_input_drop_tables_set(input),
hb_set_add(hb_subset_input_set(input, HB_SUBSET_SETS_DROP_TABLE_TAG),
HB_TAG('G', 'P', 'O', 'S'));
hb_set_add(hb_subset_input_drop_tables_set(input),
hb_set_add(hb_subset_input_set(input, HB_SUBSET_SETS_DROP_TABLE_TAG),
HB_TAG('G', 'D', 'E', 'F'));
return HarfbuzzWrappers::HbFacePtr(hb_subset_or_fail(face, input));
}
};
template <typename T>
struct HarfBuzzSubset<T,
void_t<decltype(hb_subset(std::declval<hb_face_t*>(),
std::declval<T>()))>> {
// This is the HarfBuzz 2.0 (non-public) interface, used if it exists.
// This code should be removed as soon as all users are migrated to the newer
// API.
static HarfbuzzWrappers::HbFacePtr Make(hb_face_t* face, T input) {
return HarfbuzzWrappers::HbFacePtr(hb_subset(face, input));
}
};
int main(int argc, char** argv) {
if (argc != 3) {