[librsvg/librsvg-2.48] Add a couple of serif fonts for the test suite



commit c65d75f88f70a95327da47a6fa2b3a5350f1c312
Author: Federico Mena Quintero <federico gnome org>
Date:   Wed May 27 17:34:23 2020 -0500

    Add a couple of serif fonts for the test suite
    
    We'll have support for multiple font families soon.  We only test with
    a sans-serif font, so this commit adds two of the Noto Serif faces for
    the test suite.
    
    A few test files that use default font-family (which is "Times New
    Roman" for librsvg) get changed to explicitly use "sans", so their
    reference PNGs still match the output.
    
    Other test files which have both sans and serif fonts, but got
    rendered to sans-only, get their reference PNGs regenerated to match
    the newly available faces.

 .../reftests/bugs/108-font-size-relative.svg        |   6 +++++-
 .../reftests/bugs/310-font-size-at-48dpi.svg        |   3 ++-
 .../fixtures/reftests/bugs/348-font-size-48dpi.svg  |   4 ++--
 .../reftests/bugs/494-text-accumulate-dy.svg        |   2 +-
 tests/fixtures/reftests/include-fallback.svg        |   2 +-
 tests/fixtures/reftests/include-text.svg            |   2 +-
 .../reftests/svg1.1/struct-use-01-t-ref.png         | Bin 14417 -> 14455 bytes
 .../fixtures/reftests/svg1.1/text-text-03-b-ref.png | Bin 20014 -> 22298 bytes
 tests/resources/NotoSerif-rpn9.ttf                  | Bin 0 -> 379452 bytes
 tests/resources/NotoSerifItalic-2Y8w.ttf            | Bin 0 -> 353836 bytes
 tests/test-utils.c                                  |  16 ++++++++--------
 11 files changed, 20 insertions(+), 15 deletions(-)
---
diff --git a/tests/fixtures/reftests/bugs/108-font-size-relative.svg 
b/tests/fixtures/reftests/bugs/108-font-size-relative.svg
index 532c7d2c..41fe8a59 100644
--- a/tests/fixtures/reftests/bugs/108-font-size-relative.svg
+++ b/tests/fixtures/reftests/bugs/108-font-size-relative.svg
@@ -20,6 +20,10 @@
    fill : black;
 }
 
+text {
+   font-family: sans;
+}
+
 .text {
    stroke-width : 0;
    stroke : none;
@@ -57,4 +61,4 @@ Creation timestamp (ISO 8601) 2015-02-06T05:39:42+00:00.
    first release
 
 -->
-</svg>
\ No newline at end of file
+</svg>
diff --git a/tests/fixtures/reftests/bugs/310-font-size-at-48dpi.svg 
b/tests/fixtures/reftests/bugs/310-font-size-at-48dpi.svg
index c495db96..c19d2f4c 100644
--- a/tests/fixtures/reftests/bugs/310-font-size-at-48dpi.svg
+++ b/tests/fixtures/reftests/bugs/310-font-size-at-48dpi.svg
@@ -3,6 +3,7 @@
   xmlns="http://www.w3.org/2000/svg";
   width="512"
   height="512"
+  font-family="sans"
   >
   <g>
     <rect
@@ -59,4 +60,4 @@
       fill="white"
       >I Love Lamp</text>
   </g>
-</svg>
\ No newline at end of file
+</svg>
diff --git a/tests/fixtures/reftests/bugs/348-font-size-48dpi.svg 
b/tests/fixtures/reftests/bugs/348-font-size-48dpi.svg
index d36eceaf..6b21b968 100644
--- a/tests/fixtures/reftests/bugs/348-font-size-48dpi.svg
+++ b/tests/fixtures/reftests/bugs/348-font-size-48dpi.svg
@@ -2,11 +2,11 @@
 <svg version="1.1" xmlns="http://www.w3.org/2000/svg"; viewBox="0 0 400 400">
   <g fill="blue">
     <rect x="48" y="48" width="48" height="48"/>
-    <text style="font-size: 48" x="96" y="96">Hello</text>
+    <text style="font-family: sans; font-size: 48;" x="96" y="96">Hello</text>
   </g>
 
   <g fill="green">
     <rect x="1in" y="2.5in" width="1in" height="1in"/>
-    <text style="font-size: 1in" x="2in" y="3.5in">Hello</text>
+    <text style="font-family: sans; font-size: 1in;" x="2in" y="3.5in">Hello</text>
   </g>
 </svg>
diff --git a/tests/fixtures/reftests/bugs/494-text-accumulate-dy.svg 
b/tests/fixtures/reftests/bugs/494-text-accumulate-dy.svg
index e43808a7..6eea3686 100644
--- a/tests/fixtures/reftests/bugs/494-text-accumulate-dy.svg
+++ b/tests/fixtures/reftests/bugs/494-text-accumulate-dy.svg
@@ -2,7 +2,7 @@
 <svg xmlns="http://www.w3.org/2000/svg"; xml:lang="en"  viewBox="0 0 178 178" version="1.1">
 <style type="text/css">
     svg {
-        font-family: Times;
+        font-family: sans;
         font-size: 44px;
     }
   </style>
diff --git a/tests/fixtures/reftests/include-fallback.svg b/tests/fixtures/reftests/include-fallback.svg
index a471d83d..a5e43594 100644
--- a/tests/fixtures/reftests/include-fallback.svg
+++ b/tests/fixtures/reftests/include-fallback.svg
@@ -2,7 +2,7 @@
 <svg
     xmlns:xi="http://www.w3.org/2001/XInclude";
     width="320" height="240">
-  <text x="10" y="100">
+  <text font-family="sans" x="10" y="100">
     <xi:include href="nonexistent.txt" parse="text" encoding="UTF-8">
       <xi:fallback>Hello fallback!</xi:fallback>
     </xi:include>
diff --git a/tests/fixtures/reftests/include-text.svg b/tests/fixtures/reftests/include-text.svg
index 181a25cb..b966cd73 100644
--- a/tests/fixtures/reftests/include-text.svg
+++ b/tests/fixtures/reftests/include-text.svg
@@ -2,5 +2,5 @@
 <svg
     xmlns:xi="http://www.w3.org/2001/XInclude";
     width="320" height="240">
-  <text x="10" y="100"><xi:include href="text.txt" parse="text" encoding="UTF-8"/></text>
+  <text font-family="sans" x="10" y="100"><xi:include href="text.txt" parse="text" encoding="UTF-8"/></text>
 </svg>
diff --git a/tests/fixtures/reftests/svg1.1/struct-use-01-t-ref.png 
b/tests/fixtures/reftests/svg1.1/struct-use-01-t-ref.png
index 323c6d90..70c17189 100644
Binary files a/tests/fixtures/reftests/svg1.1/struct-use-01-t-ref.png and 
b/tests/fixtures/reftests/svg1.1/struct-use-01-t-ref.png differ
diff --git a/tests/fixtures/reftests/svg1.1/text-text-03-b-ref.png 
b/tests/fixtures/reftests/svg1.1/text-text-03-b-ref.png
index 948447e2..298718f6 100644
Binary files a/tests/fixtures/reftests/svg1.1/text-text-03-b-ref.png and 
b/tests/fixtures/reftests/svg1.1/text-text-03-b-ref.png differ
diff --git a/tests/resources/NotoSerif-rpn9.ttf b/tests/resources/NotoSerif-rpn9.ttf
new file mode 100644
index 00000000..830eeca1
Binary files /dev/null and b/tests/resources/NotoSerif-rpn9.ttf differ
diff --git a/tests/resources/NotoSerifItalic-2Y8w.ttf b/tests/resources/NotoSerifItalic-2Y8w.ttf
new file mode 100644
index 00000000..d74cc7a0
Binary files /dev/null and b/tests/resources/NotoSerifItalic-2Y8w.ttf differ
diff --git a/tests/test-utils.c b/tests/test-utils.c
index c10af8cb..268c0e4e 100644
--- a/tests/test-utils.c
+++ b/tests/test-utils.c
@@ -230,9 +230,7 @@ test_utils_get_test_data_path (void)
     if (data_path)
         return data_path;
 
-    data_path = g_build_filename (g_test_get_dir (G_TEST_DIST),
-                                  "fixtures",
-                                  NULL);
+    data_path = g_test_build_filename (G_TEST_DIST, "fixtures", NULL);
 
     return data_path;
 }
@@ -325,10 +323,12 @@ create_font_config_for_testing (void)
 {
     const char *font_paths[] =
     {
-        "resources/Roboto-Regular.ttf",
-        "resources/Roboto-Italic.ttf",
-        "resources/Roboto-Bold.ttf",
-        "resources/Roboto-BoldItalic.ttf",
+        "NotoSerifItalic-2Y8w.ttf",
+        "NotoSerif-rpn9.ttf",
+        "Roboto-Regular.ttf",
+        "Roboto-Italic.ttf",
+        "Roboto-Bold.ttf",
+        "Roboto-BoldItalic.ttf",
     };
 
     FcConfig *config = FcConfigCreate ();
@@ -336,7 +336,7 @@ create_font_config_for_testing (void)
 
     for (i = 0; i < G_N_ELEMENTS(font_paths); i++)
     {
-        char *font_path = g_test_build_filename (G_TEST_DIST, font_paths[i], NULL);
+        char *font_path = g_test_build_filename (G_TEST_DIST, "resources", font_paths[i], NULL);
 
         if (!FcConfigAppFontAddFile (config, (const FcChar8 *) font_path))
         {


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