Re: font-size-adjust in CSS3 Fonts module

2011-05-03 18:53 EEST: Peter Constable:
> From: L. David Baron [mailto:dbaron@dbaron.org]
>> I don't think this is true:  an alternative way to look at how the
>> property works is what I described in
>> http://dbaron.org/log/20080613-firefox3-css : # the way I like to
>> think about it is that is a way for style # sheets to pick font
>> size by the size of the x-height rather than # the size of the
>> font. It's just a way to do this that is backwards-compatible with
>> browsers that don't support it.
> 
> Your description seems like a good way to think of it. And I found
> this description much clearer than what's described in the Fonts
> draft. However, this doesn't address my comments, which was about how
> a developer determines what value to set. That can only be done in
> one of four ways: (i) you have font tools and know exactly what data
> in a font to read (unitsPerEm in the head table, and sxHeight in the
> OS/2 table), (ii) you craft a test page with two spans and tweak
> values by hand in a trial-and-error fashion (the method described in
> the spec), (iii) you find some table with values for known fonts that
> someone has published (which doesn't help if you want to use any font
> not in that table), or (iv) you find someone who has crafted some
> tool just for this purpose.

How do authors decide what they need to enter as "font-family"? That is
not exactly clear, either (especially for fonts with non-ASCII names).
They usually need real tools for the job or they must apply
trial-and-error method (usually just the "error" in the real world). A
proper tool could be something as simple as
http://brunildo.org/test/fontlist3.html

User agents could also provide better support for figuring out correct
font-size-adjust value for a font (or in case of Firefox, it could be
part of some developer extension). The idea is that the author wouldn't
specify font-size-adjust at first but just set the font-size as
appropriate for the style. After that, the User Agent (or any other
tool) could compute the correct font-size-adjust value for the used
font-family property value (the font-size-adjust value would keep the
"current" visual result intact) and the author could then enter that
value into the style sheet. Such a tool could even look through already
defined CSS rules and generate an additional style sheet that included
only selectors that were used to set font-family property and set
matching font-size-adjust everywhere.

I have used font-size-adjust on real web pages before (as a page author)
and I do think that it's a nice feature to have. Unfortunately, user
agent support is poor (only Gecko as far as I can see).

-- 
Mikko

Received on Wednesday, 4 May 2011 11:19:53 UTC