Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy is text rendered with a greater font-size in Opera?
    primarykey
    data
    text
    <p>I'm working on an HTML page that needs to be more or less pixel-perfect, and I noticed that in Opera 10, fonts are rendering larger than they do in other browsers, even though the font-size is effectively the same.</p> <p>Please see this example page in Opera 10 and another browser like Firefox 3.6:</p> <p><a href="http://troy.onespot.com/static/stack_overflow/opera_font_size.html" rel="noreferrer">http://troy.onespot.com/static/stack_overflow/opera_font_size.html</a></p> <p>Alternatively, here's a screenshot that illustrates the issue:</p> <p><a href="http://skitch.com/troywarr/d47m1/font-size" rel="noreferrer">http://skitch.com/troywarr/d47m1/font-size</a></p> <p>The red boxes behind the "50px" and "46px" text (both styled to have the corresponding font-size) both have a height of 50px.</p> <p>In Firefox 3.6, the descender of the "p" in "50px" lines up with the bottom of the red box behind it. In Opera, the descender of the "p" in "50px" hangs below; it's the "46px" that more closely matches the "50px" in Firefox. That suggests to me that Opera is rendering fonts in the ballpark of 10% too large.</p> <p>This, and the same issue with other body text, is completely throwing off my page layout in Opera 10. Please let me know if you have any ideas about what may be causing this, or at least how to prevent/fix it.</p> <p>Thanks!</p> <hr /> <p><strong>UPDATE:</strong></p> <p>It appears that I don't have a proper copy of Helvetica installed - I removed it from the font stack and saw no difference in the rendered text on my test pages.</p> <p>I updated the test pages to only use the generic "sans-serif" font-family, so hopefully we're all seeing the same thing now.</p> <p>Interestingly, using the generic "serif" font displays exactly the same in Opera and Firefox.</p> <p>Could this issue just be a quirk around how Opera displays the generic "sans-serif" font?</p> <hr /> <p><strong>UPDATE 2:</strong></p> <p>This may be important: I'm using Mac OS X Snow Leopard. I'm experimenting with other fonts now to see if I can isolate the issue any further.</p> <hr /> <p><strong>UPDATE 3:</strong></p> <p>I created another test page using Arial:</p> <p><a href="http://troy.onespot.com/static/stack_overflow/opera_font_size_reset_arial.html" rel="noreferrer">http://troy.onespot.com/static/stack_overflow/opera_font_size_reset_arial.html</a></p> <p>And now Opera and Firefox match almost exactly!</p> <p>I can probably get away with using Arial in lieu of Helvetica on this project. As far as I know, I have a completely stock OS X version of Helvetica - so I can't afford any disparity between how different users may be seeing the fonts on my page. I'll stick with the tried &amp; true Arial.</p> <p>What could this mean, though - does OS X's default sans-serif font just render strangely in Opera or something?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload