Calligraphics: PrevCurNext MultiObject #44
Labels
challenging
This task requires some technical competence
open to contributors
Want to contribute? This task is available.
Calligraphics: PrevCurNext MultiObject
Calligraphics has a powerful character parsing engine. But currently, it assumes
that every pieces of renderable text has a single Unicode attached to it. This
task is to break away from this assumption.
Task is Prerequisite For
Background
In Calligraphics, there are two files named GlyphGeneration.cs and
RichTextParser.cs In the former, there is a type named
PrevCurNext
. Thiscontains three enumerators into the
CalliString
being processed. The idea isthat we keep on hand the data regarding the glyph before and after the glyph we
are currently processing so that we can perform kerning correctly.
The rich text parser always runs a glyph ahead. When it successfully parses a
tag, it fast-forwards the “next” enumerator and exports a new configuration
which will be applied after the rest of the current glyph is processed.
The main flaw with this design is that sometimes a rich text tag can itself be a
glyph, or should be treated as a non-visual character for word-wrapping
purposes. There are also situations where multiple Unicode characters should be
combined into one object. We want a new
PrevCurNext
pipeline that canaccommodate these use cases.
Base Requirements
Implement a new
PrevCurNext
that provides an enumeration specifying the typeof object contained, ranges within the
CalliString
in the forms of bytes,Unicode runes (including tags), and visual characters. An object can be a single
Unicode rune, a span of runes for emojis or combining diacritical marks, a
cspace
or similar tag object, or a sprite index. Tags which only affect theconfiguration are excluded.
Write a new lookahead parser to replace the existing rich text parser which can
populate the new
PrevCurNext
.Rework the remainder of
GlyphGeneration
to use the newPrevCurNext
. Ignoreemojis, combining diacritical marks, and sprites for now. The goal is purely
feature-parity with the current solution, except better handling of
cspace
line wrapping.
The text was updated successfully, but these errors were encountered: