Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SVG Text Problem - TextLength attribute not supported? #215

Closed
terjehelgesen opened this issue Mar 5, 2025 · 2 comments
Closed

SVG Text Problem - TextLength attribute not supported? #215

terjehelgesen opened this issue Mar 5, 2025 · 2 comments
Labels
enhancement New feature or request good first issue Good for newcomers

Comments

@terjehelgesen
Copy link

terjehelgesen commented Mar 5, 2025

Hi!

I'm very impressed of your great library and would very like to use it in my product.
I do however have one issue that is a small show-stopper.

The textlength attribute doesn't seem to be supported for text.
Is this correct?
https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/textLength

If so, could it be implemented?

Example SVG data that demonstrates what I mean is attached.
The result generated by LunaSVG is attached as publicrelease.png and the same file displayed in Edge is attached as edgeresult.png.
The SVG is also attached.
Edge:
Image
Rendered by LunaSVG:
Image
SVG data:
Image

@sammycage sammycage added the enhancement New feature or request label Mar 5, 2025
@sammycage
Copy link
Owner

Hey, thanks so much for your kind words and for sharing that detailed example—I really appreciate it! I'm happy to hear you're enjoying the library. The idea of adding support for the textLength attribute is super interesting, and I'm grateful you pointed out its potential. I don’t have any immediate plans to implement it right now because of some resource and scheduling challenges, but I promise I'll keep it in mind and look into it when I get a chance.

@sammycage
Copy link
Owner

sammycage commented Mar 6, 2025

Hello @terjehelgesen,

I'm pleased to inform you that support for the textLength and lengthAdjust attributes has now been implemented in lunasvg. This enhancement should address the issues you've encountered with text rendering.

Image

@sammycage sammycage added the good first issue Good for newcomers label Mar 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants