Re: [css-d] font-family font sizes
On 5/18/07, Philippe Wittenbergh [EMAIL PROTECTED] wrote: On May 18, 2007, at 6:44 AM, Jukka K. Korpela wrote: On Thu, 26 Apr 2007, Philippe Wittenbergh wrote: The only problem I have atm is finding the aspect value for a given font. The font contains that information, but I haven't found an utility to tell me that value, nor any resource for it - especially for fonts I don't have. This sounds like an odd situation. Are we all expected to find out such things by ourselves? I don't know if the following is accurate or not, anyway: - The aspect ratio is defined as ratio between x-height and font-size. - The x-height is the unit used in CSS lengths expressed in 'ex'. - Gecko seems able to use an accurate 'ex' unit (I guess it is extracted from the font in use, even version not supporting font-size-adjust seem to have a good 'ex') Putting together the above, if we trust Gecko, the aspect ratio of a font can be obtained simply observing the size of an element dimensioned using 'ex' units. I've created a quick and dirty test page [1], with includes due elements sized one in 'em' and another in 'ex'. A javascript gets the size of the elements in pixels and computes their ratio. This should be the aspect value of the font in use. To minimize errors a big font size is used (and the computation is repeated with some different font size / widths, the results compared, and discrepancies signaled.) I get reasonable results, maybe with the exception of Verdana, where I get as aspect value 0.55 (not 0.58) In the page I've also added a red line drawn at 'baseline - x-height' to visually check the accuracy of the computed x-height. And there is the possibility to choose a second font family, which is then displayed (with and without font-size-adjust) together with the main one (Again: the page makes sense only if using Gecko.) Bruno [1] http://brunildo.org/test/xheight.pl __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] font-family font sizes
On Fri, 18 May 2007, Philippe Wittenbergh wrote: It seems that font-size-adjust helps in some sizing issues on Firefox 2 (Windows) - - Yeah, it helps readability of articles, like when you mix two font- families in the same run of text: p text text codecode/code text text/p where code uses a monospaced font and p uses a sans-serif font. Interesting. It seems to help with the problem that monospace fonts and proportional fonts are quite often too differently sized. I wonder if we can (and should) simply set * { font-size-adjust: 0.5; } where 0.5 is to be replaced by the relative x-height (aspect ratio) of the primary font suggested for copy text. So far I haven't found any risks with this idea, but there are surely some nasty bugs lurking around somewhere. On a slightly un-related note: may I assume that those have the full range of unicode characters available when installed on XP or Vista ? No, the coverage is still rather limited, but it includes Unicode 5 coverage _for some scripts_ (Latin, Greek, Cyrillic, some others). There is _no_ font that covers all of Unicode. (Code2000 probably comes closest to covering BMP.) This might be relevant if you use special characters that have to be taken from fonts other than the copy text font. If a character is designed in a small size relative to the font size, then the font size adjustment may turn it into too small (or too large). But this is just a possibility and not a very serious one, as compared with all the other problems you have with special characters and insufficient coverage in fonts. Afaik, upgrading to the latest MS Office installs those fonts. Yes, and most of them are also available from microsoft.com for some older versions of Windows, such as XP. -- Jukka Yucca Korpela, http://www.cs.tut.fi/~jkorpela/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] font-family font sizes
On Thu, 26 Apr 2007, Philippe Wittenbergh wrote: font-size-adjust works on the first specified font-family in the stylesheet. You know that the value for Verdana is 0.58 [1]. You specify that. If you have 'Verdana', no problems arise, as you say. If 'Verdana' is not available, the size of the font that is actually used will be enlarged or reduced to match the aspect value of 'Verdana'. I'm returning to this discussion we had a few weeks ago, since I learned a lot from it but did not quite get some specifics. It seems that font-size-adjust helps in some sizing issues on Firefox 2 (Windows) and does not hurt when it does not work, so it's reasonable to use it fairly often. Moreover, the new sans-serif fonts in Vista seem to have fairly small aspect ratios, so that there will be some problems when you write, say, font-family: Calibri, Arial, sans-serif; The only problem I have atm is finding the aspect value for a given font. The font contains that information, but I haven't found an utility to tell me that value, nor any resource for it - especially for fonts I don't have. This sounds like an odd situation. Are we all expected to find out such things by ourselves? I guess I can get to sufficiently accurate results by, say, using to copies of letter x side by side, one in Verdana in a very large font size, the other in the font being investigated. Then I can tune the font size of the latter x so that the x's are equally tall, and then I simply divide the font sizes and multiply the result by 0.58. But this is rather clumsy and boring. -- Jukka Yucca Korpela, http://www.cs.tut.fi/~jkorpela/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] font-family font sizes
On May 18, 2007, at 6:44 AM, Jukka K. Korpela wrote: On Thu, 26 Apr 2007, Philippe Wittenbergh wrote: font-size-adjust works on the first specified font-family in the stylesheet. You know that the value for Verdana is 0.58 [1]. You specify that. If you have 'Verdana', no problems arise, as you say. If 'Verdana' is not available, the size of the font that is actually used will be enlarged or reduced to match the aspect value of 'Verdana'. I'm returning to this discussion we had a few weeks ago, since I learned a lot from it but did not quite get some specifics. It seems that font-size-adjust helps in some sizing issues on Firefox 2 (Windows) and does not hurt when it does not work, so it's reasonable to use it fairly often. Yeah, it helps readability of articles, like when you mix two font- families in the same run of text: p text text codecode/code text text/p where code uses a monospaced font and p uses a sans-serif font. As you say, no damage done when the browser doesn't support font-size- adjust. And bonus points for the browser that does support it. Moreover, the new sans-serif fonts in Vista seem to have fairly small aspect ratios, so that there will be some problems when you write, say, font-family: Calibri, Arial, sans-serif; I haven't tested those fonts yet. I have them available for install on my OS X machines (thanks anonymous donor), but haven't had time to do more. Heard good things about them, though. --- On a slightly un-related note: may I assume that those have the full range of unicode characters available when installed on XP or Vista ? Afaik, upgrading to the latest MS Office installs those fonts. --- The only problem I have atm is finding the aspect value for a given font. The font contains that information, but I haven't found an utility to tell me that value, nor any resource for it - especially for fonts I don't have. This sounds like an odd situation. Are we all expected to find out such things by ourselves? I guess I can get to sufficiently accurate results by, say, using to copies of letter x side by side, one in Verdana in a very large font size, the other in the font being investigated. Then I can tune the font size of the latter x so that the x's are equally tall, and then I simply divide the font sizes and multiply the result by 0.58. But this is rather clumsy and boring. That is the kind of exercise I've been doing on and off - kind of boring as you say. I created a two line string of text, duplicated it, and compared: p {font-family:;} p.adjust {font-size-adjust: value;} /* start filling in values here until both paragraphs match*/ Better do this at large font-sizes to really notice differences (I used 30px and 50px). Not scientific at all, of course. Some people have been doing with illustrator+ photoshop, and counting pixels. There are a couple of hits on the first 3-4 pages when asking Uncle google. Philippe --- Philippe Wittenbergh http://emps.l-c-n.com __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] font-family font sizes
On Tue, 24 Apr 2007, Philippe Wittenbergh wrote: font-size-adjust is support by Gecko (Firefox) on Windows. Firefox 3.0/Gecko 1.9 will have support for it on all platforms. Unfortunately, no other browser support it at the time of writing. That's interesting news. But presumably there won't be any support in IE in the foreseeable future. And I don't quite get the idea. The property is supposed to help in situations like font-family: Verdana, Arial, sans-serif; so that I can handle the problem that Verdana looks larger than Arial of the same size, so if I set the size suitable for Verdana, it will be too large for Arial. But it is supposed to help so that the browser analyzes the properties (basically, x height) of the fonts listed, the adjusts the font size accordingly. How can this help? If my system has Verdana, it will be used, and the problem does not arise. If my system has no font under that name, how is the browser expected to know the properties of the font? So it seems that this could only help when the primarily suggested font (and thus its font information) _is_ available but its use has been prevented. This is a possible scenario, but hardly a common one. -- Jukka Yucca Korpela, http://www.cs.tut.fi/~jkorpela/ __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] font-family font sizes
Jukka K. Korpela wrote: On Tue, 24 Apr 2007, Philippe Wittenbergh wrote: font-size-adjust is support by Gecko (Firefox) on Windows. Firefox 3.0/Gecko 1.9 will have support for it on all platforms. Unfortunately, no other browser support it at the time of writing. That's interesting news. But presumably there won't be any support in IE in the foreseeable future. And I don't quite get the idea. The property is supposed to help in situations like font-family: Verdana, Arial, sans-serif; so that I can handle the problem that Verdana looks larger than Arial of the same size, so if I set the size suitable for Verdana, it will be too large for Arial. But it is supposed to help so that the browser analyzes the properties (basically, x height) of the fonts listed, the adjusts the font size accordingly. How can this help? If my system has Verdana, it will be used, and the problem does not arise. If my system has no font under that name, how is the browser expected to know the properties of the font? So it seems that this could only help when the primarily suggested font (and thus its font information) _is_ available but its use has been prevented. This is a possible scenario, but hardly a common one. font-size-adjust works on the first specified font-family in the stylesheet. You know that the value for Verdana is 0.58 [1]. You specify that. If you have 'Verdana', no problems arise, as you say. If 'Verdana' is not available, the size of the font that is actually used will be enlarged or reduced to match the aspect value of 'Verdana'. Here is a test case. The first paragraph doesn't have a value for font-size-adjust specified; the second has. http://dev.l-c-n.com/_temp/font-size-adjust.html Remove/disable 'Verdana' on your system. It then looks like this on my system (OS X, Gecko latest trunk build): http://dev.l-c-n.com/_b/font-size-adjust.png The only problem I have atm is finding the aspect value for a given font. The font contains that information, but I haven't found an utility to tell me that value, nor any resource for it - especially for fonts I don't have. [1] http://www.w3.org/TR/REC-CSS2/fonts.html#propdef-font-size-adjust http://www.w3.org/TR/css3-fonts/#font-size-props Philippe --- Philippe Wittenbergh http://emps.l-c-n.com __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
[css-d] font-family font sizes
Take the site www.syntony.org I have specified garamond for the titles because it most closely matches the logo I was given, and georgia as a fall-back. However it strikes me that georgia appears quite a bit larger than garamond even at the same specified font size. Although I realise we don't have total control over font sizes (nor should we), however because I use a sans-serif font for the main text, the proportions of the type are affected. Is there a way to specify different font sizes depending on which font is actually used? regards, D# __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] font-family font sizes
Take the site www.syntony.org I have specified garamond for the titles because it most closely matches the logo I was given, and georgia as a fall-back. However it strikes me that georgia appears quite a bit larger than garamond even at the same specified font size. Although I realise we don't have total control over font sizes (nor should we), however because I use a sans-serif font for the main text, the proportions of the type are affected. Is there a way to specify different font sizes depending on which font is actually used? http://www.w3.org/TR/REC-CSS2/fonts.html#font-size-props font-size-adjust would appear to help : quoting from the above page In bicameral scripts, the subjective apparent size and legibility of a font are less dependent on their 'font-size' value than on the value of their 'x-height', or, more usefully, on the ratio of these two values, called the aspect value (font size divided by x-height). The higher the aspect value, the more likely it is that a font at smaller sizes will be legible. Inversely, faces with a lower aspect value will become illegible more rapidly below a given threshold size than faces with a higher aspect value. Straightforward font substitution that relies on font size alone may lead to illegible characters. For example, the popular font Verdana has an aspect value of 0.58; when Verdana's font size 100 units, its x-height is 58 units. For comparison, Times New Roman has an aspect value of 0.46. Verdana will therefore tend to remain legible at smaller sizes than Times New Roman. Conversely, Verdana will often look 'too big' if substituted for Times New Roman at a chosen size. The problem is whether that's supported by browsers... according to w3schools.com, it's in the CSS2 spec but currently unsupported (http://www.w3schools.com/css/css_reference.asp#font) -Simon __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] font-family font sizes
On Apr 24, 2007, at 7:31 PM, Simon White wrote: Is there a way to specify different font sizes depending on which font is actually used? http://www.w3.org/TR/REC-CSS2/fonts.html#font-size-props font-size-adjust would appear to help : quoting from the above page [...] The problem is whether that's supported by browsers... according to w3schools.com, it's in the CSS2 spec but currently unsupported (http://www.w3schools.com/css/css_reference.asp#font) font-size-adjust is support by Gecko (Firefox) on Windows. Firefox 3.0/Gecko 1.9 will have support for it on all platforms. Unfortunately, no other browser support it at the time of writing. Philippe --- Philippe Wittenbergh http://emps.l-c-n.com __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/
Re: [css-d] font-family font sizes
Philippe Wittenbergh wrote: On Apr 24, 2007, at 7:31 PM, Simon White wrote: Is there a way to specify different font sizes depending on which font is actually used? http://www.w3.org/TR/REC-CSS2/fonts.html#font-size-props font-size-adjust would appear to help : quoting from the above page font-size-adjust is support by Gecko (Firefox) on Windows. Firefox 3.0/Gecko 1.9 will have support for it on all platforms. Unfortunately, no other browser support it at the time of writing. Philippe and Simon, Thanks for the detailed replies - looks like I have a bit more reading to do. I'm curious as to what happens then with Safari swapping fonts to simulate italic text... http://alistapart.zeldman.com/2006/11/27/safari-beats-firefox/ What if the next font on the list appears noticably different in size to the current? Is this something anyone else has come across? Regards, D# __ css-discuss [EMAIL PROTECTED] http://www.css-discuss.org/mailman/listinfo/css-d IE7 information -- http://css-discuss.incutio.com/?page=IE7 List wiki/FAQ -- http://css-discuss.incutio.com/ Supported by evolt.org -- http://www.evolt.org/help_support_evolt/