Jump to content
GreenSock

gareth

Split text along a path - letter spacing

Recommended Posts

I am trying to animate type along a svg path. Thanks to some help from demos on this forum, I am very close to the effect I am after. 

 

The problem I have is the kerning (space between each letter ) is messed up. I understand this is because I am not allowing for the individual character widths within my start and end positions. Is it possible to access these within the forEach loop?

See the Pen jOmeadL by garethj (@garethj) on CodePen

Link to comment
Share on other sites

You can get the position of every char and then figure out what adjustments to make. It will give you left, top, width, and height.

let bounds = char.getBoundingClientRect(); 


 

  • Like 3
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×