Skip to content

Font and Feature UI

Fonts can support a wide variety of OpenType features. Some font features are internal and not for user control and some are for user control. font.py has a list of user controllable features. The rest should not be displayed in an application.

Developing a User Interface to access the user-selectable features has long been neglected.

User-selectable font features should be exposed to the user in the application UI. Some applications just include all the features in one big dialog box, as LibreOffice does below. Other applications are a bit more organized and separate them into different tabs or sections in a dialog.

Figure: LibreOffice
Most features in one dialog

As mentioned above, applications have implemented a User Interface for selecting the user-selectable features in a variety of ways. Because each application implements the selection in different places, it is sometimes difficult to find where to set the user-selectable features.

  • In macOS, many of the user-selectable features are available through a Typography menu.
  • In Word, some of the user-selectable features are available through the Font menu, and other are available through the Font / Advanced menu.
  • In LibreOffice, they are available through the Character / Font menu or Character / Font Effects menu.
  • InDesign has an OpenType menu from which various features can be selected.
  • PTXprint has provided for selecting them in the Font menu.

This document gives some ideas for developing a fairly compact way to display the user-selectable features, and still allow the user to select the various options.

The “twisty” divisions are somewhat arbitrary. Using the twisties would allow for a fairly compact menu. If a font doesn’t support a particular topic and/or feature it should not be displayed. (The table below shows what should be under each twisty.)

In the example below, there is no need to include the four-letter feature tag in the UI. It is simply included for the developer to know which OpenType feature is related to the friendly name.

When one of the twisties is selected you might see either a checkbox (for on and off) in the case of Stylistic Sets, or multiple options for selection in the case of Character Variants.

Languages are sometimes selected at the bottom of an application window. The following example has language selection in the dialog box, but it could be selected elsewhere. If the font supports language features, then the language choice will also affect the features that are selected.

Language
  • Assyrian (select language tag?)
  • Spanish
  • Syriac
  • etc
Effects
  • ☐ Subscript [subs]
  • ☐ Superscript [sups]
  • ☑ Optical size [size]
  • ☐ Randomize [rand]
  • ☐ Ornaments [ornm]
  • ☐ Left Bounds [lfbd]
  • ☐ Right Bounds [rtbd]
Kerning
  • ☑ Horizontal Kerning [kern]
  • ☐ Kerning for Alternate Proportional Widths [apkn]
Ligatures
  • ☑ Standard Ligatures [liga]
  • ☑ Contextual Ligatures [clig]
  • ☐ Discretionary Ligatures [dlig]
  • ☐ Historical Ligatures [hlig]
Alternates
  • ☐ Access All Alternates [aalt]
  • ☐ Contextual Alternates [calt]
  • ☐ Stylistic Alternates [salt]
  • ☐ Historical Forms [hist]
  • ☐ Justification Alternates [jalt]
  • ☐ Slashed Zero [zero]
  • ☐ Contextual Swash [cswh]
  • ☐ Swash [swsh]
  • ☑ Vertical Alternates and Rotation[vr2t]
  • ☐ Final Glyph on Line Alternates [falt]
Figures/Fractions
  • ☐ Proportional Figures [pnum]
  • ☐ Tabular Figures [tnum]
  • ☐ Lining Figures [lnum]
  • ☐ Oldstyle Figures [onum]
  • ☐ Alternative Fractions [afrc]
  • ☐ Fractions [frac] (Numerators [numr] should usually be turned on together with frac)
  • ☐ Ordinals [ordn]
Casing
  • ☐ Small Capitals [smcp]
  • ☐ Small Capitals from Capitals [s2sc]
  • ☐ Case-Sensitive Forms [case]
  • ☐ Petite Capitals From Capitals [c2pc]
  • ☐ Petite Capitals [pcap]
  • ☑ Capital Spacing [cpsp]
  • ☐ Titling [titl]
  • ☐ Unicase [unic]
Notations
  • ☐ Mathematical Greek [mgrk]
  • ☐ Ruby Notation Forms [ruby]
  • ☐ Scientific Inferiors [sinf]
Stylistic Sets (up to 20)
  • ☐ Single-story a and g
  • ☐ Barred-bowl forms ᵬ đ ǥ
Character Variants (up to 99)
Capital H stroke
  • None
  • Vertical stroke
Capital Eng
  • None
  • Lowercase no descender
  • Capital form

The full specification for Character Variants allows for tooltips (for example, hover over the Character Variant “Capital H stroke” and see the tooltip). The specification also includes the ability to list the default glyph and each alternate. Although the sample text is extremely small, PTXprint supports this.

Figure: PTXprint
PTXprint tooltip with sample alternates
  • font.py in the ptxprint repo has a list of “OTFeatNames” which are valid features to display in the feature UI. And “OTInternalFeats” are the ones that should not be displayed in a UI. “OTLangs” has a list of OpenType language tags which can be used for selecting a language.