[librsvg: 1/13] Convert the test for #804 into a reference test




commit 5f5c3b124f3e7132578322509f6db5b30f80af6a
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed Nov 3 21:43:31 2021 -0600

    Convert the test for #804 into a reference test
    
    The PNG reference wasn't the same as the result when using Harfbuzz
    3.0.0 (the test suite still assumes Harfbuzz 2.9.x).
    
    Part-of: <https://gitlab.gnome.org/GNOME/librsvg/-/merge_requests/626>

 .../reftests/bugs/804-tspan-direction-change-ref.png     | Bin 2574 -> 0 bytes
 tests/fixtures/text/804-tspan-direction-change-ref.svg   |   7 +++++++
 .../bugs => text}/804-tspan-direction-change.svg         |   4 ++--
 tests/src/text.rs                                        |   6 ++++++
 4 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/tests/fixtures/text/804-tspan-direction-change-ref.svg 
b/tests/fixtures/text/804-tspan-direction-change-ref.svg
new file mode 100644
index 000000000..29a50b045
--- /dev/null
+++ b/tests/fixtures/text/804-tspan-direction-change-ref.svg
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg";
+     width="600" height="72" viewBox="0 0 600 72">
+
+  <text x="100" y="50" text-anchor="start" font-size="20">00-24-AF-2A-55-FC :MAC כתובת</text>
+
+</svg>
diff --git a/tests/fixtures/reftests/bugs/804-tspan-direction-change.svg 
b/tests/fixtures/text/804-tspan-direction-change.svg
similarity index 77%
rename from tests/fixtures/reftests/bugs/804-tspan-direction-change.svg
rename to tests/fixtures/text/804-tspan-direction-change.svg
index 752669856..1620bd7de 100644
--- a/tests/fixtures/reftests/bugs/804-tspan-direction-change.svg
+++ b/tests/fixtures/text/804-tspan-direction-change.svg
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="utf-8"?>
 <svg xmlns="http://www.w3.org/2000/svg";
-     width="100%" height="100%" viewBox="0 0 600 72"
+     width="600" height="72" viewBox="0 0 600 72"
      direction="rtl" xml:lang="he">
 
   <title direction="ltr" xml:lang="en">Right-to-left Text</title>
@@ -9,7 +9,7 @@
     in documents that predominantly use right-to-left languages.
   </desc>
 
-  <text x="300" y="50" text-anchor="middle" font-size="20"> כתובת MAC:&#x200F;
+  <text x="100" y="50" text-anchor="end" font-size="20"> כתובת MAC:&#x200F;
     <tspan direction="ltr" unicode-bidi="embed">00-24-AF-2A-55-FC</tspan> 
   </text>
 
diff --git a/tests/src/text.rs b/tests/src/text.rs
index 779fb1274..07d77801d 100644
--- a/tests/src/text.rs
+++ b/tests/src/text.rs
@@ -40,6 +40,12 @@ test_svg_reference!(
     "tests/fixtures/text/span-bounds-when-offset-by-dx-ref.svg"
 );
 
+test_svg_reference!(
+    tspan_direction_change_804,
+    "tests/fixtures/text/804-tspan-direction-change.svg",
+    "tests/fixtures/text/804-tspan-direction-change-ref.svg"
+);
+
 test_svg_reference!(
     unicode_bidi_override,
     "tests/fixtures/text/unicode-bidi-override.svg",


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]