-
Notifications
You must be signed in to change notification settings - Fork 71
Description
Is your feature request related to a problem? Please describe.
Currently, the APIs for CSharpMath are not intuitive at all.
For example, to convert MathList->TeX, one has to call MathListBuilder.MathListToString which is a static method (not easy to discover), and its name doesn't imply anything about the result being a TeX string at all.
Describe the solution you'd like
- Streamline the use of CSharpMath APIs.
SkiaSharp.SKCanvas canvas = …;
"\\frac{1}{2}"
.TeXToMathAtoms()
.ToDisplay()
.ToOutput(canvas);-
Replace mutable global variables with settings objects.
e.g.CSharpMath.Atoms.MathAtomscontain multiple dictionaries that act as hidden dependencies. They should be made obvious. -
Reduce legacy boilerplate code from iosMath.
e.g. Why do some math atoms have their respective interfaces? It's not like MathAtoms will have alternate implementations, they are just data containers. If they are to be extended, they can be inherited.
e.g. Reduce boilerplate folders. They scare new contributors. Most folders inCSharpMath/contain few files anyway.
e.g. Remove CSharpMath.Enumerations.MathAtomType. Use pattern matching on types instead. -
Simplify the NuGet chain. It's not obvious what
CSharpMath.Renderingdoes based on its name.CSharpMath,CSharpMath.EditorandCSharpMath.Renderingshould be merged into one. Typography should be integrated directly into CSharpMath because
| .NET font reader library name | Can read math layout info for glyphs? |
|---|---|
| NRasterizer | ❌ |
| SixLabors.Fonts | ❌ |
| SharpFont | ❌ |
| Typography | ✔️ |
Source: https://github.com/Jolg42/awesome-typography#c-2
It's not like there is or will be any other implementations for font reading of math fonts.
Describe alternatives you've considered
Continuing the current API and result in a degraded user experience.
Difficulty: How difficult would it be? (Trivial, Very Easy, Easy, Moderate, Hard, Very Hard, Tedious, Backbreaking)
Very hard. A lot of time will be needed to achieve this.
Additional context
#57