Wakamai-Fondue / wakamai-fondue-engine

The engine that powers Wakamai Fondue
Apache License 2.0
51 stars 12 forks source link

Lookup type 6 #41

Closed RoelN closed 3 years ago

RoelN commented 3 years ago

This PR adds lookup type 6. This is a way for fonts to look before and after the character as it were. For instance, the frac layout feature is usually a type 6 lookup that basically works like this:

If there's a slash, see if there's a number before it, see if there's a number after it. If so, exchange these characters by these glyphs.

In the case of a fraction like 1/2, the 1 would be changed into superscript 1, the slash optionally for a different designed slash, and the 2 for a subscript 2, making a ½

In this example, the slash is the input, the 1 is the backtrack, and the 2 is the lookahead.

This PR exposes the input, backtrack and lookhead so an interface can figure out how to display it.

RoelN commented 3 years ago

Thanks for the extensive reviews, @pascalw. Like discussed offline, I'll merge this now so we can go ahead with the beta, and either improve things in a new PR, or create issues to keep track of them!