Releases: verybadcat/CSharpMath
0.1.0 SkiaSharp Update Prerelease 4
- A few bugfixes
- Background code changes
- CSharpMath.Text merged into CSharpMath.Rendering (not ready though)
0.1.0 SkiaSharp Update Prerelease 3
Introduced HighlightColor, removed BackgroundColor. Fixed a few bugs here and there, changed the internals of MathPainter quite a bit. Released upon request.
0.1.0 SkiaSharp Update Prerelease 2
0.1.0 SkiaSharp Update Prerelease 1
The first prerelease for the 0.1.0 SkiaSharp Update, which brings a new SkiaSharp front end.
I don't have time to write a changelog right now, will include in prerelease 2.
Accompanying issue: #12
Initial port by @verybadcat
CSharpMath
This is a C# port of the wonderful iosMath LaTeX engine.
It is now working in most cases. Some examples are below. Ironically enough, the first front end is iOS. However, if you want to add a front end, such as Xamarin.Forms or a Windows environment, it should be possible. You would have to define your own TypesettingContext and write an implementation of IGraphicsContext. The TypesettingContext in turn has several components, including choosing a font. Hopefully, you would not need to touch the core typesetting engine. (If you do, I would consider that a bug.)
Usage
To get started, do something like this:
var latexView = IosMathLabels.LatexView(@"x = -b \pm \frac{\sqrt{b^2-4ac}}{2a}", 15);
latexView.ContentInsets = new UIEdgeInsets(10, 10, 10, 10);
var size = latexView.SizeThatFits(new CoreGraphics.CGSize(370, 180));
latexView.Frame = new CoreGraphics.CGRect(0, 20, size.Width, size.Height);
someSuperview.Add(latexView);
Project needs
We need more front ends! As a sub-question, it would be interesting to know where iosMath got the data they use to create their mathTables. See issues.
License
The code is licensed by the MIT license. The latin-modern-math font is licensed by the GUST Font License.