From: Helpful person on 23 Oct 2009 07:28 On Oct 22, 7:09 pm, C A Upsdell <cupsd...(a)nospam.not> wrote: > GTalbot wrote: > > On 19 oct, 00:54, C A Upsdell <cupsd...(a)nospam.not> wrote: > >> dorayme wrote: > >>>> There is a view that ex units should be used instead of em units. I > >>>> have recently found that using ex instead of em fixed some cross-browser > >>>> issues. See: > >>>> http://kb.mozillazine.org/Em_units_versus_ex_units > > > { > > At "normal" font sizes (the defaults on Windows systems, and possibly > > Linux and others), 1 em is 10.06667 pixels, and 1 ex is 6 pixels. > > } > > > That's not true. In IE (all versions), the "normal" default font size > > is 16px. And if 1em is 16px, then 1ex exact font-size expressed in > > pixels depends on the font family in use: > > Confirmed. I created a test page earlier today which computes em and ex > values, and I found these interesting results: > > With FF 3.5 running on Windows XP, when an em is 16px, the ex sizes for > Arial, Tahoma, Times New Roman, and Verdana are: > > 9px 9px 7px 9px > > When the size is reduced using font-size:small, the em size is 13px, and > the ex sizes are: > > 7px 7px 6px 7px > > With IE 7, also running on Windows XP, when an em is 16px, the ex sizes are: > > 8px 8px 8px 8px > > When the size is reduced using font-size:small, the em size is 13.33px, > and the ex sizes are: > > 6.67px 6.67px 6.67px 6.67px > > With Opera 10, also running on Windows XP, when an em is 16px, the ex > sizes are: > > 8px 8px 8px 8px > > When the size is reduced using font-size:small, the em size is 13px, and > the ex sizes are: > > 6.5px 6.5px 6.5px 6.5px > > Clearly FF, IE, and Opera use different methods of calculating ex > values, and different methods of calculating the small font size. I > don't like to generalize based on only 4 fonts on one platform, but it > would *appear* that: > > 1. IE and Opera set the ex value to half the em value. > > 2. FF sets the ex value to different fractions of the em value, > depending on the font (which is probably more correct). > > 3. IE makes no attempt to make the ex value an integer, nor does it > make any attempt to make the em value for small fonts an integer. > > 4. FF and Opera *may* be trying to set the em value for small fonts and > integer, though this is scarcely certain.- Hide quoted text - > > - Show quoted text - I'm glad we have standards or all this would be most confusing to a beginner like me! www.richardfisher.com
From: GTalbot on 23 Oct 2009 16:31 On 22 oct, 19:09, C A Upsdell <cupsd...(a)nospam.not> wrote: > GTalbot wrote: > > On 19 oct, 00:54, C A Upsdell <cupsd...(a)nospam.not> wrote: > >> dorayme wrote: > >>>> There is a view that ex units should be used instead of em units. I > >>>> have recently found that using ex instead of em fixed some cross-browser > >>>> issues. See: > >>>> http://kb.mozillazine.org/Em_units_versus_ex_units > > > { > > At "normal" font sizes (the defaults on Windows systems, and possibly > > Linux and others), 1 em is 10.06667 pixels, and 1 ex is 6 pixels. > > } > > > That's not true. In IE (all versions), the "normal" default font size > > is 16px. And if 1em is 16px, then 1ex exact font-size expressed in > > pixels depends on the font family in use: > > Confirmed. I created a test page earlier today which computes em and ex > values, and I found these interesting results: > > With FF 3.5 running on Windows XP, when an em is 16px, the ex sizes for > Arial, Tahoma, Times New Roman, and Verdana are: > > 9px 9px 7px 9px > > When the size is reduced using font-size:small, the em size is 13px, and > the ex sizes are: > > 7px 7px 6px 7px > > With IE 7, also running on Windows XP, when an em is 16px, the ex sizes are: > > 8px 8px 8px 8px Charles, It may not be reliable to test IE 7 and then conclude or generalize. IE 7 is buggy with the ex unit. Here's a test case I did in a bug on ex unit at connect IE beta feedback: Bug 409460: Accurate ex unit implementation in IE 7 https://connect.microsoft.com/IE/feedback/ViewFeedback.aspx?FeedbackID=409460 Test case: http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/accurate-ex-unit-implementation.html which is passed by IE 8 The decisive issue was the loose specification of ex unit { Some fonts contain reliable metrics for the x-height. If reliable font metrics are not available, UAs may determine the x-height from the height of a lowercase glyph. One possible heuristic is to look at how far the glyph for the lowercase "o" extends below the baseline, and subtract that value from the top of its bounding box. In the cases where it is impossible or impractical to determine the x-height, a value of 0.5em should be used. } CSS 2.1, section 4.3.2 Lengths, ex unit http://www.w3.org/TR/CSS21/syndata.html#length-units Recent font now include the value sxHeight (meaning small x height) [1] embedded in their file: this is the info that is referred to when stating "reliable metrics". Old font do not have a sxHeight data. Also, for performance purposes ("impractical"), small web-aware devices do not have to process such values and will use 0.5em There is a font/typographic inspecting software from Microsoft called ttfdump.exe ( http://www.microsoft.com/typography/tools/tools.aspx ) which allows anyone to examine the file of fonts on his system and he will know immediately if the sxHeight value is available. [1] sxHeight is defined here: http://partners.adobe.com/public/developer/opentype/index_os2.html#xh To use ttfdump.exe: ttfdump filename -tOS/2 -nx -h ex unit implementation in IE 8, ttfdump, sxHeight discussion here: http://blogs.msdn.com/ie/archive/2009/01/27/microsoft-submits-thousands-more-css-2-1-tests-to-the-w3c.aspx#9397177 > When the size is reduced using font-size:small, the em size is 13.33px, > and the ex sizes are: > > 6.67px 6.67px 6.67px 6.67px > > With Opera 10, also running on Windows XP, when an em is 16px, the ex > sizes are: > > 8px 8px 8px 8px > > When the size is reduced using font-size:small, the em size is 13px, and > the ex sizes are: > > 6.5px 6.5px 6.5px 6.5px > > Clearly FF, IE, and Opera use different methods of calculating ex > values, and different methods of calculating the small font size. I > don't like to generalize based on only 4 fonts on one platform, but it > would *appear* that: > > 1. IE and Opera set the ex value to half the em value. > You must mean IE 7 here. IE 8 does not set the ex value to half the em value. Please try http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/accurate-ex-unit-implementation.html Some other tests: Test 2 and test 3 at: http://www.richinstyle.com/test/keyconcepts/ex.html (the "x"s should be as high as the dark greenish rectangle images on their right side. The test is similar to the first/top part/section of http://www.damowmow.com/playground/bugs/tests/ex.html and there is several tests involving ex unit at IE test center (for CSS): http://samples.msdn.microsoft.com/ietestcenter/css.htm > 2. FF sets the ex value to different fractions of the em value, > depending on the font (which is probably more correct). > > 3. IE makes no attempt to make the ex value an integer, nor does it > make any attempt to make the em value for small fonts an integer. Again, that must be IE 7, not IE 8. regards, Gérard -- Internet Explorer 8 bugs: 57 bugs so far http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/ Internet Explorer 7 bugs: 183 bugs so far http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
From: C A Upsdell on 23 Oct 2009 16:51 GTalbot wrote: > On 22 oct, 19:09, C A Upsdell <cupsd...(a)nospam.not> wrote: >> GTalbot wrote: >>> On 19 oct, 00:54, C A Upsdell <cupsd...(a)nospam.not> wrote: >>>> dorayme wrote: >>>>>> There is a view that ex units should be used instead of em units. I >>>>>> have recently found that using ex instead of em fixed some cross-browser >>>>>> issues. See: >>>>>> http://kb.mozillazine.org/Em_units_versus_ex_units >>> { >>> At "normal" font sizes (the defaults on Windows systems, and possibly >>> Linux and others), 1 em is 10.06667 pixels, and 1 ex is 6 pixels. >>> } >>> That's not true. In IE (all versions), the "normal" default font size >>> is 16px. And if 1em is 16px, then 1ex exact font-size expressed in >>> pixels depends on the font family in use: >> Confirmed. I created a test page earlier today which computes em and ex >> values, and I found these interesting results: >> >> With FF 3.5 running on Windows XP, when an em is 16px, the ex sizes for >> Arial, Tahoma, Times New Roman, and Verdana are: >> >> 9px 9px 7px 9px >> >> When the size is reduced using font-size:small, the em size is 13px, and >> the ex sizes are: >> >> 7px 7px 6px 7px >> >> With IE 7, also running on Windows XP, when an em is 16px, the ex sizes are: >> >> 8px 8px 8px 8px > > Charles, > > It may not be reliable to test IE 7 and then conclude or generalize. > IE 7 is buggy with the ex unit. I have done further, more detailed tests. These indicate that IE 7 (haven't tested the other versions yet) always sets the ex/em ratio to 0.5 exactly. So does Opera 10 (again haven't tested the other versions yet). Other browsers report different ratios, but it would appear that, of the browsers I tested, only Safari sets the ratio correctly: FF and Chrome almost do, except that they set ex sizes to integers, which introduces distortions. If you contact me directly -- you have my email address, I know -- I will give you the URL of a page which has a table reporting the em and ex sizes for various fonts. You can see yourself what the sizes are for various browsers.
From: GTalbot on 23 Oct 2009 17:18 On 23 oct, 04:45, Andy Dingley <ding...(a)codesmiths.com> wrote: > On 22 Oct, 22:08, GTalbot <newsgr...(a)gtalbot.org> wrote: > > > That's not true. In IE (all versions), the "normal" default font size > > is 16px. > > Doesn't that depend on the Windows desktop too, and the font scaling > applied there (Display|Properties|Large Fonts) Well, you can try it yourself. When I do Start/Settings/Control Panel/Display/Appearance tab/Font size: Normal or Large Fonts or Extra Large Fonts then the normal default font size for unstyled text (typically a <p>text</p>) in a webpage in IE 7 and IE 8 is 16px (I'm using XP Pro SP3). This is also the case for Firefox (all versions) and Seamonkey. One other way to verify/test this is to load a webpage, any webpage and then, in IE 7 or IE 8, do: Tools/Internet Options/General tab/Accessibility button/Ignore font size specified on webpages, then check that checkbox and then examine the font size of a <p> and it should be 16px. Please keep in mind that IE 8 is now very closely following the default stylesheet given for HTML 4: CSS 2.1, Appendix D. Default style sheet for HTML 4 http://www.w3.org/TR/CSS21/sample.html CSS2.1 User Agent Style Sheet Defaults http://css-class.com/test/css/defaults/UA-style-sheet-defaults.htm regards, Gérard -- Internet Explorer 8 bugs: 57 bugs so far http://www.gtalbot.org/BrowserBugsSection/MSIE8Bugs/ Internet Explorer 7 bugs: 183 bugs so far http://www.gtalbot.org/BrowserBugsSection/MSIE7Bugs/
First
|
Prev
|
Pages: 1 2 3 4 Prev: using Avant Garde font Next: enforcing margins by munging existing document |