-
Notifications
You must be signed in to change notification settings - Fork 71
Cleanup in preparation for Font Styles #156
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
Conversation
Actually, LaTeX predates Unicode so it looks up font files of different styles. WpfMath does this: they have different fonts for the same codepoint that contain different styles. However, iosMath uses Latin Modern Math by default which combines all these fonts together into the mathematical glyph ranges, so we can use Unicode from top to bottom. |
Interesting. WpfMath then ends up with a more convenient approach with fewer special cases but I think this PR can go ahead without changing that. We'll just need to preserve some degree of "font changing" for TextAtoms. |
|
Can you understand the test failures, or do you remember why there was a DoNothingFontChanger in the tests (before the changes in the cleanup so far) @Happypig375 ? It would be nice to remove test failures before pushing the real work. I can't see any stated meaning of the tests so cannot evaluate. Presumably the tests were not testing actual behavior (since they required DoNothingFontChanger to pass) and so removing DoNothingFontChanger is a matter of hygiene so that the tests test real behaviour. |
It's just a mock for UnicodeFontChanger in TypesettingContext. It's a leftover from @verybadcat.
Yes, there are some tests that test the mocks themselves. |
|
The test failures are related to using UnicodeFontChanger instead of DoNothingFontChanger. Since the text now have characters outside of the BMP, the difference in UTF16 length leads to different IndexRanges. Might have to check iosMath on its behaviour. |
|
This anomaly can be traced all the way back here: CSharpMath/CSharpMath/Display/LinesAndRuns/TextLineDisplays.cs Lines 22 to 29 in 50f10f5
As far as I understand, ranges represent locations of atoms before finalization. However, here, it is not used in this way. Hmmm... Is this unintentional? |
|
Definitely not correct. CSharpMath.Editor uses Ranges as input to constructing MathListIndexes. Ranges must represent locations of atoms and using text length instead is a logic error. |
|
If the tests are not right it's best to delete them rather than try to correct them. Tests on intermediate output (in between latex and atom), even if they were documented and functioning, aren't necessary.
Sent from Nine<http://www.9folders.com/>
…________________________________
From: Hadrian Tang <notifications@github.com>
Sent: Saturday, 29 August 2020 18:23
To: verybadcat/CSharpMath
Cc: Charles Roddie; Author
Subject: Re: [verybadcat/CSharpMath] [WIP] Font styles (#156)
This anomaly can be traced all the way back here:
https://github.com/verybadcat/CSharpMath/blob/50f10f5263687fe98df6249381a73d087ac979bf/CSharpMath/Display/LinesAndRuns/TextLineDisplays.cs#L22-L29
As far as I understand, ranges represent locations of atoms before finalization. However, here, it is not used in this way. Hmmm... Is this unintentional?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#156 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AEWYMUDA4PFXKK7PKJOPJYDSDE2SFANCNFSM4PUYFBGA>.
|
|
You mean UnicodeFontChangerTests? |
|
UnicodeFontChanger/Range tests. |
|
Range tests are important since they are part of the atom output. Not part of the intermediate steps in creating atoms. |
|
Alright, all tests now pass. |
|
@charlesroddie I've changed UnicodeFontChangerTests so that they also test LaTeX->Display conversion instead of only testing UnicodeFontChanger. |
|
@charlesroddie 2 outstanding reviews should be resolved for this to be mergable |
|
@Happypig375 Are the two things to be resolved the questions I asked about the tests? |
|
Can this be merged? |
|
There are 2 unresolved conversations |
|
You understand the remaining conversation so can you mark if you consider it resolved? |
Codecov Report
@@ Coverage Diff @@
## master #156 +/- ##
===========================================
- Coverage 86.81% 61.82% -24.99%
===========================================
Files 157 254 +97
Lines 11275 20793 +9518
===========================================
+ Hits 9788 12856 +3068
- Misses 1487 7937 +6450
Continue to review full report at Codecov.
|
|
Charlie and whomever pay attention to the master here and I am here to tell you both that the house is due to be cleaned of the filth and chaos that you have done. You have many incorrect coding and you're not even close to be verified. The mit license doesn't belong to you at all it's mine. Your hatred is a terrible thing to have and I didn't do anything wrong for you to do this. |
|
@Atlantis433 Do you have some problems that are unresolved? Especially the "The mit license doesn't belong to you at all it's mine.". Please write in a calm and understandable way so that we can resolve these issues separately. |
Initial simplification in preparation for adding Font Styles
For subsequent PR: