Skip to content

Commit

Permalink
dev-qt/qtwebengine: add Fedora patch for >= harfbuzz 3
Browse files Browse the repository at this point in the history
I'd like to add the patches Google used for Chromium
but we know this one works and I'd like the tree to be in a
working state. Can swap patches later.

Signed-off-by: Sam James <[email protected]>
  • Loading branch information
thesamesam committed Oct 9, 2021
1 parent 81df654 commit bfaec25
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
https://src.fedoraproject.org/rpms/qt5-qtwebengine/raw/rawhide/f/qtwebengine-harfbuzz.patch
--- a/src/3rdparty/chromium/components/paint_preview/common/subset_font.cc
+++ b/src/3rdparty/chromium/components/paint_preview/common/subset_font.cc
@@ -71,9 +71,9 @@ sk_sp<SkData> SubsetFont(SkTypeface* typeface, const GlyphUsage& usage) {
hb_set_t* glyphs =
hb_subset_input_glyph_set(input.get()); // Owned by |input|.
usage.ForEach(base::BindRepeating(&AddGlyphs, base::Unretained(glyphs)));
- hb_subset_input_set_retain_gids(input.get(), true);
+ hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS);

- HbScoped<hb_face_t> subset_face(hb_subset(face.get(), input.get()));
+ HbScoped<hb_face_t> subset_face(hb_subset_or_fail(face.get(), input.get()));
HbScoped<hb_blob_t> subset_blob(hb_face_reference_blob(subset_face.get()));
if (!subset_blob)
return nullptr;
--- a/src/3rdparty/chromium/third_party/skia/src/pdf/SkPDFSubsetFont.cpp
+++ b/src/3rdparty/chromium/third_party/skia/src/pdf/SkPDFSubsetFont.cpp
@@ -71,11 +71,10 @@ static sk_sp<SkData> subset_harfbuzz(sk_sp<SkData> fontData,
hb_set_t* glyphs = hb_subset_input_glyph_set(input.get());
glyphUsage.getSetValues([&glyphs](unsigned gid) { hb_set_add(glyphs, gid);});

- hb_subset_input_set_retain_gids(input.get(), true);
// TODO: When possible, check if a font is 'tricky' with FT_IS_TRICKY.
// If it isn't known if a font is 'tricky', retain the hints.
- hb_subset_input_set_drop_hints(input.get(), false);
- HBFace subset(hb_subset(face.get(), input.get()));
+ hb_subset_input_set_flags(input.get(), HB_SUBSET_FLAGS_RETAIN_GIDS | HB_SUBSET_FLAGS_NO_HINTING);
+ HBFace subset(hb_subset_or_fail(face.get(), input.get()));
HBBlob result(hb_face_reference_blob(subset.get()));
return to_data(std::move(result));
}

7 changes: 7 additions & 0 deletions dev-qt/qtwebengine/qtwebengine-5.15.2_p20210824-r1.ebuild
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ src_prepare() {
done < <(find src/3rdparty/chromium/third_party/icu -type f "(" -name "*.c" -o -name "*.cpp" -o -name "*.h" ")" 2>/dev/null)
fi

if has_version ">=media-libs/harfbuzz-3.0.0-r1"; then
# We can get away with conditionally applying this with has_version
# because we have a := dep on harfbuzz and the subslot changed
# at 3.0.0.
eapply "${FILESDIR}/qtwebengine-5.15.2_p20210824-harfbuzz-3.0.0.patch"
fi

qt_use_disable_config alsa webengine-alsa src/buildtools/config/linux.pri
qt_use_disable_config pulseaudio webengine-pulseaudio src/buildtools/config/linux.pri

Expand Down

0 comments on commit bfaec25

Please sign in to comment.