Repository navigation
Closed
flutter/packages
#13287Labels
found in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31Found to occur in 3.31has 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 packagesp: vector_graphicsThe vector_graphics package setThe vector_graphics package setpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-engineOwned by Engine teamOwned by Engine team
Description
Steps to reproduce
- Create an SVG with a
List<double>for thexoryvalue in, for example, the<text>field - Open the SVG in any program that renders SVGs (e.g., macOS Preview.app) to verify the SVG displays correctly
- Validate the SVG against
vector_graphics_compiler
Expected results
The SVG should be validated correctly.
Actual results
SVGs containing a List<double> for x or y properties fail to validate.
Code sample
Code 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="1024"
height="1024"
>
<text
transform="translate(415.282 362.619)"
font-size="9.0427618"
font-family="Arial"
x="0 4.8639984 10.014633 14.741928 19.654434 22.608994 24.805069 29.955704 34.943176 37.18335 42.333984 45.473755 47.713928 52.785187 57.697693"
y="8"
>
Hello world
</text>
</svg>Working "fix":
svgImageString
..replaceAllMapped(
RegExp(r'(<text[^>]*\bx=")(\d+(?:\.\d+)?)[^"]*"'),
(Match m) => '${m[1]}${m[2]}"',
)
..replaceAllMapped(
RegExp(r'(<text[^>]*\by=")(\d+(?:\.\d+)?)[^"]*"'),
(Match m) => '${m[1]}${m[2]}"',
);Screenshots or Video
No response
Logs
Logs
dart run vector_graphics_compiler -i test.svg -o temp.svg --no-optimize-masks --no-optimize-clips --no-optimize-overdraw --no-tessellate
Resolving dependencies in `./`...
Downloading packages...
Got dependencies in `./`.
Building package executable...
Built vector_graphics_compiler:vector_graphics_compiler.
XXXXXXXXXXX test.svg XXXXXXXXXXXXX
FormatException: Invalid double
0, 4.8639984, 10.014633, 14.741928, 19.654434, 22.608994, 24.805069, 29.955...
#0 double.parse (dart:core-patch/double_patch.dart:112:7)
#1 parseDouble (package:vector_graphics_compiler/src/svg/numbers.dart:32:17)
#2 DoubleOrPercentage.fromString (package:vector_graphics_compiler/src/svg/parser.dart:2160:33)
#3 SvgParser._createSvgAttributes (package:vector_graphics_compiler/src/svg/parser.dart:1673:31)
#4 SvgParser._readSubtree (package:vector_graphics_compiler/src/svg/parser.dart:693:30)
#5 _SyncStarIterator.moveNext (dart:async-patch/async_patch.dart:595:13)
#6 SvgParser._parseTree (package:vector_graphics_compiler/src/svg/parser.dart:770:34)
#7 SvgParser.parse (package:vector_graphics_compiler/src/svg/parser.dart:805:5)
#8 parse (package:vector_graphics_compiler/vector_graphics_compiler.dart:76:17)
#9 encodeSvg (package:vector_graphics_compiler/vector_graphics_compiler.dart:143:5)
#10 IsolateProcessor._process.<anonymous closure> (file:///Users/hans/.puro/shared/pub_cache/hosted/pub.dev/vector_graphics_compiler-1.1.16/bin/util/isolate_processor.dart:111:33)
#11 _RemoteRunner._run (dart:isolate:1118:47)
#12 _RemoteRunner._remoteExecute (dart:isolate:1112:12)
#13 _delayEntrypointInvocation.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:318:17)
#14 _RawReceivePort._handleMessage (dart:isolate-patch/isolate_patch.dart:194:12)
Some targets failed.Flutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.29.2, on macOS 15.3.2 24D81 darwin-arm64, locale en-US)
[✓] Android toolchain - develop for Android devices (Android SDK version 35.0.0-rc3)
[✓] Xcode - develop for iOS and macOS (Xcode 16.2)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.3)
[✓] VS Code (version 1.98.2)
[✓] Connected device (4 available)
[✓] Network resources
• No issues found!Metadata
Metadata
Assignees
Labels
found in release: 3.29Found to occur in 3.29Found to occur in 3.29found in release: 3.31Found to occur in 3.31Found to occur in 3.31has 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 packagesp: vector_graphicsThe vector_graphics package setThe vector_graphics package setpackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.team-engineOwned by Engine teamOwned by Engine team
Activity
maheshj01 commentedon Mar 20, 2025
Reproducible using latest version of
vector_graphics_compiler: ^1.1.16logs
flutter doctor -v
master
stable
mackings commentedon Oct 16, 2026
I'd like to fix this. The compiler parses
x/yas a single number, so a list throws. I'll use the first value in the list, since per-character positioning isn't supported.[vector_graphics_compiler] Handle coordinate lists on text and tspan (#…
github-actions commentedon Nov 10, 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.