Jump to content

ttf letter-spacing


Recommended Posts

  • 9 months later...

I know this is an old post but it's still relevant, so here is a little trick I came with if you want something simpler. What I'm doing is taking my original text string and adding hair spaces in between the letters. It might not work for all fonts but it works great with the one I'm using. You can make the letters move further apart by using more hair spaces, em spaces, or another type of space. I copied and pasted from https://www.cs.tut.fi/~jkorpela/chars/spaces.html.

var charCopy = '';for (var c = 0; c < chars.length; c++) {	charCopy += chars.charAt(c) + ' '; // hair space}chars = charCopy.substr(0, charCopy.length - 1);
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Create New...