AI image-to-SVG tools keep breaking Vietnamese text. I built a finishing tool that catches it.
AI image-to-SVG models (Baidu's Unlimited-SVG and friends) can turn a logo or diagram into an editable SVG with real <text> nodes. Then two things reliably go wrong for Vietnamese content: The artwork shrinks into the
AI image-to-SVG models (Baidu's Unlimited-SVG and friends) can turn a logo or diagram into an editable SVG with real <text> nodes. Then two things reliably go wrong for Vietnamese content:
- The artwork shrinks into the middle of a 1024Γ1024 canvas, so the SVG looks tiny everywhere you use it.
- Vietnamese diacritics break. Stacked diacritics (vowel mark + tone: the
αΊ± αΊ§ α» α» α» α»«families) get mangled,Γͺ-family tones drift, and characters that never occur in Vietnamese (Η,Γ«) appear β I have seenChiuΓ«andChΓ©uwhere the source saidChiΓͺu.
In a full-diacritics test I ran while building this, stacked diacritics broke in nearly every instance, while single tones and Δ mostly held. That measurement became the tool's risk tiers.
VietSVG is the small, honest finishing step between "the model made an SVG" and "you can ship it":
-
Tight auto-crop β computes the true content bounding box (paths, shapes, text, transforms; full-canvas backgrounds ignored) and rewrites the root
viewBox. In verification it matched a hand crop within 1 unit. -
Diacritic risk scan β every
<text>node flagged by tier:definite(character never occurs in Vietnamese),stacked(check every word),ocr(data-ocrdisagrees),digits,review. -
Confirmed fixes only β applies a
{wrong: right}JSON mapping a human confirmed. It never guesses text. - Optional AI proofreader (Grok, bring your own key) β suggestions land in a JSON file for you to confirm; nothing is auto-applied.
- Render proof β optional PNG so you can eyeball the result.
pip install vietsvg
vietsvg check logo.svg
vietsvg finish logo.svg --fix fixes.json --render
There's also a browser demo (everything runs locally, nothing is uploaded): https://konoha95.github.io/vietsvg/
The current release, v0.3.0, hardened the cropper and fixer after a deep code review: full transform math so rotated artwork is never clipped, fixes applied to parsed text nodes (so & in a correction can't break your XML), and an XSS-safe demo. 33 tests cover the failure modes I could reproduce.
Vietnamese is spoken by ~90 million people, and AI design tools keep shipping text that is almost right. Almost-right text in a logo is wrong text.
Repo: https://github.com/Konoha95/vietsvg (MIT). Bug reports with a minimal SVG that crops or flags wrong are gold.
Originally published by Dev.to AI. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.