diff --git a/gfx/wr/webrender/src/platform/unix/font.rs b/gfx/wr/webrender/src/platform/unix/font.rs index 17f4fa953492..e51dc3a590bc 100644 --- a/gfx/wr/webrender/src/platform/unix/font.rs +++ b/gfx/wr/webrender/src/platform/unix/font.rs @@ -482,12 +482,19 @@ impl FontContext { load_flags |= FT_LOAD_NO_BITMAP; } - load_flags |= FT_LOAD_COLOR; + let face_flags = unsafe { (*face).face_flags }; + if (face_flags & (FT_FACE_FLAG_FIXED_SIZES as FT_Long)) != 0 { + // We only set FT_LOAD_COLOR if there are bitmap strikes; + // COLR (color-layer) fonts are handled internally by Gecko, and + // WebRender is just asked to paint individual layers. + load_flags |= FT_LOAD_COLOR; + } + load_flags |= FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH; let (x_scale, y_scale) = font.transform.compute_scale().unwrap_or((1.0, 1.0)); let req_size = font.size.to_f64_px(); - let face_flags = unsafe { (*face).face_flags }; + let mut result = if (face_flags & (FT_FACE_FLAG_FIXED_SIZES as FT_Long)) != 0 && (face_flags & (FT_FACE_FLAG_SCALABLE as FT_Long)) == 0 && (load_flags & FT_LOAD_NO_BITMAP) == 0 { diff --git a/layout/reftests/bugs/1738700-1-ref.html b/layout/reftests/bugs/1738700-1-ref.html new file mode 100644 index 000000000000..08fc81381893 --- /dev/null +++ b/layout/reftests/bugs/1738700-1-ref.html @@ -0,0 +1,40 @@ + + + + “Amiri Quran Colored” test + + +
The colored Arabic text should be exactly covered by (thicker) black text:
+
+

+ ﷽ ۝١ +
+ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَـٰلَمِینَ ۝٢ +ٱلرَّحۡمَـٰنِ ٱلرَّحِیمِ ۝٣ +مَـٰلِكِ یَوۡمِ ٱلدِّینِ ۝٤ +إِیَّاكَ نَعۡبُدُ وَإِیَّاكَ نَسۡتَعِینُ ۝٥ +ٱهۡدِنَا ٱلصِّرَ ٰطَ ٱلۡمُسۡتَقِیمَ ۝٦ +صِرَ ٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ ۝٧ +

+
+ + diff --git a/layout/reftests/bugs/1738700-1.html b/layout/reftests/bugs/1738700-1.html new file mode 100644 index 000000000000..5759b4b534ca --- /dev/null +++ b/layout/reftests/bugs/1738700-1.html @@ -0,0 +1,62 @@ + + + + “Amiri Quran Colored” test + + +
The colored Arabic text should be exactly covered by (thicker) black text:
+
+

+ ﷽ ۝١ +
+ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَـٰلَمِینَ ۝٢ +ٱلرَّحۡمَـٰنِ ٱلرَّحِیمِ ۝٣ +مَـٰلِكِ یَوۡمِ ٱلدِّینِ ۝٤ +إِیَّاكَ نَعۡبُدُ وَإِیَّاكَ نَسۡتَعِینُ ۝٥ +ٱهۡدِنَا ٱلصِّرَ ٰطَ ٱلۡمُسۡتَقِیمَ ۝٦ +صِرَ ٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ ۝٧ +

+
+
+

+ ﷽ ۝١ +
+ٱلۡحَمۡدُ لِلَّهِ رَبِّ ٱلۡعَـٰلَمِینَ ۝٢ +ٱلرَّحۡمَـٰنِ ٱلرَّحِیمِ ۝٣ +مَـٰلِكِ یَوۡمِ ٱلدِّینِ ۝٤ +إِیَّاكَ نَعۡبُدُ وَإِیَّاكَ نَسۡتَعِینُ ۝٥ +ٱهۡدِنَا ٱلصِّرَ ٰطَ ٱلۡمُسۡتَقِیمَ ۝٦ +صِرَ ٰطَ ٱلَّذِینَ أَنۡعَمۡتَ عَلَیۡهِمۡ غَیۡرِ ٱلۡمَغۡضُوبِ عَلَیۡهِمۡ وَلَا ٱلضَّاۤلِّینَ ۝٧ +

+
+ + diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index e9aad5e590fe..e993f1f904cb 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -2104,3 +2104,4 @@ skip-if(!appleSilicon) != 1721223-1.html 1721223-1-notref.html # Big Sur require skip-if(Android) == 1727172-1.xhtml 1727172-1-ref.html == 1726663-1.html 1726663-1-ref.html != 1730314-1.html 1730314-1-ref.html +fuzzy(0-3,0-3) fuzzy-if(Android,0-3,0-180) fuzzy-if(winWidget,0-154,0-118) == 1738700-1.html 1738700-1-ref.html diff --git a/layout/reftests/fonts/AmiriQuran.otf b/layout/reftests/fonts/AmiriQuran.otf new file mode 100644 index 000000000000..5f785bb9671f Binary files /dev/null and b/layout/reftests/fonts/AmiriQuran.otf differ diff --git a/layout/reftests/fonts/AmiriQuranColored.otf b/layout/reftests/fonts/AmiriQuranColored.otf new file mode 100644 index 000000000000..306d826483fb Binary files /dev/null and b/layout/reftests/fonts/AmiriQuranColored.otf differ