Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calligraphics: PrevCurNext MultiObject #44

Open
Dreaming381 opened this issue Jul 1, 2024 · 0 comments
Open

Calligraphics: PrevCurNext MultiObject #44

Dreaming381 opened this issue Jul 1, 2024 · 0 comments
Labels
challenging This task requires some technical competence open to contributors Want to contribute? This task is available.

Comments

@Dreaming381
Copy link
Owner

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

  • Combining Diacritical Marks
  • Sprites
  • Emojis

Background

In Calligraphics, there are two files named GlyphGeneration.cs and
RichTextParser.cs In the former, there is a type named PrevCurNext. This
contains three enumerators into the CalliString being processed. The idea is
that 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 can
accommodate these use cases.

Base Requirements

Implement a new PrevCurNext that provides an enumeration specifying the type
of 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 the
configuration 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 new PrevCurNext. Ignore
emojis, combining diacritical marks, and sprites for now. The goal is purely
feature-parity with the current solution, except better handling of cspace
line wrapping.

@Dreaming381 Dreaming381 added open to contributors Want to contribute? This task is available. challenging This task requires some technical competence labels Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
challenging This task requires some technical competence open to contributors Want to contribute? This task is available.
Projects
None yet
Development

No branches or pull requests

1 participant