I'm making a lyrics + chords display, and I want to take this raw format:
[Dm]Hello darkness my old [C]friend
And put the chords above the lyrics. I can do it by making each word a div, and making the chord absolute/relative to the word, however that means people can't copy and paste everything into a WYSIWYG editor like Word.
So instead I want to have a line above the lyrics that is padded out with spaces, like this:
Dm C
Hello darkness my old friend
It's easy with monospace text, but I want to use fonts like Arial/Times. Is there a way to calculate how many spaces would approximate the length of some text?
Note—before everyone says "oh you should use a different method to display the chords", I've tried a few methods, but I'm specifically looking for something I can copy and paste without losing chord placement.