OpenType Layout Features - Feature Params

<< Click to Display Table of Contents >>

Navigation:  Editing Fonts > Format > OpenType Layout Features > Script Editor > Script Syntax >

OpenType Layout Features - Feature Params

The params keyword is used in two ways: To reference feature parameters and to declare them. A feature params is referenced from a feature block to indicate the specified feature params is available in that feature.

Referencing a feature params:

feature CharacterVariants01_1 cv01 {

 params FeatureParams_cv01;

}

 

feature OpticalSize1 size {

 params FeatureParams_size;

}

 

feature StylisticSet1_1 ss01 {

 params FeatureParams_ss01;

}

 

 

Declaring feature params:

There are currently three defined feature params:

Optical Size features (size) use the sizeparams:

params FeatureParams_size sizeparams {

 designsize 100;        // the design size in decipoints

 subfamily 3;           // serves as an identifier that associates fonts in a subfamily

 range 80 120;          // represents the recommended usage range (start = exclusive) and (end = inclusive), stored in decipoints

 name 1033 "Content";   // The name for the subfamily

}

 

Stylistic Sets features (ss01-ss20) use the ssetparams:

params FeatureParams_ss01 ssetparams {

 name 1033 "Content for Stylisitc Set 1";  // specifies text for a user-interface label

}

 

Character Variants features (cv01-cv99) use the cvarparams:

params FeatureParams_cv01 cvarparams {

 label {

   name 1033 "Capital-eng variants";    // specifies text for a user-interface label

 }

 tooltip {

   name 1033 "Select glyph variants for capital eng.";    // specifies a tooltip text

 }

 sampletext {

   name 1033 "Content for Sample Text"; // text that illustrates the effect of the feature

 }

 variant {

   name 1033 "Content for Variant 1";   // specifies text for variant 1

   name 1033 "Content for Variant 2";   // specifies text for variant 2

   name 1033 "Content for Variant 3";   // specifies text for variant 3

 }

 characters [70 80]; // characters code-points for which glyph variants are provided

}

 

name

The name keyword requires a language id and text.

Language ID: A full list of supported Windows Language IDs can be found at https://www.microsoft.com/typography/otspec/name.htm. Like many values, the language id can be provided in decimal or hexadecimal notation. For example to use language English - United States, you can provide either $409 or 1033.

Text: The text needs to be enclosed by double quote characters, unless text is made out the following characters: a-z, A-Z, 0-9. If you want to include a double quote inside the text, you'll need to add two of them.

 

Note: The language ID used with the name keyword is not related to the language keyword.