Calculate width of letter
Is there a way to calculate the width of a letter based upon the font,size, bold and other properties???
Thanks for the answer
Possibly by puting it inside a span and testing the size of the span.
Of course you also need to allow for when the letter doesn't have a font or size such as when it has a voice and pitch instead. You also can't rely on what you put in your stylesheet since your visitors can easily change it to suit themselves.
Thanks for the reply. I was actually wondering if there was a way to do it on the fly. If some one at some time did some sort of averaging of letter widths. I do at this point calculate the height of the lement based upon the font size but the width is eluding me.
It would vary by font-style, so doing it without using a span as Felgall suggested would be almost impossible.
Originally Posted by thechasboi
Inserting text or letters into a span is not a bad idea but it is extrememly time consuming. I was hoping there was a different way of achieving this goal. Thanks for the answer
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)