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

Remap | in STIX font data [was: "Bad alignement of \vert"] #1154

Closed
ergever opened this issue Apr 8, 2015 · 14 comments
Closed

Remap | in STIX font data [was: "Bad alignement of \vert"] #1154

ergever opened this issue Apr 8, 2015 · 14 comments
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Available v2.7

Comments

@ergever
Copy link

ergever commented Apr 8, 2015

When typing $\vert x \vert$ the vertical line is align to the baseline and according to TeX this should be lower.
See an example here: http://jsfiddle.net/AqDCA/541/

@pkra
Copy link
Contributor

pkra commented Apr 8, 2015

Hm. I'm not seeing anything unusual in that sample (i.e., it matches TeX behavior for me). Can you share a screenshot and more details on your system (browser, OS versions etc.).

@ergever
Copy link
Author

ergever commented Apr 8, 2015

Sorry, I didn't test other browser:

  • on ubuntu 14.04 with firefox 37.0.1 -> bad align:
    firefox
  • on ubuntu 14.04 with chromium 41.0.2272.76 -> bad align:
    chromium
  • windows 7 with IE11 or chrome 41.0.2272.118 or firefox 31.5.0 -> OK:
    explorer

This is with the latest MathJax from github and the default.js configuration.
Thanks you for your interest in this bug.

@ergever
Copy link
Author

ergever commented Apr 8, 2015

By installing on ubuntu the packages fonts-mathjax* the correct font for | is used and the behavior is as expected. I thought that MathJay download automatically the woff fonts as needed but it's apparently not the case! However, with STIX fonts, the behavior is still uncorrect on ubuntu.

@ergever ergever closed this as completed Apr 8, 2015
@pkra pkra reopened this Apr 8, 2015
@pkra
Copy link
Contributor

pkra commented Apr 8, 2015

re-opening since this is definitely a bug. Can you tell us which version of the STIX fonts you have installed on your system?

@dpvc
Copy link
Member

dpvc commented Apr 8, 2015

The vertical line character "|" in the STIX fonts doesn't descend below the baseline, so when the STIX fonts are used, absolute values look like the ones in your first two images. The third one shows the MathJax web font, in which the vertical line does extend below the baseline. You have the STIX fonts installed locally on your Ubuntu machine, but not on the Windows machine, which accounts for the difference in font choice. MathJax will use the locally installed STIX fonts in preference to the web fonts (for performance reasons), unless you change the configuration to prevent that. On the other hand, it will use locally installed MathJax fonts in preference to local STIX fonts, which is why it changed when you installed the MathJax fonts locally. MathJax only uses web-based fonts if you don't have either MathJax or STIX fonts installed locally.

See the discussion on the MathJax User's Forum for a work-around if you are managing your own pages.

@dpvc
Copy link
Member

dpvc commented Apr 8, 2015

@pkra, I'm not sure I'd call it "definitely" a bug, as whether the vertical line descends below the baseline is a font-design decision. There is nothing that says absolute values must look like they do in the TeX fonts (though I do prefer it that way myself).

@pkra
Copy link
Contributor

pkra commented Apr 8, 2015

@dpvc yes, sorry. I should've written "I want to understand what's going on" -- thanks for clarifying.

@pkra pkra added Expected Behavior This is how MathJax works and removed Cannot Reproduce labels Apr 8, 2015
@dpvc
Copy link
Member

dpvc commented Apr 8, 2015

We can think about whether we should make the remapping indicated in the link I gave above be the default (if the character is used in an <mo>). I'm not sure.

@ergever
Copy link
Author

ergever commented Apr 8, 2015

OK thank you for the explanation and the workaround, now I understand what's going on.
The vertical bar of the STIX fonts is definitely buggy: in a pdf generated by LaTeX this is the \big version of \vert which is a bug! But that's another story.

@pkra
Copy link
Contributor

pkra commented Apr 8, 2015

@dpvc we could record it but we should probably wait for STIX 2.0 to come out

@pkra pkra changed the title Bad alignement of \vert Remap | in STIX font data [was: "Bad alignement of \vert"] May 7, 2015
@pkra pkra added Accepted Issue has been reproduced by MathJax team and removed Expected Behavior This is how MathJax works labels May 7, 2015
@pkra pkra added this to the A future font release milestone May 7, 2015
@pkra
Copy link
Contributor

pkra commented May 7, 2015

renamed and added to font milestone.

@dpvc dpvc modified the milestones: MathJax v2.x.x, A future font release May 4, 2016
@dpvc
Copy link
Member

dpvc commented Jun 16, 2016

The font-fixes branch of my fork of MathJax includes a patch that swaps the variant form (which has a descender) and the normal form (which doesn't).

@dpvc
Copy link
Member

dpvc commented Jul 8, 2016

==> Merged.

@dpvc dpvc added Merged Merged into develop branch and removed Ready for Review labels Jul 8, 2016
@dpvc dpvc closed this as completed Jul 8, 2016
dpvc added a commit to mathjax/MathJax-test that referenced this issue Aug 11, 2016
@dpvc
Copy link
Member

dpvc commented Aug 11, 2016

==> In testsuite

MathMLToDisplay/Characters/issue1154.html

@dpvc dpvc added v2.7 Fixed and removed Merged Merged into develop branch labels Jan 5, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Accepted Issue has been reproduced by MathJax team Fixed Test Available v2.7
Projects
None yet
Development

No branches or pull requests

3 participants