Re: font features in CSS

Very cool, Håkon!

On 26 Oct 2009, at 08:46, Håkon Wium Lie wrote:

>  - Are features binary or do they need integer values? It seems that
>    Prince has implemented features as binary switches, e.g.:
>
>      font-variant: prince-opentype(salt2);
>
>    while Mozilla uses integer values:
>
>      -moz-font-feature-opentype: "salt=2";
>
>    Personally, I hope to avoid numbers altogeter; they seem even more
>    arbitrary than the alt/salt/ss names we're currently seeing.

Most features are typically implemented as simple booleans (for which  
we're using 0 and 1 to mean "off" and "on"), but I don't think you can  
avoid specifying numbers for "one-of-many" substitution features.

>  - Here's a reformulated version of Mozilla's demo document that
>    contains both the Prince and Mozilla syntax, along with Prince's
>    rendering:
>
>      http://www.princexml.com/howcome/2009/megalopolis/sample.html
>      http://www.princexml.com/howcome/2009/megalopolis/sample.pdf
>      http://people.mozilla.com/~jkew/feature-samples/MEgalopolis.png
>
>    The page has been carefully designed so that all lines should have
>    the same length. However, in Prince's renering, lines stick out.
>    This is, I believe, due to Prince applying the named feature
>    (ss05) in the case of the "Beua.." line) to all characters in the
>    element, while Mozilla only applys it to the last character of a
>    word. Mozilla's solution is convenient; it avoids having <span>
>    elements around the last charater in order to give it a special
>    feature. However, how do one decide that a certain feature should
>    only be applied to the last characters? Does the feature itself
>    indicate this in any way?

I think you'll find that the 'ss05' feature uses a chaining contextual  
lookup to achieve this; perhaps whatever OpenType layout code Prince  
is using doesn't handle that?

JK

Received on Monday, 26 October 2009 23:03:09 UTC