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

Incorrect kerning between tSpans #68

Open
HackbrettXXX opened this issue Jan 15, 2019 · 3 comments
Open

Incorrect kerning between tSpans #68

HackbrettXXX opened this issue Jan 15, 2019 · 3 comments
Labels

Comments

@HackbrettXXX
Copy link
Member

The space between the following tSpans is slightly too large

<text><tSpan>f</tSpan><tSpan>e<tSpan></text>

compared to

<text>fe</text>
@yGuy
Copy link
Member

yGuy commented Jan 17, 2019

This is a minor issue. This would require a lot of work that is probably not worth the investment. There are more complex issues with font rendering and font-kerning that should be addressed, first, IMHO.

@Mrfence97
Copy link
Contributor

I may have a solution that involves measuring the text a few times, I'll code it up and see how well it works.

There also appears to be a difference between Chrome and Firefox when it comes to inter-tspan kerning. Chrome behaves like font-kerning is set to none whereas Firefox applies kerning.

<svg font-family="serif" viewBox="0 0 550 600" xmlns="http://www.w3.org/2000/svg">
  <text y="50" x="20" style="font-kerning: auto;"><tspan>agbW</tspan><tspan>A</tspan></text>
  <text y="70" x="20" style="font-kerning: auto;">agbWA</text>
  <text y="90" x="20" style="font-kerning: none;"><tspan>agbW</tspan><tspan>A</tspan></text>
</svg>

image

@HackbrettXXX
Copy link
Member Author

@Mrfence97 thanks for digging into this. Did you make any progress?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants