I think the problem is the relatively high height of the 10th century Gothic. Try using exunits in your ad font-size. exunits are based on height, in contrast em, pxand pt.
Setting the size line-heightto pixel will also help normalize the height, but will cause problems for users who change the zoom level of the text in their browser.
Edit: I came back and tested, but the ex units did not help. Century Gothic is taller and taller than others.
, DOM , , CSS ( ) .
JQuery . , , .
, , , , .
:
<style>
p { font-size: 15pt;
font-family:"Tw Cen MT","Gill Sans","Century Gothic",sans-serif;
}
p#testwidth {
margin:0; padding:0; border:none; color:white; display:inline;
}
</style>
<p>Your text goes here.</p>
<p id="testwidth">m</p>
<script language="Javascript">
window.onload = function() {
var desiredFontSize = 15;
var expectedWidth = 17;
var testedWidth = $('#testwidth').width();
var normalizedFontSize = Math.round(
expectedWidth / testedWidth * desiredFontSize * 10) / 10;
$('p').css('font-size', normalizedFontSize + 'pt');
}
:
- . .. , .
- , , . , .
- , , IE , . .
- "m". , , ( ). .