fonts: Make fast shaping determination platform-independent (#33540)

This makes the determination of whether or not to use fast shaping
platform independent. Previously it was less stringent for Windows,
leading to using it in cases where a font had a GSUB or GPOS table --
which broke proper shaping.

In addition, the test is made platform independent and expanded to be
more complete.

Finally, comments are added indicating that "fast shaping" will be
removed.

Signed-off-by: Martin Robinson <mrobinson@igalia.com>
This commit is contained in:
Martin Robinson 2024-09-25 12:00:36 +02:00 committed by GitHub
parent 6f797709cf
commit 64f32f7ab3
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 129 additions and 116 deletions

View file

@ -211,11 +211,6 @@ impl PlatformFontMethods for PlatformFont {
Some(f)
}
/// Can this font do basic horizontal LTR shaping without Harfbuzz?
fn can_do_fast_shaping(&self) -> bool {
self.face.has_kerning_pairs()
}
fn glyph_h_kerning(&self, first_glyph: GlyphId, second_glyph: GlyphId) -> FractionalPixel {
let adjustment = self
.face