Re: [css3-fonts] computed style for font-feature-settings?

On Fri, May 31, 2013 at 7:03 PM, John Daggett <jdaggett@mozilla.com> wrote:

>
> Glenn Adams wrote:
>
> > > The computed value is "as specified".  You get out the same values
> > > you put in.
> >
> > Ah, thanks, I'd missed the Computed value line. I guess it was too
> > much to hope that it would be possible to indirectly discover the
> > font's supported features through getComputedStyle.
>
> Both the 'font-variant' and 'font-feature-settings' are basically
> "hints" to the layout system, unlike other CSS properties they don't
> require something to be altered in the layout and display of text [*].
> They are simply inputs to the OpenType layout system.
>
> Whether glyph selection or positioning is altered by a given font
> feature is determined by a few factors. After all the default glyph
> for each character is selected from the character map of the font, for
> each glyph in a text run these things affect glyph selection and
> placement:
>
> 1. Is the feature defined for the given language/script?
> 2. Did other features already applied affect the glyph selection?
> 3. Do the lookups defined for a feature match the glyph?
> 4. If the lookups are conditional, do the adjacent glyphs match the
> conditions?
>
> So there isn't really a way to use the application of features as a
> way to determine just (1).  Like many things in life, the answer is "it's
> complicated". ;)
>

Since I implemented an "OpenType layout system" for OT GSUB/GPOS
processing, I do fully understand what occurs. See [1] and particularly
[2][3].

Actually, if one had defined computed style to return the font's supported
features, it would be straightforward to do so, and would not involve
determining any of the answers to (1) to (4) which you've sited. I didn't
suggest that it might have returned what features might apply for a
specific character in context.

[1]
https://github.com/apache/fop/tree/trunk/src/java/org/apache/fop/complexscripts
[2]
https://github.com/apache/fop/blob/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphSubstitutionTable.java
[3]
https://github.com/apache/fop/blob/trunk/src/java/org/apache/fop/complexscripts/fonts/GlyphPositioningTable.java



>
> Cheers,
>
> John Daggett
>
> [*] Except where explicit fallback is defined for the
> 'font-variant-position' and 'font-variant-caps' properties.
>
>

Received on Saturday, 1 June 2013 02:52:21 UTC