Skip to content
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

Fix handling of italic correction for munderover and msubsup combinations. #634

Merged
merged 4 commits into from
Mar 19, 2021

Conversation

dpvc
Copy link
Member

@dpvc dpvc commented Mar 17, 2021

This PR refactors some fo the previous accent code to better handle the italic correction differences in the bases of some constructs (msub, msubsup, and math-accent munderover nodes). The previous code included some hacks that were competing with each other, and caused complications in handling the interactions between munderover and msubsup nodes. This refactors some of the code to make that work more reliably, and moves more to the common wrappers so that the specific output routines are more uniform.

In the past, the italic correction was removed from the base character when it was output, and had to be added back in later, which made for complicated checking of whether the italic correction needs to be taken into account and when it needs to be added again. The new approach is to always include the italic correction in the base and then compensate for it when subscripts are added, or when math accents are placed. This makes for fewer cases, and allows the CHTML CSS to be reduced by removing the need for the noIC selector cases.

This PR also moves the useIC properties to the common wrappers (since they are inherited), and switches the default to true since that makes for fewer cases that need to be overridden (just msub and msubsup).

dpvc added 4 commits March 16, 2021 08:02
…oveIc instead and adjust widht after the fact). Also move useIC to common classes since it is inherited, and made the default true (fewer special cases to override).
@dpvc dpvc requested a review from zorkow March 17, 2021 18:35
@dpvc dpvc added this to the 3.1.3 milestone Mar 17, 2021
Copy link
Member

@zorkow zorkow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One question. Otherwise, the code is a lot cleaner now!

ts/output/common/Wrappers/scriptbase.ts Show resolved Hide resolved
@dpvc
Copy link
Member Author

dpvc commented Mar 19, 2021

Otherwise, the code is a lot cleaner now!

Thanks! I think moving things to the common wrappers and scriptbase and giving them names rather than just doing computation helped a lot in that respect. Always helpful to go over the whole thing once it is in place, and the munderover/msubsup code was particularly intertwined and complicated, so that was a valuable exercise.

@dpvc dpvc merged commit 5158267 into underline-overline Mar 19, 2021
@dpvc dpvc deleted the mathaccent-ic branch March 19, 2021 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants