W3C home > Mailing lists > Public > www-style@w3.org > August 2013

Re: [css3-fonts] font-size-adjust auto issue (was: Comments on CSS3 Fonts Module LC)

From: Gérard Talbot <www-style@gtalbot.org>
Date: Tue, 20 Aug 2013 11:06:54 -0400
Message-ID: <ec9b021de5183af9b6fd7658a65d9eef.squirrel@ed-sh-cp3.entirelydigital.com>
To: "John Daggett" <jdaggett@mozilla.com>
Cc: "Vladimir Levantovsky" <vladimir.levantovsky@monotype.com>, "W3C Style" <www-style@w3.org>

Le Mar 20 août 2013 0:36, John Daggett a écrit :
>
> Vladimir Levantovsky wrote:
>
>> Yes, this is exactly how I understood it and this is why I raised an
>> objection to having the value <auto> defined for 'font-size-adjust'
>> property. Authors who know what they're doing and who know exactly
>> what they want to achieve will use <number> to define the value of
>> the property, but I am afraid that many will be mislead by <auto>
>> definition that promises to "behave just like a <number>" but, in
>> fact, does nothing useful for them. This is exactly the reason I
>> suggested to get rid of <auto> and allow the value to be defined
>> either as <number> or <none>.
>
> Setting 'font-size-adjust' to *any* value maintains the x-height by
> scaling the font size depending on the aspect ratio of the actual font
> used.  Using 'auto' merely obviates the need to set an arbitrary
> value, it instead uses the aspect ratio of the user agent's default
> font (i.e. == initial value of 'font-family').

Times' aspect value: 0.439
according to
font-size-adjust value finder
http://wizard.ae.krakow.pl/~jb/font-size-adjust.html

Futura's aspect value: 0.51
according to
WebspaceWorks Resources (Fonts and typography)
http://www.webspaceworks.com/resources/fonts-web-typography/43/

Verdana'a aspect value: 0.545


> For example, if Times is the default font and has an aspect ratio of
> 0.5, then the two style declarations below are equivalent:
>
>   font-size-adjust: auto;
>   font-size-adjust: 0.5;
>
> So is your contention here that authors should just use '0.5' or some
> arbitrary value rather than using 'auto'?
>
>> So, one will never see the kind of adjustment illustrated by Fig. 19
>> when using <auto> - why bother having it defined for this property
>> in the first place?
>
> No, any fonts used will be resized so that the x-height matches the
> x-height of the default font at the original size.


In that above sentence, did you mean to say "actual font at the original
size" or you really meant to say "default font at the original size"?

I see that the spec also mentions default:
"
auto
    Behaves just like <number>, except the number used is the aspect value
calculated by user agents for the first font in the list of fonts
defined for the initial value of the ‘font-family’ property.
Effectively this is the *_default font_* used when ‘font-family’ is
not otherwise specified.
"
http://www.w3.org/TR/css3-fonts/#font-size-adjust-prop


>  If Futura has an
> aspect value of 0.4, Verdana 0.6 and the default Times 0.5, the
> resulting font sizes will be calculated as in the example below:
>
>   font-family: Futura, Verdana;
>   font-size-adjust: auto;
>   font-size: 20px;
>
> When Futura used:
>
>   used font size = ( 0.5 / 0.4 ) * 20px ==> 25px
>
> When Verdana used:
>
>   used font size = ( 0.5 / 0.6 ) * 20px ==> 16.67px
>
> So authors *will* see the sort of adjustment seen in Fig. 19 when
> using the 'auto' value.  The relatively high x-height of Verdana will
> be matched with the relatively low x-height of Futura.
>
> If possible, could you explain why you think the 'auto' value "does
> nothing useful for [authors]"?  I feel like I'm missing something
> here, sorry.


I think I understand what Vladimir wanted to say. Generally speaking, most
of the time, the 'auto' keyword refers to default value, the per se value
or initial value. Not in this case. And so, the use of auto is a bit
counter-intuitive from a CSS perspective.



body
{
font-family: "Times New Roman";
font-size-adjust: auto;
}

really does nothing. If "Times New Roman" is an available and installed
font, then 'font-size-adjust: auto;' does nothing, accomplishes nothing.
And if "Times New Roman" is not available, is not installed, then how is
the operating system going to know that Times New Roman's aspect value is
0.450 and that the system default should take this into consideration?
How does the user agent going to use the c  =  ( a / a' ) s equation if
the a variable is unknown to the user agent?

But I also do not see how 'auto' can actually work in a real webpage
situation with real visitors (with various operating systems and with
various, different installed fonts).

Let's take your example here:

   font-family: Futura, Verdana;
   font-size-adjust: auto;
   font-size: 20px;

I do not have Futura font installed on my Linux (debian-based) system. I
do not have Verdana installed either.

~$ fc-match Futura
DejaVuSans.ttf: "DejaVu Sans" "Book"

So, my system will resort to "DejaVu Sans" font instead which has an
aspect value of 0.55. In such situation, what would be the value of a
variable in the c  =  ( a / a' ) s equation ?


The only way I can see this 'auto' value working would be if the user
agent has a list (or map) of font names with correspondent aspect value,
especially font names of fonts that are not installed on the user's
operating system.


--------

By the way, I've been working on a first test to be submitted for
font-size-adjust and section 3.6:

http://www.gtalbot.org/BrowserBugsSection/CSS3Fonts/font-size-adjust-001.html

Gérard
-- 
CSS 2.1 Test suite RC6, March 23rd 2011
http://test.csswg.org/suites/css2.1/20110323/html4/toc.html

Contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/

Web authors' contributions to CSS 2.1 test suite
http://www.gtalbot.org/BrowserBugsSection/css21testsuite/web-authors-contributions-css21-testsuite.html
Received on Tuesday, 20 August 2013 15:07:32 UTC

This archive was generated by hypermail 2.4.0 : Friday, 25 March 2022 10:08:33 UTC