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

[CommonHTML] Poor over script position above italic letters #1735

Closed
samdooley opened this issue Apr 14, 2017 · 6 comments

Comments

Projects
None yet
3 participants
@samdooley
Copy link

commented Apr 14, 2017

Issue Summary

Over script characters that are positioned above italic characters appear too far to the right, as if the italic correction is not handled properly.

Steps to Reproduce

  1. Load the following HTML example page.
<script type="text/javascript"
   src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.0/MathJax.js?config=MML_CHTML">
</script>

<math xmlns="http://www.w3.org/1998/Math/MathML" mathsize="36pt">
  <mover>
    <mrow>
      <mi>X</mi>
      <mo>&#x2063;</mo>
      <mi>J</mi>
    </mrow>
    <mo>&#x23dc;</mo>
  </mover>
  <mo>=</mo>
  <mover>
    <mrow>
      <mtext mathvariant="italic">X</mtext>
      <mo>&#x2063;</mo>
      <mtext mathvariant="italic">J</mtext>
    </mrow>
    <mo>&#x23dc;</mo>
  </mover>
</math>
  1. Observe the horizontal position of the over script character in relation to the italic base letters.

This is a bug because the extent of the over script character should match the extent of the base letters, after accounting for the italic slant of the characters. The over script extends too far to the right, especially for the case on the left that uses mi elements.

Technical details

  • MathJax Version: 2.7.0 release
  • Client OS: Windows
  • Browser: Chrome

mover-italic

@pkra pkra changed the title Bug: Poor over script position above italic letters [CommonHTML] Poor over script position above italic letters Apr 16, 2017

@pkra pkra added the Accepted label Apr 16, 2017

@pkra

This comment has been minimized.

Copy link
Member

commented Apr 16, 2017

Thanks for the report. I can reproduce this with the CommonHTML output on Chrome and Firefox.

@pkra pkra added this to the A future release milestone Apr 16, 2017

@dpvc

This comment has been minimized.

Copy link
Member

commented Apr 16, 2017

I believe the problem is this line, which bubbles the accent skew up from lower nodes to higher nodes. The skew value is only supposed to be used if base is a single character, but this propagates the skew value for all cases. I think

            if (cbox.skew && this.data.length === 1) bbox.skew = cbox.skew;

would do the trick.

@samdooley

This comment has been minimized.

Copy link
Author

commented Apr 17, 2017

Thanks for the patch. I was able to test it with a local 2.7.0 and it is better, but I believe the line above needs the same treatment. So I think:

        if (cbox.ic && this.data.length === 1) {bbox.ic = cbox.ic} else {delete bbox.ic}
        if (cbox.skew && this.data.length === 1) bbox.skew = cbox.skew;

does the trick, both for arc(XJ) and arc(XY).

@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 7, 2017

The issue1735 branch of my fork of MathJax includes a fix for this.

@dpvc dpvc removed their assignment Jul 7, 2017

dpvc added a commit that referenced this issue Jul 10, 2017

Merge pull request #1787 from dpvc/issue1735
Improve position of stretchy accents.  #1735

@dpvc dpvc added Merged and removed Ready for Review labels Jul 10, 2017

@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 10, 2017

==> Merged.

dpvc pushed a commit to mathjax/MathJax-test that referenced this issue Jul 15, 2017

@dpvc

This comment has been minimized.

Copy link
Member

commented Jul 15, 2017

==> In testsuite

MathMLToDisplay/Presentation/ScriptsAndLimits/mover/issue1735.html

@dpvc dpvc added Test Available and removed Test Needed labels Jul 15, 2017

@dpvc dpvc closed this Jul 15, 2017

@dpvc dpvc added Fixed v2.7 and removed Merged labels Jul 18, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.