-
Notifications
You must be signed in to change notification settings - Fork 65
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
Incorrect spacing and bounding box #32
Comments
Some of these are deficiencies from iosMath that this library was ported from. I'll keep this in mind in the upcoming rewrite. |
@Happypig375 : Is there a roadmap (a schedule of updates, versioning, etc) for CSharpMath ? |
See the bottom part of #29, basically CSharpMath is in a process of being rewritten. |
@prepare would ignoring the glyph advance be more suitable? |
I think in this case for math expression + math-font, But if you want to layout 'human text' with general font.
(𝑃𝑃𝑃) @brezza92 (Typography-based MathML implementation) Did you use glyph's advance or exact glyph bounds? |
I have an idea that, other else (eg math signs + - * / etc) should use exact bounds. so (𝑃𝑃𝑃) should be split to 3 parts as image below (edited by hand). |
What about when italic characters are mixed with upright characters? |
please give me some example and your expected result |
Sure, That side effect will happen in the same GSUB/GPOS layout block Then, It should be considered that => the block of consecutive letter need gsub/gpos layout process or not. In latin script=> may not, but in other script => may be, some script need GSUB/GPOS to get correct final output. |
So what should be considered as "a block of consecutive letters"? Same Unicode block? Same Unicode category? |
not sure if https://docs.microsoft.com/en-us/dotnet/api/system.char.isletter?view=netcore-3.1 is OK? If all letters are latin or math char=> it is OK to use only exact bounds, no need for GSUB,GPOS. In math layout, When to use GSUB/GPOS?, I think when we found a char from other script. (some unicode ranges that related to script) Not sure that If it possible to put a char from other script (eg arabic, chinese, emoji), If it possible, and no glyph inside a math-font, How to present it ? and it means that block of text may need GSUB/GPOS. |
David Carlisle told me that we cannot win. See section 7.5.5-7.5.6. |
@pstricks-fans What is "we cannot win"? |
System.Char.IsLetter("𝑃P", 0) // true => 𝑃 is a letter
System.Char.IsLetter("𝑃P", 2) // true => P is a letter |
@Happypig375 : I am not sure the meaning. It might mean it is impossible to get it right. Here is his statement. |
@pstricks-fans I'd say that at least getting the spacing specified in the original post counts as fixing this case. |
Yes ? Sure, That side effect will happen in the same GSUB/GPOS layout block This is limitation of 𝑃P , if you put it in the same GSUB/GPOS block, in the real world => It should be rarely used? |
After reading ...
EDIT:
SORRY about what I've said, =>it come from my little knowledge :( see => #32 (comment) |
Latin Modern Math's last update is 6 years old and is pretty much unmaintained. However, I love its glyphs and would like to retain it as the default font. |
Useful information about Math symbols advance width https://docs.microsoft.com/en-us/typography/develop/character-design-standards/math |
@prepare What about storing an |
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 |
@brezza92, please check this info (#32 (comment)) too. |
Math Layout in "In-span" italic correctionfrom #32
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 =>
[A] (𝐹𝐹𝐹), [B] (FFF), [C] (𝐹F𝐹) |
Please test it :) |
Will do, thanks |
Blocked on #107 (comment) |
@Happypig375 We're having this issue too for Matrices, seems like it's the same issue? |
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
The text was updated successfully, but these errors were encountered: