CSS font-feature-settings and .fina/.end

I'm developing a script font that uses opentype standard ligatures to swap out connected drawings of glyphs with unconnected versions of those glyphs.

This is the root idea:
sub @end-on' @no-connect-left by @end-off;


My @no-connect-left class includes numbers, but mostly relies on its inclusion of /space to determine when a word has ended. The problem is, when I browser test, CSS font-feature-settings doesn't seem to treat /space as a glyph. The feature will work if I end the word with a number, but not with the space character. Has anyone noticed this and figured out a workaround, or is this just the problem with awful opentype browser support?

Comments

  • Ray Larabie
    Ray Larabie Posts: 1,432
    I has a similar problem where adding the non breaking space (uni00A0) to the class was the solution. Maybe give that a shot.
  • Kent Lew
    Kent Lew Posts: 937
    You have to approach it from the other way around: You do an ignore sub for whenever a following character does not signal a word termination, and then you put in a simple overall sub for the ending form.

    Put another way: rather than tell the engine when to turn the connection off, you tell it when *not* to turn it off.

    Something like this:
    lookup contextual_fina {
    ignore sub @connecting' @connecting_context;
    sub @connecting' by @terminating;
    } contextual_fina;

    Where @connecting_context is all chars that don’t constitute word termination, i.e. all glyphs that the connecting form can connect to (so, basically the opposite of your @no-connect-left).

    That way the text processing engine doesn’t have to consider whether a space is following (nor what kind of space, because you never really know, especially at a line ending), or soft-hyphen break, or some kind of control char; it only has to know that it isn’t one of the designated connecting letters.

    Does that make sense and help?


  • @Kent Lew Brilliant! As soon as I started reading your reply I vaguely remembered that James Edmondson had suggested that to me in working with scripts a few years ago. Not intuitive at first, but totally genius. Thanks.