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: Levantovsky, Vladimir <Vladimir.Levantovsky@monotype.com>
Date: Fri, 16 Aug 2013 14:51:26 +0000
To: John Daggett <jdaggett@mozilla.com>
CC: W3C Style <www-style@w3.org>
Message-ID: <79E5B05BFEBAF5418BCB714B43F4419923DF7D07@wob-mail-01>
Hi John,

On Friday, August 16, 2013 2:21 AM you wrote:
> Vladimir Levantovsky wrote:
> > In subclause 3.6: "font-size-adjust" - the specified value of 'auto'
> > may be misleading.
> >
> > The "font-size-adjust" property is intended to preserve the
> legibility
> > of text rendered on various platforms (where a set of available fonts
> > may vary) by adjusting the x-height  according to a defined aspect
> > value, as illustrated by Fig. 19. The description of 'auto' seems to
> > offer a promise of an easy way out where the aspect value is expected
> > to be calculated by a UA for a given "first choice" font. However, it
> > is not clear how this value would be calculated on a platform where
> > the "first choice" font (e.g. "Verdana", as being used as an example
> > in the spec) is not available. It seems that in that case the effect
> > of the font-size-adjust would be 'no adjustment', which is
> > contradictory to what the intended usage of the "font-size-adjust"
> > should be.
> I think you're misreading the definition of 'auto':
> # 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.
> Note the term "initial value of the 'font-family' property".  That's
> basically describing the default font used by the user agent.  It's
> *not* describing the first family in the font family list, if that's
> what you are thinking. If the aspect ratio of the default font is 0.59,
> then 'auto' is equvialent to:
>   font-size-adjust: 0.59;

It's not just the definition of 'auto' that raised a concern, it is the description of intended usage of 'font-size-adjust' [in conjunction with the 'auto' value] that seems to be misleading. The description of the property rightly states that

#   In situations where font fallback occurs, fallback fonts may not share 
#   the same aspect ratio as the desired font family and will thus appear 
#   less readable. The font-size-adjust property is a way to preserve the 
#   readability of text when font fallback occurs. It does this by adjusting 
#   the font-size so that the x-height is the same regardless of the font used.

Followed by the example 3 and the illustration in Fig. 19 it clearly shows that the aspect value for all three fonts defined in the example are adjusted to match the aspect value of the first font "Verdana". When "Verdana" is present, the aspect value "auto" will result in calculating the proper, intended number for 'font-size-adjust' property (although I am not sure why this is needed - if you have Verdana on the platform UA will use Verdana so the adjustments are not necessary).

However, in the real world, "Verdana" may or may available on a particular platform.  My understanding that, in case when Verdana is missing, the intent of the property is to adjust the x-height of other fallback fonts to match proportions of Verdana and preserve the legibility of text, and this is going to happen as intended if the property value is defined as the number that reflects the aspect value of Verdana. I don’t think that the value of 'auto' would have the same effect - if the first font is missing the UA will use next one defined in the 'font-family' list ("Futura" in this example). Assuming that "Futura" is available, what will the value of 'font-size-adjust = auto' be? What effect will it make on text rendering? 

> All user agents have some form of default font, otherwise you'd never
> see text... :P

Yes, some text is always better than no text, but we are not there yet. The example 3 defines three fallback fonts so the default will kick in if all three are missing. Speaking of the default font - what relevance does it make for the 'auto' value? The sentence in the spec describing it:

#   Effectively this is the default font used when ‘font-family’ is not
#   otherwise specified.

doesn’t seem to have much sense to me.

> > [It may also be useful to mention that adjusting x-height of a font
> > will affect ascender and descender values, which may results in
> > collisions between them for a given font size / line height, or,
> > depending on a UA rendering engine, it may possibly result in
> cropping
> > of parts of the glyphs if the increase of ascender/descender values
> > conflicts with a font bounding box.]
> The 'font-size-adjust' property uses the x-height values to calculate
> scale factor on the *font size*, not the x-height.  So
> ascender/descender values will be scaled along with the size, just as
> 'font-size: 120%' would increase it.

While the lack of specification of scaling behavior is a separate issue, this is *not* what the Fig. 19 shows. The example presented in the spec clearly illustrates that line spacing (which is directly related to font size) is the same for all three fonts in both cases, with and without applied font-size-adjust property. I happen to think that the illustrated behavior is indeed the correct one (x-height and font size may need to be adjusted for rendering but it should not affect the line spacing, as the change in font-size would), but this also needs to be clearly specified.

> Please let me know if this resolves your question/issue.

Not yet :P

Thank you,

Received on Friday, 16 August 2013 14:51:51 UTC

This archive was generated by hypermail 2.4.0 : Monday, 23 January 2023 02:14:31 UTC