diff options
Diffstat (limited to 'testfiles/rendering_tests')
44 files changed, 692 insertions, 0 deletions
diff --git a/testfiles/rendering_tests/CMakeLists.txt b/testfiles/rendering_tests/CMakeLists.txt new file mode 100644 index 0000000..f3bef01 --- /dev/null +++ b/testfiles/rendering_tests/CMakeLists.txt @@ -0,0 +1,52 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +#add your test here (do not put the .svg extension) +set(RENDERING_TESTS + # -- Generic tests -- + test-empty + test-dont-crash + + # -- Selector tests -- + selector-important-002 + selector-important-003 + + multi-style + + # -- Text tests -- + ## Many (if not all) of these tests are sensitive to the text rendering stack: FreeType, HarfBuzz, Pango. + + # test-baseline-shift + ## Small differences with code adapted for Pango 1.44. + + # test-glyph-y-pos + ## to be fixed since an update happened between harfbuzz 1.5.1(OK) and 1.6.0(FAIL). + ## If you re-enable the test, you may have to *slightly* fix the expected rendering (hoping the fix happens upstream). + ## Please also check that the rendering with harfbuzz <=1.5.1 is not *too* wrong (for older systems) + ## cf Tav's post : https://www.patreon.com/posts/into-sinkhole-19021727 + ## and bug https://bugzilla.gnome.org/show_bug.cgi?id=787526 + + # test-rtl-vertical + + # text-shaping + ## Expected rendering generated with Pango 1.44. Currently fails with + ## CI as CI uses Pango 1.40. Enable after updating CI to Ubuntu 20.04. + + # text-glyphs-combining.svg + ## Expected rendering generated with Pango 1.44. + + # text-glyphs-vertical.svg + ## Expected rendering generated with Pango 1.44. + + # -- LPE tests -- + test-powerstroke-join +) + + +foreach(rendering_test ${RENDERING_TESTS}) + set(testname "render_${rendering_test}") + add_test(NAME ${testname} + COMMAND bash ${CMAKE_CURRENT_SOURCE_DIR}/test.sh ${CMAKE_RUNTIME_OUTPUT_DIRECTORY}/inkscape ${CMAKE_CURRENT_SOURCE_DIR}/${rendering_test} + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/testfiles/rendering_tests) + set_tests_properties(${testname} PROPERTIES ENVIRONMENT "${INKSCAPE_TEST_PROFILE_DIR_ENV}/${testname};${CMAKE_CTEST_ENV}") +endforeach() + diff --git a/testfiles/rendering_tests/README b/testfiles/rendering_tests/README new file mode 100644 index 0000000..6ebcb4c --- /dev/null +++ b/testfiles/rendering_tests/README @@ -0,0 +1,26 @@ +HOWTO + +# Add a rendering test: + - create the svg file + - 0.92: + - inkscape <yourfile>.svg -d 96 -e expected_rendering/<yourfile>.png + - inkscape <yourfile>.svg -d 384 -e expected_rendering/<yourfile>-large.png + - 1.0: + - inkscape -d 96 --export-filename=expected_rendering/<yourfile>.png <yourfile>.svg + - inkscape -d 384 --export-filename=expected_rendering/<yourfile>-large.png <yourfile>.svg + - add the test in CMakeLists.txt + - use stable if possible to generate the reference png files + - git add <yourfile>.svg expected_rendering/<yourfile>-large.png expected_rendering/<yourfile>.png + +# Fix a failing test (due to a change in code): + - DO *NOT* MODIFY the expected rendering (or the svg) before getting advice from inkscape-devel@ + - fix your code if possible + - IF you change introduces a greater compatibility with css or browsers + - AND you cannot reasonably "update" files from older versions to match the appearance + - AND inkscape-devel@ has a consensus that it's the only way + -> do as you must + - manually double check the changes + +# Fix a failing test (due to a change in pixman or cairo): + - update renderings. Use a *stable* version to generate the renderings, NOT TRUNK + - manually check appearances diff --git a/testfiles/rendering_tests/expected_rendering/multi-style.png b/testfiles/rendering_tests/expected_rendering/multi-style.png Binary files differnew file mode 100644 index 0000000..7c7c2fb --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/multi-style.png diff --git a/testfiles/rendering_tests/expected_rendering/selector-important-002-large.png b/testfiles/rendering_tests/expected_rendering/selector-important-002-large.png Binary files differnew file mode 100644 index 0000000..e92eef0 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/selector-important-002-large.png diff --git a/testfiles/rendering_tests/expected_rendering/selector-important-002.png b/testfiles/rendering_tests/expected_rendering/selector-important-002.png Binary files differnew file mode 100644 index 0000000..b0af9bd --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/selector-important-002.png diff --git a/testfiles/rendering_tests/expected_rendering/selector-important-003-large.png b/testfiles/rendering_tests/expected_rendering/selector-important-003-large.png Binary files differnew file mode 100644 index 0000000..91cb3af --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/selector-important-003-large.png diff --git a/testfiles/rendering_tests/expected_rendering/selector-important-003.png b/testfiles/rendering_tests/expected_rendering/selector-important-003.png Binary files differnew file mode 100644 index 0000000..dfe3dbc --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/selector-important-003.png diff --git a/testfiles/rendering_tests/expected_rendering/test-baseline-shift-large.png b/testfiles/rendering_tests/expected_rendering/test-baseline-shift-large.png Binary files differnew file mode 100644 index 0000000..29369a8 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-baseline-shift-large.png diff --git a/testfiles/rendering_tests/expected_rendering/test-baseline-shift.png b/testfiles/rendering_tests/expected_rendering/test-baseline-shift.png Binary files differnew file mode 100644 index 0000000..45aed90 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-baseline-shift.png diff --git a/testfiles/rendering_tests/expected_rendering/test-dont-crash.png b/testfiles/rendering_tests/expected_rendering/test-dont-crash.png Binary files differnew file mode 100644 index 0000000..a2d005e --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-dont-crash.png diff --git a/testfiles/rendering_tests/expected_rendering/test-empty-large.png b/testfiles/rendering_tests/expected_rendering/test-empty-large.png Binary files differnew file mode 100644 index 0000000..34acf1f --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-empty-large.png diff --git a/testfiles/rendering_tests/expected_rendering/test-empty.png b/testfiles/rendering_tests/expected_rendering/test-empty.png Binary files differnew file mode 100644 index 0000000..2e0a5fe --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-empty.png diff --git a/testfiles/rendering_tests/expected_rendering/test-glyph-y-pos-large.png b/testfiles/rendering_tests/expected_rendering/test-glyph-y-pos-large.png Binary files differnew file mode 100644 index 0000000..e60f477 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-glyph-y-pos-large.png diff --git a/testfiles/rendering_tests/expected_rendering/test-glyph-y-pos.png b/testfiles/rendering_tests/expected_rendering/test-glyph-y-pos.png Binary files differnew file mode 100644 index 0000000..85a3050 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-glyph-y-pos.png diff --git a/testfiles/rendering_tests/expected_rendering/test-powerstroke-join-large.png b/testfiles/rendering_tests/expected_rendering/test-powerstroke-join-large.png Binary files differnew file mode 100644 index 0000000..72d8821 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-powerstroke-join-large.png diff --git a/testfiles/rendering_tests/expected_rendering/test-powerstroke-join.png b/testfiles/rendering_tests/expected_rendering/test-powerstroke-join.png Binary files differnew file mode 100644 index 0000000..1eeec07 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-powerstroke-join.png diff --git a/testfiles/rendering_tests/expected_rendering/test-rtl-vertical-large.png b/testfiles/rendering_tests/expected_rendering/test-rtl-vertical-large.png Binary files differnew file mode 100644 index 0000000..84abe78 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-rtl-vertical-large.png diff --git a/testfiles/rendering_tests/expected_rendering/test-rtl-vertical.png b/testfiles/rendering_tests/expected_rendering/test-rtl-vertical.png Binary files differnew file mode 100644 index 0000000..ea8836f --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-rtl-vertical.png diff --git a/testfiles/rendering_tests/expected_rendering/text-glyphs-combining-large.png b/testfiles/rendering_tests/expected_rendering/text-glyphs-combining-large.png Binary files differnew file mode 100644 index 0000000..6952968 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/text-glyphs-combining-large.png diff --git a/testfiles/rendering_tests/expected_rendering/text-glyphs-combining.png b/testfiles/rendering_tests/expected_rendering/text-glyphs-combining.png Binary files differnew file mode 100644 index 0000000..98e06a7 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/text-glyphs-combining.png diff --git a/testfiles/rendering_tests/expected_rendering/text-glyphs-vertical-large.png b/testfiles/rendering_tests/expected_rendering/text-glyphs-vertical-large.png Binary files differnew file mode 100644 index 0000000..d7091db --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/text-glyphs-vertical-large.png diff --git a/testfiles/rendering_tests/expected_rendering/text-glyphs-vertical.png b/testfiles/rendering_tests/expected_rendering/text-glyphs-vertical.png Binary files differnew file mode 100644 index 0000000..eb46075 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/text-glyphs-vertical.png diff --git a/testfiles/rendering_tests/expected_rendering/text-shaping-large.png b/testfiles/rendering_tests/expected_rendering/text-shaping-large.png Binary files differnew file mode 100644 index 0000000..e84ebf5 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/text-shaping-large.png diff --git a/testfiles/rendering_tests/expected_rendering/text-shaping.png b/testfiles/rendering_tests/expected_rendering/text-shaping.png Binary files differnew file mode 100644 index 0000000..346ab77 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/text-shaping.png diff --git a/testfiles/rendering_tests/fonts/Estedad-Medium.ttf b/testfiles/rendering_tests/fonts/Estedad-Medium.ttf Binary files differnew file mode 100644 index 0000000..d4844c2 --- /dev/null +++ b/testfiles/rendering_tests/fonts/Estedad-Medium.ttf diff --git a/testfiles/rendering_tests/fonts/GeomTest-Regular.otf b/testfiles/rendering_tests/fonts/GeomTest-Regular.otf Binary files differnew file mode 100755 index 0000000..f11fd09 --- /dev/null +++ b/testfiles/rendering_tests/fonts/GeomTest-Regular.otf diff --git a/testfiles/rendering_tests/fonts/LICENSES b/testfiles/rendering_tests/fonts/LICENSES new file mode 100644 index 0000000..71bfc0e --- /dev/null +++ b/testfiles/rendering_tests/fonts/LICENSES @@ -0,0 +1,10 @@ + +All fonts in this directory are licensed under open licenses. + +Lohit (https://pagure.io/lohit SIL Open Font 1.1) +NotoSans (https://www.google.com/get/noto/ Open Font License 1.1) +Estedad (https://github.com/aminabedi68/Estedad/ SIL Open Font 1.1) + +GeomTest Released under Open Font Licens 1.1. Copyright Tavmjong Bah 2015,2019 + + diff --git a/testfiles/rendering_tests/fonts/Lohit-Telugu.ttf b/testfiles/rendering_tests/fonts/Lohit-Telugu.ttf Binary files differnew file mode 100644 index 0000000..3869703 --- /dev/null +++ b/testfiles/rendering_tests/fonts/Lohit-Telugu.ttf diff --git a/testfiles/rendering_tests/fonts/NotoSans-Regular.ttf b/testfiles/rendering_tests/fonts/NotoSans-Regular.ttf Binary files differnew file mode 100644 index 0000000..b031a49 --- /dev/null +++ b/testfiles/rendering_tests/fonts/NotoSans-Regular.ttf diff --git a/testfiles/rendering_tests/fonts/NotoSansCJKjp-Regular.otf b/testfiles/rendering_tests/fonts/NotoSansCJKjp-Regular.otf Binary files differnew file mode 100644 index 0000000..296fbeb --- /dev/null +++ b/testfiles/rendering_tests/fonts/NotoSansCJKjp-Regular.otf diff --git a/testfiles/rendering_tests/fonts/NotoSansHebrew-Regular.ttf b/testfiles/rendering_tests/fonts/NotoSansHebrew-Regular.ttf Binary files differnew file mode 100644 index 0000000..9bf03ab --- /dev/null +++ b/testfiles/rendering_tests/fonts/NotoSansHebrew-Regular.ttf diff --git a/testfiles/rendering_tests/multi-style.svg b/testfiles/rendering_tests/multi-style.svg new file mode 100644 index 0000000..473192e --- /dev/null +++ b/testfiles/rendering_tests/multi-style.svg @@ -0,0 +1,96 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="80" + height="80" + viewBox="0 0 80 80" + version="1.1"> + <style + id="first"> +rect { fill: #800000; } +/* class "c1" is redefined several times, only the last one counts */ +.c1 { fill: #ff0000; } +.c2 { fill: #ff9900; } +</style> + <defs> + <style + id="insidedefs"> +rect { fill: #ffff00; } +.c1 { fill: #008000; } +.c3 { fill: #00ff00; } +</style> + </defs> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <rect + id="background" + width="80" + height="80" /> + <rect + width="20" + height="20" /> + <rect + width="20" + height="20" + x="30" + class="c1" /> + <rect + width="20" + height="20" + x="60" + class="c2" /> + <rect + width="20" + height="20" + class="c3" + y="30" /> + <rect + class="c4" + width="20" + height="20" + x="30" + y="30" /> + <rect + class="c5" + width="20" + height="20" + x="60" + y="30" /> + <style + id="insidegroup"> +#background { fill: white; } +.c5 { fill: #00ccff; } +/* nested CSS selector (with XML entity because not using CDATA) */ +g.g1 > rect { fill: #00ffcc; } +</style> + <rect + class="c5" + width="20" + height="20" + y="60" /> + <rect + width="20" + height="20" + x="30" + y="60" /> + <g + class="g1"> + <rect + width="20" + height="20" + x="60" + y="60" /> + </g> + </g> + <style + id="last"><!-- using CDATA --><![CDATA[ +rect { fill: #0000ff; } +.c1 { fill: #990099; } +.c4 { fill: #ff00ff; } +]]></style> +</svg> diff --git a/testfiles/rendering_tests/selector-important-002.svg b/testfiles/rendering_tests/selector-important-002.svg new file mode 100644 index 0000000..e5a66b6 --- /dev/null +++ b/testfiles/rendering_tests/selector-important-002.svg @@ -0,0 +1,58 @@ +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="480" height="360" + style="fill:orange !important"> + + <title>Style "!important" — 002</title> + + <style type="text/css"> + + <!-- Later rule overrides same specificity previous rule. --> + #groupA use { fill: red !important; } + #groupA use { fill: blue !important; } + + #groupB .classB { fill: red !important; } + #groupB .classB { fill: blue !important; } + + #groupC #MyRectC { fill: red !important; } + #groupC #MyRectC { fill: blue !important; } + + #groupD { fill: blue !important; } + #classD { fill: red !important; } + + #groupE use { fill: blue !important; } + #groupE { fill: red !important; } + </style> + + <defs> + <rect id="MyRect" width="40" height="40"/> + </defs> + + <!-- + <text id="title" x="240" y="50" style="fill:black; font-size:24px; text-anchor:middle;">Style "!important" — 002</text> + <a href="https://svgwg.org/svg2-draft/stylling.html"> + <text id="source" x="240" y="70" style="fill:black; font-size:12px; text-anchor:middle;">https://svgwg.org/svg2-draft/styling.html</text> + </a> + --> + + <g id="groupA"> + <use id="MyRectA" class="classA" x="20" y="100" xlink:href="#MyRect" /> + </g> + + <g id="groupB"> + <use id="MyRectB" class="classB" x="120" y="100" xlink:href="#MyRect" /> + </g> + + <g id="groupC"> + <use id="MyRectC" class="classC" x="220" y="100" xlink:href="#MyRect" /> + </g> + + <g id="groupD"> + <use id="MyRectD" class="classD" x="320" y="100" xlink:href="#MyRect" /> + </g> + + <g id="groupE"> + <use id="MyRectE" class="classE" x="420" y="100" xlink:href="#MyRect" /> + </g> + +</svg> diff --git a/testfiles/rendering_tests/selector-important-003.svg b/testfiles/rendering_tests/selector-important-003.svg new file mode 100644 index 0000000..831319f --- /dev/null +++ b/testfiles/rendering_tests/selector-important-003.svg @@ -0,0 +1,57 @@ +<svg xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + width="480" height="360"> + + <title>Style "!important" — 003</title> + + <style type="text/css"> + + /* !important is not inherited. */ + g #groupA { fill: red !important; } + use { fill: blue; } + + /* Attributes cannot have !important. */ + #MyRectB { fill: blue; } + + /* Inline can have !important. */ + #MyRectC { fill: red !important; } + + /* Bad property shouldn't set !important. */ + #MyRectD { fill: XXX !important; } + + /* Bad inline property shouldn't set !important. */ + #MyRectE { fill: blue; } + </style> + + <defs> + <rect id="MyRect" width="40" height="40"/> + </defs> + + <!-- + <text id="title" x="240" y="50" style="fill:black; font-size:24px; text-anchor:middle;">Style "!important" — 003</text> + <a href="https://svgwg.org/svg2-draft/stylling.html"> + <text id="source" x="240" y="70" style="fill:black; font-size:12px; text-anchor:middle;">https://svgwg.org/svg2-draft/styling.html</text> + </a> + --> + + <g id="groupA"> + <use id="MyRectA" class="classA" x="20" y="100" xlink:href="#MyRect" /> + </g> + + <g id="groupB"> + <use id="MyRectB" class="classB" x="120" y="100" xlink:href="#MyRect" fill="red !important"/> + </g> + + <g id="groupC"> + <use id="MyRectC" class="classC" x="220" y="100" xlink:href="#MyRect" style="fill: blue !important"/> + </g> + + <g id="groupD"> + <use id="MyRectD" class="classD" x="320" y="100" xlink:href="#MyRect" style="fill: blue"/> + </g> + + <g id="groupE"> + <use id="MyRectE" class="classE" x="420" y="100" xlink:href="#MyRect" style="fill: XXX !important"/> + </g> + +</svg> diff --git a/testfiles/rendering_tests/test-baseline-shift.svg b/testfiles/rendering_tests/test-baseline-shift.svg new file mode 100644 index 0000000..534ffab --- /dev/null +++ b/testfiles/rendering_tests/test-baseline-shift.svg @@ -0,0 +1,27 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<svg width="600" height="600" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + viewBox="0 0 600 600"> + <style type="text/css"> + text { + font-family: DejaVu Sans; + font-size: 36px; + } + .title { + text-anchor: middle; + } + </style> + + <g> + <text x="50" y="200">subscript: H<tspan style="font-size:65%;baseline-shift:sub">2</tspan>O</text> + <text x="50" y="300">superscript: m<tspan style="font-size:65%;baseline-shift:super">2</tspan></text> + <text x="530" y="200" style="writing-mode:tb-rl">subscript: H<tspan style="font-size:65%;baseline-shift:sub">2</tspan>O</text> + <text x="430" y="200" style="writing-mode:tb-rl">superscript: m<tspan style="font-size:65%;baseline-shift:super">2</tspan></text> + </g> + + <text class="title" x="50%" y="120">Sub- and Superscript</text> + +</svg> diff --git a/testfiles/rendering_tests/test-dont-crash.svg b/testfiles/rendering_tests/test-dont-crash.svg new file mode 100644 index 0000000..d01c0ea --- /dev/null +++ b/testfiles/rendering_tests/test-dont-crash.svg @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + version="1.1" + viewBox="0 0 210 297" + height="297mm" + width="210mm"> + <g + id="layer1" + inkscape:groupmode="layer" + inkscape:label="Layer 1"> + <!-- missing xlink:href attribute - don't care how it's rendered (place it + off-page), but Inkscape should not crash --> + <image + y="-100" + x="-100" + height="50" + width="50" /> + </g> +</svg> diff --git a/testfiles/rendering_tests/test-empty.svg b/testfiles/rendering_tests/test-empty.svg new file mode 100644 index 0000000..3b5ee5a --- /dev/null +++ b/testfiles/rendering_tests/test-empty.svg @@ -0,0 +1,65 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- Created with Inkscape (http://www.inkscape.org/) --> + +<svg + xmlns:dc="http://purl.org/dc/elements/1.1/" + xmlns:cc="http://creativecommons.org/ns#" + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" + width="210mm" + height="297mm" + viewBox="0 0 210 297" + version="1.1" + id="svg8" + inkscape:version="0.92.1 r15371" + sodipodi:docname="test-empty.svg"> + <defs + id="defs2" /> + <sodipodi:namedview + id="base" + pagecolor="#ffffff" + bordercolor="#666666" + borderopacity="1.0" + inkscape:pageopacity="0.0" + inkscape:pageshadow="2" + inkscape:zoom="0.7" + inkscape:cx="132.86611" + inkscape:cy="438.52092" + inkscape:document-units="mm" + inkscape:current-layer="layer1" + showgrid="false" + inkscape:window-width="1920" + inkscape:window-height="1055" + inkscape:window-x="1920" + inkscape:window-y="0" + inkscape:window-maximized="1" /> + <metadata + id="metadata5"> + <rdf:RDF> + <cc:Work + rdf:about=""> + <dc:format>image/svg+xml</dc:format> + <dc:type + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> + <dc:title /> + </cc:Work> + </rdf:RDF> + </metadata> + <g + inkscape:label="Layer 1" + inkscape:groupmode="layer" + id="layer1"> + <rect + style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:2.64583325;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:0.98039216" + id="rect7" + width="92.226196" + height="75.595238" + x="52.160713" + y="46.023808" + rx="6.6565199" + ry="6.6565199" /> + </g> +</svg> diff --git a/testfiles/rendering_tests/test-glyph-y-pos.svg b/testfiles/rendering_tests/test-glyph-y-pos.svg new file mode 100644 index 0000000..28200c7 --- /dev/null +++ b/testfiles/rendering_tests/test-glyph-y-pos.svg @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<svg width="600" height="600" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + viewBox="0 0 600 600"> + <style type="text/css"> + text { + font-family: DejaVu Sans; + font-size: 36px; + } + .title { + text-anchor: middle; + } + </style> + + <g> + <text x="50" y="200">G̃g̃X̃x̃</text> + <text x="300" y="200" style="writing-mode:vertical-lr;">G̃g̃X̃x̃</text> + <text x="500" y="200" style="writing-mode:vertical-lr;text-orientation:upright">G̃g̃X̃x̃</text> + </g> + + <text class="title" x="50%" y="120">Composed Glyphs</text> + +</svg> diff --git a/testfiles/rendering_tests/test-powerstroke-join.svg b/testfiles/rendering_tests/test-powerstroke-join.svg new file mode 100644 index 0000000..2c05fb3 --- /dev/null +++ b/testfiles/rendering_tests/test-powerstroke-join.svg @@ -0,0 +1,6 @@ +<svg xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" xmlns="http://www.w3.org/2000/svg" height="103.10469" width="114.42079"> + <defs id="defs8"> + <inkscape:path-effect end_linecap_type="zerowidth" scale_width="1" miter_limit="4" linejoin_type="extrp_arc" start_linecap_type="zerowidth" interpolator_beta="0.2" interpolator_type="CubicBezierSmooth" sort_points="true" offset_points="0.2,6 | 1,6 | 1.8,6" lpeversion="1" is_visible="true" id="path-effect12" effect="powerstroke" /> + </defs> + <path inkscape:original-d="M 37.025152,63.80944 C 62.629473,85.82239 121.42349,99.11534 92.9073,25.53973 73.516303,45.478852 29.421533,5.937486 9.304592,36.285332" inkscape:path-effect="#path-effect12"/> +</svg> diff --git a/testfiles/rendering_tests/test-rtl-vertical.svg b/testfiles/rendering_tests/test-rtl-vertical.svg new file mode 100644 index 0000000..a959c18 --- /dev/null +++ b/testfiles/rendering_tests/test-rtl-vertical.svg @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> + +<svg width="600" height="600" + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + viewBox="0 0 600 600"> + <style type="text/css"> + text { + font-family: DejaVu Sans; + font-size: 36px; + } + .title { + text-anchor: middle; + } + </style> + + <g> + <text x="50" y="200">أبجد</text> + <text x="300" y="200" style="writing-mode:vertical-lr;">بجد</text> + <text x="500" y="200" style="writing-mode:vertical-lr;text-orientation:upright">أبجد</text> + </g> + + <text class="title" x="50%" y="120">RTL text in vertical mode</text> + +</svg> diff --git a/testfiles/rendering_tests/test.sh b/testfiles/rendering_tests/test.sh new file mode 100755 index 0000000..11167dd --- /dev/null +++ b/testfiles/rendering_tests/test.sh @@ -0,0 +1,46 @@ +#!/bin/bash +# SPDX-License-Identifier: GPL-2.0-or-later + +if [ "$#" -lt 2 ]; then + echo "pass the path of the inkscape executable as parameter then the name of the test" $# + exit 1 +fi + +command -v compare >/dev/null 2>&1 || { echo >&2 "I require ImageMagick's 'compare' but it's not installed. Aborting."; exit 1; } + +INKSCAPE_EXE=$1 +exit_status=0 +test=$2 +EXPECTED=$(dirname $test)"/expected_rendering/"$(basename $test) +testname=$(basename $test) + + + ${INKSCAPE_EXE} --export-filename=${testname}.png -d 96 ${test}.svg #2>/dev/null >/dev/null + compare -metric AE ${testname}.png ${EXPECTED}.png ${testname}-compare.png 2> ${testname}-result.txt + test1=`cat ${testname}-result.txt` + echo $test1 + if [ "$test1" = 0 ]; then + echo ${testname} "PASSED" + rm ${testname}.png ${testname}-compare.png + else + echo ${testname} "FAILED" + exit_status=1 + fi + +if [ -f "${EXPECTED}-large.png" ]; then + ${INKSCAPE_EXE} --export-filename=${testname}-large.png -d 384 ${test}.svg #2>/dev/null >/dev/null + compare -metric AE ${testname}-large.png ${EXPECTED}-large.png ${testname}-compare-large.png 2> ${testname}-result.txt + test2=`cat ${testname}-result.txt` + if [ "$test2" = 0 ]; then + echo ${testname}-large "PASSED" + rm ${testname}-large.png ${testname}-compare-large.png + else + echo ${testname}-large "FAILED" + exit_status=1 + fi +else + echo ${testname}-large "SKIPPED" +fi + +rm ${testname}-result.txt +exit $exit_status diff --git a/testfiles/rendering_tests/text-glyphs-combining.svg b/testfiles/rendering_tests/text-glyphs-combining.svg new file mode 100644 index 0000000..29be00e --- /dev/null +++ b/testfiles/rendering_tests/text-glyphs-combining.svg @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + width="100%" + height="100%" + viewBox="0 0 600 600"> + + <style type="text/css"> + + @font-face { + font-family: "Noto Sans"; + src: url("fonts/NotoSans-Regular.ttf"); + } + + text { + font-family: "Noto Sans"; + font-size: 30px; + } + + </style> + + <text x="25%" y="10%">õőo̓ơọo̫o̳o̻o̓o͋o͗o͡</text> + <text x="25%" y="25%" style="writing-mode:vertical-lr">õőo̓ơọo̫o̳o̻o̓o͋o͗o͡</text> + <text x="50%" y="25%" style="writing-mode:vertical-lr;text-orientation:upright">õőo̓ơọo̫o̳o̻o̓o͋o͗o͡</text> + <text x="75%" y="25%" style="writing-mode:vertical-lr;text-orientation:sideways">õőo̓ơọo̫o̳o̻o̓o͋o͗o͡</text> + + <!-- Show reference point --> + <circle cx="25%" cy="10%" r="2" style="fill:lightblue"/> + <circle cx="25%" cy="25%" r="2" style="fill:lightblue"/> + <circle cx="50%" cy="25%" r="2" style="fill:lightblue"/> + <circle cx="75%" cy="25%" r="2" style="fill:lightblue"/> + +</svg> diff --git a/testfiles/rendering_tests/text-glyphs-vertical.svg b/testfiles/rendering_tests/text-glyphs-vertical.svg new file mode 100644 index 0000000..f1264fd --- /dev/null +++ b/testfiles/rendering_tests/text-glyphs-vertical.svg @@ -0,0 +1,48 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + width="100%" + height="100%" + viewBox="0 0 600 600"> + + <style type="text/css"> + + @font-face { + font-family: "Noto Sans"; + src: url("fonts/NotoSans-Regular.ttf"); + } + + @font-face { + font-family: "Noto Sans CJK JP"; + src: url("fonts/NotoSansCJKjp-Regular.otf"); + } + + @font-face { + font-family: "GeomTest"; + src: url("fonts/GeomTest.otf"); + } + + text { + font-family: "Noto Sans"; + font-size: 30px; + } + + .geomtest { + font-family: GeomTest; + } + + </style> + + <text x="100" y="100">㆕㆖㆘<tspan class="geomtest">A回ーऄ</tspan>G̃g̃X̃x̃</text> + <text x="115" y="200" style="writing-mode:vertical-lr">㆕㆖㆘<tspan class="geomtest">A回ーऄ</tspan>G̃g̃X̃x̃</text> + <text x="305" y="200" style="writing-mode:vertical-lr;text-orientation:upright">㆕㆖㆘<tspan class="geomtest">A回ーऄ</tspan>G̃g̃X̃x̃</text> + <text x="495" y="200" style="writing-mode:vertical-lr;text-orientation:sideways">㆕㆖㆘<tspan class="geomtest">A回ーऄ</tspan>G̃g̃X̃x̃</text> + + <!-- Show reference point --> + <circle cx="100" cy="100" r="2" style="fill:lightblue"/> + <circle cx="115" cy="200" r="2" style="fill:lightblue"/> + <circle cx="305" cy="200" r="2" style="fill:lightblue"/> + <circle cx="495" cy="200" r="2" style="fill:lightblue"/> + +</svg> diff --git a/testfiles/rendering_tests/text-shaping.svg b/testfiles/rendering_tests/text-shaping.svg new file mode 100644 index 0000000..80aa95a --- /dev/null +++ b/testfiles/rendering_tests/text-shaping.svg @@ -0,0 +1,93 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" + width="100%" + height="100%" + viewBox="0 0 600 600"> + + <style type="text/css"> + + @font-face { + font-family: "Estedad"; + src: url("fonts/Estedad-Medium.ttf"); + } + + @font-face { + font-family: "Noto Sans Hebrew"; + src: url("fonts/NotoSansHebrew-Regular.ttf"); + } + + @font-face { + font-family: "Noto Sans"; + src: url("fonts/NotoSans-Regular.ttf"); + } + + @font-face { + font-family: "Noto Sans CJK JP"; + src: url("fonts/NotoSansCJKjp-Regular.otf"); + } + + @font-face { + font-family: "Lohit Telugu"; + src: url("fonts/Lohit-Telugu.ttf"); + } + + </style> + + <g style="fill:none;stroke:black;stroke-width:0.5px;font-size:42px;font-family:serif;text-anchor:middle"> + + <!-- bug https://gitlab.com/inkscape/inkscape/-/issues/469 --> + <text xml:space="preserve" + x="300" + y="50" + style="font-family:Estedad;direction:rtl">نیرو</text> + + <text xml:space="preserve" + x="300" + y="100" + style="font-family:Estedad;direction:rtl">بِسْمِ اللَّهِ الرَّحْمَنِ الرَّحِيمِ</text> + + <text xml:space="preserve" + x="300" + y="150" + style="font-family:'Noto Sans Hebrew';direction:rtl">שָׁלוֹם</text> + + <text xml:space="preserve" + x="300" + y="200" + style="font-family:'Noto Sans Hebrew';direction:rtl">חִירִיק</text> + + <text xml:space="preserve" + x="300" + y="250" + style="font-family:'Noto Sans'">â â̂ â â̂</text> + + <text xml:space="preserve" + x="300" + y="300" + style="font-family:'Noto Sans'">a ḁ ą ą</text> + + <text xml:space="preserve" + x="300" + y="350" + style="font-family:'Noto Sans CJK JP'">ヘ ペ ペ</text> + + <text xml:space="preserve" + x="300" + y="400" + style="font-family:'Lohit Telugu'">తెలుగులో</text> + + <!-- Teluga bug https://gitlab.com/inkscape/inkscape/-/issues/394 --> + <text xml:space="preserve" + x="300" + y="450" + style="font-family:'Lohit Telugu'">గ్రంథాలయం</text> + + <!-- Teluga bug https://launchpadlibrarian.net/167162208/inkscape-telugu-text.svg --> + <text xml:space="preserve" + x="300" + y="500" + style="font-family:'Lohit Telugu'">ఇంక్స్కేప్</text> + </g> +</svg> |