CSharpMath: Incorrect spacing and bounding box
Describe the bug There are incorrect spacing and bounding boxes as indicated by green ellipses. The top is created by LaTeX and the bottom is created by CSharpMath.
To Reproduce Make sure you have TeX distribution installed. Download the VS solution from my rep: https://github.com/sadqiang/GitHubReport/tree/master/GitHubReport.
Questions
- 1. What causes the size of LaTeX output to be smaller than that of Skia’s ? I already set 12pt for both actually.
- 2. Why can’t we use the following?
\Biggl(\biggl(\Bigl(\bigl((x)\bigr)\Bigr)\biggr)\Biggr)
y=\cfrac{x}{1+\cfrac{x}{1+\cfrac{x}{1}}}
\mathscr{L}\left\{f(t)\right\} = F(s)
- 3. Can we change the math font from the default to, for example, Palatino, Bera, etc?
About this issue
- Original URL
- State: open
- Created 5 years ago
- Reactions: 1
- Comments: 30 (1 by maintainers)








@pstricks-fans I’d say that at least getting the spacing specified in the original post counts as fixing this case.
Some of these are deficiencies from iosMath that this library was ported from. I’ll keep this in mind in the upcoming rewrite.
Math Layout in “In-span” italic correction
from https://github.com/verybadcat/CSharpMath/issues/32 and should be solved by (https://github.com/verybadcat/CSharpMath/issues/32#issuecomment-645134531 and https://github.com/verybadcat/CSharpMath/issues/32#issuecomment-645291053)
Users can layout math manually entire process by their own MathLayout engine.
But the GlyphLayout class also have a help for layouting “in-span” italic glyph.
BUT
see detail impl => https://github.com/LayoutFarm/Typography/commit/ccad43bb2130137b71958d8b0aa8b046e3a82a15#diff-b705c14388c05643560a455e65eaf449R468
[A] (𝐹𝐹𝐹), [B] (FFF), [C] (𝐹F𝐹)
I’ve overlooked that info!
The Math Font file (eg Latin Modern Math, Asana Math)
contain that info.
It may be used in this situation.
see detail more detail =>
https://docs.microsoft.com/en-us/typography/opentype/spec/math#mathitalicscorrectioninfo-table
@prepare What about storing an
italicmeasure (glyph.MathGlyphInfo?.ItalicCorrection) when positioning each glyph? So if the current character has less italic correction than the previous character, the difference becomes additional spacing?See the bottom part of #29, basically CSharpMath is in a process of being rewritten.