This may seem an odd request, but I need to set the width of individual characters and have them act like normal text in a flowing paragraph. Here's an example:
Ugliness aside, this is fine except for the fact that the words are being split in half when wrapping. Any ideas on how to work around this?
If you change display to "inline", the wrapping works but the inline elements can't be given a width.
Using letter-spacing instead of width might suffice, but I'd need to calculate something like:
width = letter-spacing - (actual character width as rendered)
But again, getting the real width of an inline element seems tricky.
The html/text side of things can't be easily modified (e.g. a solution such as adding manual line breaks and setting css nowrap), it's being sent by a separate service, so any processing of it needs to be automated.
Note: The font must be Arial, so not a fixed-width font and I need to support IE8+
Edit: Sorry, it needs to support inner formatting tags, like strong or em (example updated). This isn't normally supported in letteringjs, so i'm using this fork to prevent these tags from being stripped:
https://github.com/maranomynet/Lettering.js/blob/master/jquery.lettering.js