I originally posted this in the Javascript forum, as I was implementing this with Javascript. “Willy Duitt” replied that my answer “lays in CSS and em…”. Well, I tried searching, but since the search engine here requires that words in a search have at least 4 letters, I can’t search on those terms. So I ask your indulgence in pointing me to a reference or tutorial that helps with the following…
I want to make the text size on a page “dynamic”, in that I’d like to increase the font size to fill an iframe. I’m worried about the height, not the width. For example, I’d like my title to keep increasing in size if the browser was made larger (since everything on my page is done in percentages), and respond if it was smaller. It would also be nice to handle font changes (since my page template could be edited and a different font used).
Is there a way in Javascript to get the “text metrics” of a given font to see how big I can make the text before I start clipping the tops or the descenders?
I’ve tried searching, but I either search too broadly (e.g. javascript text height) or too narrowly (don’t find anything relevant).
Thanks!