Character-Map-UWP icon indicating copy to clipboard operation
Character-Map-UWP copied to clipboard

Fully-configurable OpenType features

Open be5invis opened this issue 5 years ago • 7 comments

The current variant selector only allows selecting one variant: image

However many fonts allows:

  • Applying multiple features at once;
  • Have features that this list currently not covered (like cv01);
  • Leverages GSUB's alternative substitutions, so the user needs to pass an integer parameter to the feature (like aalt=1).

The enhancement might be changing this dropdown menu into a textbox and let user to input the feature tags they need, like kern, calt, cv03, cv05, aalt=2.

be5invis avatar May 01 '20 00:05 be5invis

Internally the app actually does list all the not-covered variations, but main problem is the UI layer (UWP XAML) doesn't support them - it only supports a limited set of pre-defined features that do not allow configuration, and don't behave properly when applied together.

Like a lot of these tied to the UI layer, the solution is to either wait for Microsoft to release WinUI 3 (the open source variant of XAML, so that we can actually fix this properly at the UI layer), or re-write the character map grid entirely in DirectX (which is not impossible but leads to lot of extra work around input and keyboards and GPU handling and accessibility).

At the moment I'm not likely to attempt the latter (though anyone can feel free), and WinUI3 is at least 6 months away.

JohnnyWestlake avatar May 01 '20 08:05 JohnnyWestlake

I do not think that regular text controls will support advanced typography that configurable — we should definitely move to custom rendering using IDWriteTextLayout.

be5invis avatar May 01 '20 09:05 be5invis

@JohnnyWestlake I think a good solution is to rewrite only the rendering part of the glyph shape and leave the rest of the control as-is. image

be5invis avatar May 01 '20 09:05 be5invis

(Support for non-XAML supported OpenType tags for Type Ramp view only is currently in the Character-Map-UWP/Variations-Basic dev branch - this does not include anything with an integer parameter other than 1 for now)

JohnnyWestlake avatar May 11 '20 16:05 JohnnyWestlake

@JohnnyWestlake Non-1 parameters are not frequently used (though some features like salt may use that). You may also need to turn off certain default features, like kern or calt.

be5invis avatar May 11 '20 16:05 be5invis

@JohnnyWestlake And also, OpenType supports enabling multiple features simultaneously, like both cv01 and cv02.

be5invis avatar May 11 '20 17:05 be5invis

Also, certain features used for shaping should be hidden. Enabling/Disabling these features are controlled by the shaping engine, not the user. They should always be “Off”. The list includes:

  • loclccmp, nukt, akhnrvrn
  • rphf, pref
  • rkrfabvf, blwfhalfpstf, vatucjct
  • isolinitmedi, fina, stch
  • abvsblws, halnprespstsrclt, rlig
  • curs, dist, mark, abvmblwm, mkmk, mset

The following features are considered typographic, so they should appear in the feature dropdown, but enabled by default:

  • calt, ligacligkern

be5invis avatar May 11 '20 18:05 be5invis