diff options
Diffstat (limited to 'testfiles/rendering_tests')
57 files changed, 985 insertions, 0 deletions
diff --git a/testfiles/rendering_tests/CMakeLists.txt b/testfiles/rendering_tests/CMakeLists.txt new file mode 100644 index 0000000..260dfa3 --- /dev/null +++ b/testfiles/rendering_tests/CMakeLists.txt @@ -0,0 +1,68 @@ +# SPDX-License-Identifier: GPL-2.0-or-later + +# Tests to run for 64-bit builds only. These fail in 32-bit builds (possibly due to rounding issues) +# TODO: Figure out actual cause and see if we can fix it +if(${CMAKE_SIZEOF_VOID_P} EQUAL 8) + set(RENDERING_TESTS_64bit + test-rtl-vertical + + # .otf font with compressed SVG glyphs + text-gzipped-svg-glyph + ) +endif() + +#add your test here (do not put the .svg extension) +set(RENDERING_TESTS + # -- Generic tests -- + test-empty + test-dont-crash + test-use + + # -- Selector tests -- + selector-important-002 + selector-important-003 + + multi-style + style-parsing + + # -- 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 + + # 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 + ## Expected rendering generated with Pango 1.44. + + text-glyphs-vertical + ## Expected rendering generated with Pango 1.44. + + # -- LPE tests -- + test-powerstroke-join + + # <symbol> geometric properties (SVG 2.0 feature) + symbol-svg2-geometry-properties + + ${RENDERING_TESTS_64bit} +) + + +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/style-parsing.png b/testfiles/rendering_tests/expected_rendering/style-parsing.png Binary files differnew file mode 100644 index 0000000..5b60834 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/style-parsing.png diff --git a/testfiles/rendering_tests/expected_rendering/symbol-svg2-geometry-properties.png b/testfiles/rendering_tests/expected_rendering/symbol-svg2-geometry-properties.png Binary files differnew file mode 100644 index 0000000..ca5e83e --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/symbol-svg2-geometry-properties.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..57066fe --- /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..38c0117 --- /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..d473a59 --- /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..49db6cb --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-rtl-vertical.png diff --git a/testfiles/rendering_tests/expected_rendering/test-use-large.png b/testfiles/rendering_tests/expected_rendering/test-use-large.png Binary files differnew file mode 100644 index 0000000..c1f4597 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-use-large.png diff --git a/testfiles/rendering_tests/expected_rendering/test-use.png b/testfiles/rendering_tests/expected_rendering/test-use.png Binary files differnew file mode 100644 index 0000000..a995136 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/test-use.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..5568888 --- /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..32a6781 --- /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..f49cbbd --- /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..cab1c0b --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/text-glyphs-vertical.png diff --git a/testfiles/rendering_tests/expected_rendering/text-gzipped-svg-glyph.png b/testfiles/rendering_tests/expected_rendering/text-gzipped-svg-glyph.png Binary files differnew file mode 100644 index 0000000..8e8a184 --- /dev/null +++ b/testfiles/rendering_tests/expected_rendering/text-gzipped-svg-glyph.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 100644 index 0000000..a008cbf --- /dev/null +++ b/testfiles/rendering_tests/fonts/GeomTest-Regular.otf diff --git a/testfiles/rendering_tests/fonts/GeomTest-gzipped-SVG-glyphs.otf b/testfiles/rendering_tests/fonts/GeomTest-gzipped-SVG-glyphs.otf Binary files differnew file mode 100755 index 0000000..d8a89e3 --- /dev/null +++ b/testfiles/rendering_tests/fonts/GeomTest-gzipped-SVG-glyphs.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-import-1.css b/testfiles/rendering_tests/multi-style-import-1.css new file mode 100644 index 0000000..e6fb1e0 --- /dev/null +++ b/testfiles/rendering_tests/multi-style-import-1.css @@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +/* overwritten later */ +rect { fill: red; } +.c1 { fill: red; } + +/* not overwritten */ +#background { fill: white; } +.c5 { fill: #00ccff; } diff --git a/testfiles/rendering_tests/multi-style-import-2.css b/testfiles/rendering_tests/multi-style-import-2.css new file mode 100644 index 0000000..3e0dd9b --- /dev/null +++ b/testfiles/rendering_tests/multi-style-import-2.css @@ -0,0 +1,7 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +rect { fill: blue; } +.c1 { fill: #990099; } + +/* overwritten later */ +.c4 { fill: red; } diff --git a/testfiles/rendering_tests/multi-style.svg b/testfiles/rendering_tests/multi-style.svg new file mode 100644 index 0000000..842f946 --- /dev/null +++ b/testfiles/rendering_tests/multi-style.svg @@ -0,0 +1,94 @@ +<?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"> +@import "multi-style-import-1.css"; +/* 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[ +@import "multi-style-import-2.css"; +.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/style-parsing.svg b/testfiles/rendering_tests/style-parsing.svg new file mode 100644 index 0000000..33e32cb --- /dev/null +++ b/testfiles/rendering_tests/style-parsing.svg @@ -0,0 +1,16 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<!-- +Test with leading semicolon in style. +https://gitlab.com/inkscape/inkscape/-/issues/1278 +--> +<svg xmlns="http://www.w3.org/2000/svg" + width="100%" height="100%" viewBox="0 0 500 200"> + <style type="text/css"> + rect { fill: red; } + #MyRect1 { ; fill: green; } + </style> + + <rect x="50" y="50" width="100" height="100" style=";fill:blue"/> + <rect x="200" y="50" width="100" height="100" id="MyRect1" /> + <rect x="350" y="50" width="100" height="100" style="stroke-width:0px;;;fill:blue" /> +</svg> diff --git a/testfiles/rendering_tests/symbol-svg2-geometry-properties.svg b/testfiles/rendering_tests/symbol-svg2-geometry-properties.svg new file mode 100644 index 0000000..6eb87d3 --- /dev/null +++ b/testfiles/rendering_tests/symbol-svg2-geometry-properties.svg @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + viewBox="0 0 95 120"> + +<defs> + <symbol id="mySym" width="10" height="10" viewBox="0 0 2 2"> + <rect width="2" height="2" style="fill:blue" /> + </symbol> + <svg id="mySvg" width="10" height="10" viewBox="0 0 2 2"> + <rect width="2" height="2" style="fill:green" /> + </svg> + <symbol id="mySymShifted" x="15" y="20" width="10" height="10" viewBox="0 0 2 2"> + <rect width="2" height="2" style="fill:magenta" /> + </symbol> + <svg id="mySvgShifted" x="15" y="20" width="10" height="10" viewBox="0 0 2 2"> + <rect width="2" height="2" style="fill:cyan" /> + </svg> + <image id="myImg" width="10" height="10" preserveAspectRatio="none" + xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFc + SJAAAACXBIWXMAAA7DAAAOwwHHb6hkAAAAGXRFWHRTb2Z0d2FyZQB3d3cuaW5rc2NhcGUub3Jn + m+48GgAAAA1JREFUCJlj+F+v9R8ABtECqHp0jnoAAAAASUVORK5CYII="> + </image> + <rect id="myRect" width="10" height="10" style="fill:gray" /> + <rect id="myRectXY" width="10" height="10" style="fill:#cc0" x="20" y="30" /> +</defs> + +<rect width="100%" height="100%" fill="white" /> + +<path d="M0,10 h80 M10,0 v20 M25,0 v20 M40,0 v20 M55,0 v20 M70,0 v20" fill="none" stroke="pink" /> + +<use xlink:href="#mySym" x="5" y="5" style="opacity:1.0" /> +<use xlink:href="#mySvg" x="20" y="5" style="opacity:0.8" /> +<use xlink:href="#mySym" x="35" y="5" style="opacity:0.6" /> +<use xlink:href="#mySvg" x="50" y="5" style="opacity:0.4" /> +<use xlink:href="#mySym" x="65" y="5" style="opacity:0.2" /> + +<path d="M0,10 h80 M10,0 v20 M25,0 v20 M40,0 v20 M55,0 v20 M70,0 v20" fill="none" stroke="orange" transform="translate(15, 20)" /> + +<use xlink:href="#mySymShifted" x="5" y="5" style="opacity:1.0" /> +<use xlink:href="#mySvgShifted" x="20" y="5" style="opacity:0.8" /> +<use xlink:href="#mySymShifted" x="35" y="5" style="opacity:0.6" /> +<use xlink:href="#mySvgShifted" x="50" y="5" style="opacity:0.4" /> +<use xlink:href="#mySymShifted" x="65" y="5" style="opacity:0.2" /> + +<path d="M0,10 h80 M10,0 v20 M25,0 v20 M40,0 v20 M55,0 v20 M70,0 v20" fill="none" stroke="pink" transform="translate(0, 40)" /> + +<!-- with transform --> +<use xlink:href="#mySymShifted" x="5" y="5" style="opacity:1.0" transform="rotate(90, 7.5, 32.5)" /> +<use xlink:href="#mySvgShifted" x="20" y="5" style="opacity:0.8" transform="rotate(90, 22.5, 32.5)" /> +<use xlink:href="#mySymShifted" x="35" y="5" style="opacity:0.6" transform="rotate(90, 37.5, 32.5)" /> +<use xlink:href="#mySvgShifted" x="50" y="5" style="opacity:0.4" transform="rotate(90, 52.5, 32.5)" /> +<use xlink:href="#mySymShifted" x="65" y="5" style="opacity:0.2" transform="rotate(90, 67.5, 32.5)" /> + +<path d="M0,10 h80 M10,0 v20 M25,0 v20 M40,0 v20 M55,0 v20 M70,0 v20" fill="none" stroke="orange" transform="translate(15, 60)" /> + +<!-- without x/y --> +<use xlink:href="#mySymShifted" style="opacity:1.0" transform="rotate(90, 0.0, 50.0)" /> +<use xlink:href="#mySvgShifted" style="opacity:0.8" transform="rotate(90, 7.5, 57.5)" /> +<use xlink:href="#mySymShifted" style="opacity:0.6" transform="rotate(90, 15.0, 65.0)" /> +<use xlink:href="#mySvgShifted" style="opacity:0.4" transform="rotate(90, 22.5, 72.5)" /> +<use xlink:href="#mySymShifted" style="opacity:0.2" transform="rotate(90, 30.0, 80.0)" /> + +<path d="M0,10 h80 M10,0 v20 M25,0 v20 M40,0 v20 M55,0 v20 M70,0 v20" fill="none" stroke="pink" transform="translate(0, 80)" /> + +<!-- with width/height --> +<use xlink:href="#mySym" width="20" height="30" x="10" y="165" style="opacity:1.0" transform="scale(0.5)" /> +<use xlink:href="#mySvg" width="20" height="30" x="40" y="165" style="opacity:0.8" transform="scale(0.5)" /> +<use xlink:href="#mySym" width="20" height="30" x="70" y="165" style="opacity:0.6" transform="scale(0.5)" /> +<use xlink:href="#mySvg" width="20" height="30" x="100" y="165" style="opacity:0.4" transform="scale(0.5)" /> +<use xlink:href="#mySym" width="20" height="30" x="130" y="165" style="opacity:0.2" transform="scale(0.5)" /> + +<path d="M0,10 h80 M10,0 v20 M25,0 v20 M40,0 v20 M55,0 v20 M70,0 v20" fill="none" stroke="orange" transform="translate(15, 100)" /> + +<!-- image/rect --> +<use xlink:href="#myImg" x="20" y="105" /> +<use xlink:href="#myImg" x="35" y="105" width="20" height="30" /><!-- width/height ignored --> +<use xlink:href="#myRect" x="50" y="105" /> +<use xlink:href="#myRect" x="65" y="105" width="20" height="30" /><!-- width/height ignored --> +<use xlink:href="#myRectXY" x="60" y="75" /><!-- cumulated x/y --> + +</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..7d20d22 --- /dev/null +++ b/testfiles/rendering_tests/test-baseline-shift.svg @@ -0,0 +1,33 @@ +<?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"> + @font-face { + font-family: "Noto Sans"; + src: url("fonts/NotoSans-Regular.ttf"); + } + + text { + font-family: Noto 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..6f44ef8 --- /dev/null +++ b/testfiles/rendering_tests/test-glyph-y-pos.svg @@ -0,0 +1,32 @@ +<?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"> + @font-face { + font-family: "Noto Sans"; + src: url("fonts/NotoSans-Regular.ttf"); + } + + text { + font-family: Noto Sans; + font-size: 36px; + } + .title { + text-anchor: middle; + } + </style> + + <rect x="0" y="0" width="600" height="600" style="fill:white"/> + <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..aa6610b --- /dev/null +++ b/testfiles/rendering_tests/test-rtl-vertical.svg @@ -0,0 +1,39 @@ +<?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"> + @font-face { + font-family: "Estedad"; + src: url("fonts/Estedad-Medium.ttf"); + } + + @font-face { + font-family: "Noto Sans"; + src: url("fonts/NotoSans-Regular.ttf"); + } + + text { + font-family: Estedad; + font-size: 36px; + } + + .title { + font-family: "Noto Sans"; + text-anchor: middle; + } + </style> + + <rect x="0" y="0" width="600" height="600" style="fill:white"/> + <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-use-ref.svg b/testfiles/rendering_tests/test-use-ref.svg new file mode 100644 index 0000000..0e6edf3 --- /dev/null +++ b/testfiles/rendering_tests/test-use-ref.svg @@ -0,0 +1,89 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + id="root" + width="100" + height="100" + viewBox="0 0 100 100"> + <style> + .magenta { + stroke:none; + fill:#ff00ff; + } + </style> + <defs> + <marker + id="arrow" + style="overflow:visible;" + refX="0.0" + refY="0.0" + orient="auto"> + <path + style="stroke:#ff00ff;stroke-width:1pt;fill:#ff00ff" + d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z " + transform="scale(0.4) rotate(180) translate(10,0)" /> + </marker> + <linearGradient + id="gradientBase"> + <stop + style="stop-color:#ff00ff;stop-opacity:1;" + offset="0" /> + <stop + style="stop-color:#ff00ff;stop-opacity:0;" + offset="1" /> + </linearGradient> + <linearGradient + id="gradient" + xlink:href="#gradientBase" + x1="10" + y1="50" + x2="90" + y2="50" + gradientUnits="userSpaceOnUse" /> + <filter + id="filter" + style="color-interpolation-filters:sRGB" + x="-1.2" + y="-1.2" + width="3.4" + height="3.4"> + <feGaussianBlur + stdDeviation="5" /> + </filter> + </defs> + <rect + class="green" + style="filter:url(#filter)" + x="15" + y="15" + width="10" + height="10" /> + <rect + id="rect" + class="magenta" + x="10" + y="80" + width="10" + height="10" /> + <use + xlink:href="#rect" + transform="translate(15)" /> + <use + xlink:href="#rect" + transform="translate(30)" /> + <use + xlink:href="#rect" + transform="translate(45)" /> + <rect + style="fill:url(#gradient);stroke:none" + x="10" + y="45" + width="80" + height="10" /> + <path + style="fill:none;stroke:#ff00ff;stroke-width:2;stroke-miterlimit:4;stroke-dasharray:none;marker-end:url(#arrow)" + d="M 90,20 H 45" /> +</svg> diff --git a/testfiles/rendering_tests/test-use.svg b/testfiles/rendering_tests/test-use.svg new file mode 100644 index 0000000..7e8a8ac --- /dev/null +++ b/testfiles/rendering_tests/test-use.svg @@ -0,0 +1,18 @@ +<?xml version="1.0" encoding="UTF-8" standalone="no"?> +<svg + xmlns="http://www.w3.org/2000/svg" + xmlns:svg="http://www.w3.org/2000/svg" + xmlns:xlink="http://www.w3.org/1999/xlink" + version="1.1" + width="100" + height="100" + viewBox="0 0 100 100"> + <style> + .green { + stroke:none; + fill:#00ff00; + } + </style> + <use + xlink:href="test-use-ref.svg#root" /> +</svg> diff --git a/testfiles/rendering_tests/test.sh b/testfiles/rendering_tests/test.sh new file mode 100755 index 0000000..e31376d --- /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-png-use-dithering false --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-png-use-dithering false --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..646ee05 --- /dev/null +++ b/testfiles/rendering_tests/text-glyphs-combining.svg @@ -0,0 +1,36 @@ +<?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> + + <rect x="0" y="0" width="600" height="600" style="fill:white"/> + + <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..585a404 --- /dev/null +++ b/testfiles/rendering_tests/text-glyphs-vertical.svg @@ -0,0 +1,53 @@ +<?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-Regular.otf"); + } + + text { + font-family: "Noto Sans"; + font-size: 30px; + } + + .geomtest { + font-family: GeomTest; + } + + .cjk { + font-family: "Noto Sans CJK JP"; + } + </style> + + <rect x="0" y="0" width="600" height="600" style="fill:white"/> + + <text x="100" y="100"><tspan class="cjk">㆕㆖㆘</tspan><tspan class="geomtest">A回ーऄ</tspan>G̃g̃X̃x̃</text> + <text x="115" y="200" style="writing-mode:vertical-lr"><tspan class="cjk">㆕㆖㆘</tspan><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="cjk">㆕㆖㆘</tspan><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="cjk">㆕㆖㆘</tspan><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-gzipped-svg-glyph.svg b/testfiles/rendering_tests/text-gzipped-svg-glyph.svg new file mode 100644 index 0000000..88ba336 --- /dev/null +++ b/testfiles/rendering_tests/text-gzipped-svg-glyph.svg @@ -0,0 +1,25 @@ +<?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 110 40"> + + <style type="text/css"> + + @font-face { + font-family: "GeomTest"; + src: url("fonts/GeomTest-gzipped-SVG-glyphs.otf"); + } + + text { + font-family: "GeomTest"; + font-size: 30px; + } + + </style> + + <text x="10" y="30">ABC</text> + +</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> |