Skip to content

SVG text style dominant-baseline is ignored. #1027

Closed

Description

@szdytom

Description

text node of SVG with style dominant-baseline: middle is not rendered correctly.

sample SVG:

<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="284.000000" height="284.000000" viewBox="0 0 284.000000 284.000000" version="1.1">
<circle style="fill-rule:evenodd;fill:#29B6F6;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="92.000000" cy="228.602539" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#29B6F6;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="192.000000" cy="228.602539" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#29B6F6;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="242.000000" cy="142.000046" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#29B6F6;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="192.000000" cy="55.397552" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#29B6F6;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="92.000000" cy="55.397461" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#29B6F6;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="42.000000" cy="142.000046" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#FF7043;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="92.000000" cy="128.602539" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#FF7043;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="105.397453" cy="178.602539" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#FF7043;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="155.397461" cy="192.000046" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#FF7043;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="192.000000" cy="155.397461" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#FF7043;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="178.602539" cy="105.397446" r="18.333334"/>
<circle style="fill-rule:evenodd;fill:#FF7043;fill-opacity:1;stroke-width:1.833333;stroke-linecap:square;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" cx="128.602539" cy="92.000000" r="18.333334"/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 109.416672 228.602539 L 174.583328 228.602539 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 200.708344 213.519272 L 233.291656 157.083313 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 233.291656 126.916771 L 200.708344 70.480827 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 174.583328 55.397537 L 109.416672 55.397476 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 83.291672 70.480743 L 50.708332 126.916763 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 83.291664 213.519272 L 50.708336 157.083313 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 96.507767 145.425751 L 100.889687 161.779327 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 122.220657 183.110321 L 138.574249 187.492264 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 167.712891 179.684601 L 179.684570 167.712906 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 187.492233 138.574249 L 183.110306 122.220657 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 161.779327 100.889687 L 145.425751 96.507759 "/>
<path style="fill:none;stroke-width:1.833333;stroke-linecap:butt;stroke-linejoin:miter;stroke:#616161;stroke-miterlimit:1.283333;" d="M 116.287094 104.315445 L 104.315445 116.287094 "/>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="92.000000" y="228.602539">1</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="192.000000" y="228.602539">2</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="242.000000" y="142.000046">3</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="192.000000" y="55.397552">4</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="92.000000" y="55.397461">5</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="42.000000" y="142.000046">6</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="92.000000" y="128.602539">1</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="105.397453" y="178.602539">2</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="155.397461" y="192.000046">3</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="192.000000" y="155.397461">4</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="178.602539" y="105.397446">5</tspan></text>
<text font-family="Atkinson Hyperlegible" fill="white" font-size="18.333334" style="text-anchor: middle;dominant-baseline: middle;"><tspan x="128.602539" y="92.000000">6</tspan></text>
</svg>

Reproduction URL

No response

Operating system

Windows

Typst version

  • I am using the latest version of Typst

Activity

  1. added
    bug
    on Apr 28, 2023
  2. szdytom commented on Apr 28, 2023

    @szdytom
    ContributorAuthor

    It is possible that this is a bug of crate usvg(which is the SVG parsing library Typst used)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions