W3C home > Mailing lists > Public > www-style@w3.org > June 2008

Advanced font features and related text features in CSS levels 3 and 4 [css3-fonts] [CSS3 Text] [css3-text-layout] [css4-fonts] [css4-text] [css4-text-layout]

From: Etan Wexler <ewexler@stickdog.com>
Date: Mon, 09 Jun 2008 15:30:39 -0400
To: www-style@w3.org
Message-id: <484D84DF.9060609@stickdog.com>

I (Etan Wexler) wrote
(in <http://lists.w3.org/Archives/Public/www-style/2008Jan/0438.html>):

> For several years I’ve had some notes on what I’d like in a CSS4 fonts 
> module. I’ll post them within the week.

[Note to self: insert humorous, self‐deprecating comment about being 132
days late.]

In the spirit that something is better than nothing and that sooner is
better than later, I’m abandoning my private attempt to do a thorough
cleaning and reformatting of my notes. The following notes are slightly
altered from my originals. I’ve had more ideas and refinements since
writing the notes, but those ideas and refinements will have to wait
(for an unspecified duration [I got a bit more savvy]) to see publication.

The following note, written from 2004-12-13 to 2004-12-28, gives ideas
for using “intelligent” font features (as found in OpenType, AAT [Apple
Advanced Typography], and Graphite fonts).

There is the possibility of exposing the fonts’ particulars to the CSS
author. For example, we could have:

	font-feature-opentype: lnum pnum /*and so on*/; /*a shorthand*/
	font-feature-opentype-lnum: enabled;
	font-feature-opentype-pnum: enabled;
	/*and so on*/

The troubles with this exposure include consistency of results across
font formats, mismatch between imperative font features and declarative
CSS, and even the mere naming of CSS properties.

To take the latter trouble: the AAT font feature registry
(<http://developer.apple.com/fonts/Registry/index.html>) does not list
normative names or tags for features or feature‐selectors. The only
normative characteristic of these resources is an integer. The following
example and its cousins are not acceptable in the CSS community.

	font-feature-aat-6: 1; /*numeral spacing: proportional*/

The case sensitivity of OpenType feature tags is another problem for CSS.

Consistency becomes an issue with the exposure of the low-level font
details. It is inconsistent and wrong to offer the author the
possibility of, say, choosing lining numerals for OpenType but old-style
numerals for AAT. A given font could support both OpenType and AAT. What
resolution would CSS specify for this font in such a conflict?

Another conflict is the enabling of exclusive OpenType features
(<http://partners.adobe.com/public/developer/opentype/index_tag3.html>).
In an imperative model of, say, a designer choosing features in
chronological sequence, the choice of a given feature prompts the text
engine to drop incompatible features and choose required features. And
while CSS declarations appear in sequence, the resulting CSS properties
are an unordered set. What resolution would CSS specify for the
following conflict?

	font-feature-opentype-lnum: enabled;
	font-feature-opentype-onum: enabled;

So CSS should specify a set of features that is compatible with existing
CSS syntax and semantics, is mnemonic, and provides uniform access to
features which the font formats specify differently.

Hence:

Name: font-numeral-case (font-numeral-style?)
Value: auto | old-style | lining
Initial: auto
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Name: font-numeral-spacing (font-numeral-width?)
Value: auto | proportional | tabular
Initial: auto
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Name: font-variant
New values: auto | all-small-caps | caps-to-small-caps
  | petite-caps | all-petite-caps | caps-to-petite-caps
  | titling-caps | all-titling-caps
  | tall-caps | all-tall-caps
Initial: auto
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Name: font-punctuation-case
Value: auto | in-mixed-company | caps | small-caps
Initial: auto
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Name: font-zero-style
Value: auto | no-slash | slash
Initial: auto
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Name: font-diacritics
Value: normal | hidden | decomposed
Initial: normal
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Name: font-randomness
Value: none | random
Initial: none
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Name: font-ligatures
Value: none | required | normal | discretionary
Initial: normal
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Redefinitions...

Name: font-numeral-case (font-numeral-style?)
Value: auto | ranging | lining | small-lining
  | superscript | subscript | numerator | denominator
Initial: auto
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Values:

auto
   The user agent makes no particular selection of the case of numeral
glyphs. The user agent uses the font’s default case of numeral glyphs.
In many fonts these default glyphs are lining. In numerous other fonts
the default numeral glyphs are ranging. However, this CSS specification
does not restrict the default design of numeral glyphs; the default
glyphs may be small lining, superscript, subscript, numerator,
denominator, or in a style not matched by any selective keyword for
'font-numeral-case'.

ranging
   The user agent requests ranging numeral glyphs. These glyphs center
in the space between the alphabetic baseline and x‐height but have
ascenders and descenders: [[illustration]]

lining
   The user agent requests full-height lining numeral glyphs. These
glyphs rise from the alphabetic baseline to the cap‐height or to a line
near the cap‐height. The glyphs do not have ascenders or descenders:
[[illustration]]

small-lining
   The user agent requests reduced-height lining numeral glyphs. These
glyphs rise from the alphabetic baseline to the x‐height or to a line
near the x‐height. The glyphs do not have ascenders or descenders:
[[illustration]] [[Example: Linotype Syntax Regular SC
<http://www.linotype.com/55030/linotypesyntaxregularsc-font.html>]]

superscript
   The user agent requests superscript numeral glyphs. These small
glyphs typically align with the cap‐height. In some fonts the glyphs
feature ascenders and descenders while in other fonts the glyphs do not
feature ascenders or descenders: [[illustrations]]

subscript
   The user agent requests subscript numeral glyphs. These small glyphs
typically align with the alphabetic baseline. In some fonts the glyphs
feature ascenders and descenders while in other fonts the glyphs do not
feature ascenders or descenders: [[illustrations]]

numerator
   The user agent requests numerator numeral glyphs. These small glyphs
align for use in the numerators of fractions. In some fonts the glyphs
feature ascenders and descenders while in other fonts the glyphs do not
feature ascenders or descenders: [[illustrations]]

denominator
   The user agent requests denominator numeral glyphs. These small
glyphs align for use in the denominators of fractions. In some fonts the
glyphs feature ascenders and descenders while in other fonts the glyphs
do not feature ascenders or descenders: [[illustrations]]


Name: font-numeral-spacing
  (font-numeral-width? font-numeral-proportions?)
Value: auto | proportional | tabular
Initial: auto
Applies to: all elements
Inherited: yes
Percentages: N/A
Media: visual
Computed value: as specified

Values:

auto
   The user agent makes no particular selection of metrics of numeral
glyphs. The user agent uses the font’s default metrics of numeral glyphs.

proportional
   The user agent requests proportional numeral glyphs. These glyphs do
not align in columns, but yield a consistent typographical color:
[[illustration]]

tabular
   The user agent requests tabular numeral glyphs. These glyphs align in
columns of a fixed width, but may yield a poor typographical color:
[[illustration]]

The following note, written sometime between 2004-12-15 and 2005-07-11,
gives ideas for using “intelligent” font features (as found in OpenType,
AAT [Apple Advanced Typography], and Graphite fonts).

Name: text-bounds-adjust
Value: optical | none
Initial: optical
Inherited: yes
Percentages: N/A
Media: visual
Applies to: block-level elements
Computed value: as specified

Name: font-ligatures-common
Value: enable | none
Initial: enable
Inherited: yes
Percentages: N/A
Media: visual
Applies to: all elements
Computed value: as specified

Name: font-ligatures-historical
Value: none | enable
Initial: none
Inherited: yes
Percentages: N/A
Media: visual
Applies to: all elements
Computed value: as specified

Name: font-ligatures-contextual
Value: none | enable
Initial: none
Inherited: yes
Percentages: N/A
Media: visual
Applies to: all elements
Computed value: as specified

The following note, written as a reconstruction from memory of a note
written sometime in 2003 or 2004, gives an idea for using an
“intelligent” font feature (as found in AAT [Apple Advanced Typography]
and some other font technologies).

Name: font-optical-size
Value: <length>
Initial: 1em
Inherited: no
Percentages: N/A
Media: visual
Applies to: all elements
Computed value: as usual for <length>

-- 
That is all that I have for now.
Received on Monday, 9 June 2008 19:24:17 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:55:07 GMT