Choosing cvXY and ssXY

Is there any informal standard on how to choose which character variant (cv01 through cv99) or stylistic set (cv01 through cv20) a certain glyph or group of glyphs should go into?
Alternatively, has someone conducted a survey what actual typefaces put in these features?

With CSS Fonts 3, there is a higher-level language to add mnemonics for these enumerated features (and some more) when used with the font-variant-alternates property.

@font-feature-values FontFamilyName {
  @styleset {insular: 1; uncial: 2; unicase: 3;} /* ssXY */
  @character-variant {initial: 1; medial: 2; final: 3;} /* cvXY */
  @stylistic {cute: 1;} /* salt index */
  @swash {curly: 1; longish: 2; playful: 3;} /* swsh or cswh index */
  @ornaments {ugly: 1; floral: 2; techy: 3;} /* ornm index */
  @annotation {circled: 1; disced: 2; squared: 3; inverse: 4} /* nalt index */
  /* identifiers in front of colon are user defined and can be shared by fonts */
  /* numbers after the colon are font-dependent */
}
Bob H's picture

Alternatively, has someone conducted a survey what actual typefaces put in these features?

Not a survey, but a data point: SIL's Scheherazade implements a number cvXX features.

As for choosing a particular ssXX or cvXX to use, just remember that once users begin to use your fonts with character variant or stylistic set features, you can't change the your mind about which feature to use without breaking user's documents.

Crissov's picture

Scheherazade seems to use the possibility of OT 1.6 to assign descriptive names to its cv__ features. It’s also possible for ss__, and AAT always was more verbose. According to the Scheherazade documentation, XeTeX seems to support that (LuaTeX probably too). CSS does not, although it has been proposed already.
Does any font editor and GUI DTP software support named features?
Do many fonts contain names?

I believe font vendors should soon start to include CSS files with fonts that are intended to be used on the Web as part of the documentation. They may look something like this:

@font-feature-values Scheherazade {
  @character-variant {
    /* Dal U+062F, 0630, 0688, 0689, 068A, 068B, 068C, 068D, 068E, 068F, 0690, 06EE, 0759, 075A, 08AE */
    standard-dal: 12 0; alternate-dal: 12 1;
    /* Meem U+0645, 0765, 0766, 08A7 */
    standard-meem: 44 0; sindhi-meem: 44 1;
    /* Heh U+0647 */
    standard-heh: 48 0; sindhi-heh: 48 1; urdu-heh: 48 2; kurdish-heh: 48 3;
    /* Arabic U U+0677, 06C7 */
    standard-u: 50 0; filled-u: 50 1;
    /* Maddah U+0622, 0627+0653, 0653 */
    small-maddah: 60 0; large-maddah: 60 1;
    /* Shadda+Kasra Positioning U+064D, 0650+0651 */
    raised-shadda-kasra: 62 0; lowered-shadda-kasra: 62 1;
    /* Damma U+064F */
    standard-damma: 70 0; filled-damma: 70 1; short-damma: 70 2;
    /* Dammatan U+064C */
    standard-dammatan: 72 0; six-nine-dammatan: 72 1;
    /* Inverted Damma U+0657 */
    standard-inverted-damma: 74 0; hollow-inverted-damma: 74 1;
    /* Superscript Alef U+0670+…, 0649, 064A, 06D0, 06D1, 0777, 06CC, 0635, 0636, 069D, 069E, 06FB, 08AF, 0633, 0634, 069A, 069B, 069C, 06FA, 075C, 076D, 0770, 077D, 077E */
    small-superscript-alef: 76 0; large-superscript-alef: 76 1;
    /* Sukun U+0652 */
    closed-sukun: 78 0; open-down-sukun: 78 1; open-left-sukun: 78 2;
    /* End of Ayah U+06DD */
    standard-ayah-end: 80 0; circle-ayah-end: 80 1; rectangle-ayah-end: 80 2;
    /* Eastern Digits U+06F4, 06F6, 06F7 */
    standard-eastern-digits: 82 0; sindhi-eastern-digits: 82 1; urdu-eastern-digits: 82 2; rohingya-eastern-digits: 82 4;
    /* Comma U+060C, 061B */
    upward-comma: 84 0; downward-comma: 84 1;
    /* Jeh Hack U+0698 */
    standard-jeh: 90 0; dot-hat-jeh: 90 1;
    /* Dotless Head of Khah Hack U+06E1 */
    standard-khah-dotless-head: 92 0; jazm-khah-dotless-head: 92 1;
  }
}

Combining cv features into a virtual styleset only worked in an older draft I think.
This font activates them by language, but they should probably also be available as ss01–ss04.

 /* sindhi-style:   44 1   48 1   82 1;
    urdu-style:            48 2   82 2;
    kurdish-style:         48 3;
    rohingya-style:               82 4;
  */
  @styleset {
    sindhi:   1;
    urdu:     2;
    kurdish:  3;
    rohingya: 4;
  }
Bob H's picture

Scheherazade seems to use the possibility of OT 1.6 to assign descriptive names to its cv__ features.

Correct that Scheherazade uses the FeatureParams field of the cv__ features to provide descriptive names. This facility was part of the original cv__ feature definition.

It’s also possible for ss__,

as of OT 1.6, yes.

Does any font editor and GUI DTP software support named features?
Do many fonts contain names?

I think we've had a chicken-and-egg problem: Font developers are waiting for apps to support these UI strings, and app developers are waiting for fonts to contain them. That is one reason SIL has started including them.

I believe font vendors should soon start to include CSS files with fonts that are intended to be used on the Web as part of the documentation.

I had that same thought when I read your original post. Thanks for providing an example -- hopefully you won't mind if SIL uses it (or something derived from it) in future releases?

Crissov's picture

Please, use and adapt the code as suits your needs. I just hope browsers will soon implement the high-level parts of CSS Fonts 3 instead of just the low-level font-feature-settings.

JFTR, here are the proposals to add support for named features to character-variant() and styleset() as well as to @font-feature-values.

Syndicate content Syndicate content