Repository navigation
Closed
flutter/packages
#13388Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectfound in release: 3.32Found to occur in 3.32Found to occur in 3.32has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: flutter_svgThe Flutter SVG drawing packagesThe Flutter SVG drawing packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team
Description
Imported from dnfield/flutter_svg#959
Original report by @Huber1 on Jul 7, 2023
When i am using SvgPicture.file() for the following svg, it doesn't render the text in the correct location. Like you can see it is offset in y-direction
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" id="Ebene_1" viewBox="0 0 1000 500" xml:space="preserve"><script xmlns=""/>
<rect fill="#C79514" width="1000" height="500"/>
<text text-anchor="middle" x="50%" y="50%" dy=".35em" font-family="Arial, sans-serif" font-weight="bold" font-size="425px" fill="#ffffff">21</text>
<style xmlns="" class="darkreader darkreader--fallback">html, body, body :not(iframe) {
background-color: #232425 !important;
border-color: #777067 !important;
color: #dddcd9 !important;
}</style></svg>The Text is not, as expected centered vertically and horizontally, but only centered horizontally
Is it a coincidence that the bottom line of the text is centered?
The Image is not cropped. I put it inside a Center on a blank screen to make sure it is completely visible
Metadata
Metadata
Assignees
Labels
P3Issues that are less important to the Flutter projectIssues that are less important to the Flutter projectfound in release: 3.32Found to occur in 3.32Found to occur in 3.32has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: flutter_svgThe Flutter SVG drawing packagesThe Flutter SVG drawing packagespackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-engineOwned by Engine teamOwned by Engine teamtriaged-engineTriaged by Engine teamTriaged by Engine team

Activity
darshankawar commentedon Jul 23, 2025
Verified with latest stable and plugin version:
[vector_graphics_compiler] Fix em units in text positions (flutter#13388
github-actions commentedon Nov 12, 2026
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.