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

SVG output and vnsub #1304

Closed
pkra opened this issue Nov 22, 2015 · 12 comments
Closed

SVG output and vnsub #1304

pkra opened this issue Nov 22, 2015 · 12 comments
Labels
Accepted Issue has been reproduced by MathJax team Browser Bug

Comments

@pkra
Copy link
Contributor

pkra commented Nov 22, 2015

Using SVG ouptut, Chrome and WebKit 2.8.5 (but not FF) render ⊂⃒ (or ⊂⃒ or ⊂⃒) (which is not covered by our fonts so fallbaks are used) as plain subset.

@pkra pkra added Accepted Issue has been reproduced by MathJax team Browser Bug labels Nov 22, 2015
@pkra pkra added Accepted Issue has been reproduced by MathJax team and removed Accepted Issue has been reproduced by MathJax team labels Apr 20, 2016
@pkra
Copy link
Contributor Author

pkra commented Jul 11, 2016

Stumbling upon this again, I think it might be a case of #474, rather than a browser bug. @dpvc is that correct?

@dpvc
Copy link
Member

dpvc commented Jul 11, 2016

It now works for me in Firefox, so perhaps it is a moot point. I think 474 is slightly different, in that the combining glyphs actually form a different glyph in the case, while here the combining glyph simply wasn't being shown. Some browsers don't like to draw a combining glyph if there is nothing for it to combine with, and MathJax does include code to work around that, but that is mostly for accents.

Are you still seeing the issue (on current develop branch)?

@pkra
Copy link
Contributor Author

pkra commented Jul 11, 2016

I think 474 is slightly different, in that the combining glyphs actually form a different glyph in the case, while here the combining glyph simply wasn't being shown.

Thanks for the clarification.

Are you still seeing the issue (on current develop branch)?

I see the both glyphs now on FF and Chrome though WebKit still shows only (even in HTML-CSS / CommonHTML which I may not have checked before).

But even on FF and Chrome it looks more like ⊂ | then ⊂⃒ (again, all outputs actually).

@dpvc
Copy link
Member

dpvc commented Jul 11, 2016

But even on FF and Chrome it looks more like ⊂ | then ⊂⃒

Here's what I see on Mac OS X:

svgshtmlhtml-css

These are for SVG, CommonHTML, and HTML-CSS, all with TeX fonts.

For STIX fonts, I see

svg-stixhtml-css-stix

in SVG and HTML-CSS (CommonHTML doesn't use STIX fonts yet).

While the TeX font arrangement is not ideal, it is not the separation that you see. Is that the Linux output?

@dpvc
Copy link
Member

dpvc commented Jul 11, 2016

I have made a U+20D2 branch that handles the U+20D2 character via backspacing and vertical bar instead of the combining character. See what you think of that. The combining characters have always been a pain as they are handled differently by different browsers and OSes. Not sure if it is better to replace them by this kind of spacing hack, or try to find more browser-specific work-arounds.

@pkra
Copy link
Contributor Author

pkra commented Jul 12, 2016

Thanks, Davide. The changes on your new branch look better.

While looking at them I wondered if we were talking about two different things re #474. I still see what I described with TeX input (e.g., $$&vnsub;$$) but <math display='block'><mi>&vnsub;</mi></math> looked like your screenshots for me too.

Actually, on your branch, even the TeX input looks good on CommonHTML (but not the other outputs), testing Chrome, Web(Kit), Firefox. WebKit still loses the strike-through glyph in SVG no matter the input.

FYI, this bug isn't any kind of priority from my end; I was just going through the browser bug tag. Seems like Webkit is the only browser bug part left.

@dpvc
Copy link
Member

dpvc commented Jul 12, 2016

Sorry, I didn't realize you were talking about TeX input (the original message didn't specify the input format). You are right, in the TeX setting, since &vnsub; is a two-character entity (U+2282 U+20D2), the TeX input jax picks it up as two separate <mo> elements. That does interfere with the rendering. So you are right that this could be viewed as #474 in that combining character might want to be included in the same MathML node as the preceding character.

Technically, one ought not to be using such characters in TeX anyway. One solution would be to use \mmlToken{mo}{&vnsub;} instead, or \def\vnsub{\mmlToken{mo}{&vnsub;}} and then use \nvsub.

@dpvc
Copy link
Member

dpvc commented Jul 12, 2016

Alternatively, you could use

<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
  MathJax.InputJax.TeX.prefilterHooks.Add(function (data) {
    data.math = data.math.replace(/(.\u20D2)/g,"\\mmlToken{mo}{$1}");
  });
});
</script>

to pre-filter the TeX input to add the \mmlToken macro for you.

@dpvc
Copy link
Member

dpvc commented Jul 12, 2016

If you want to rename this something like "TeX Input: include postfix combining diacritical marks with preceding character", and remove the browser bug label, I'd be OK with that.

@pkra
Copy link
Contributor Author

pkra commented Jul 13, 2016

Thanks, Davide. I don't remember if I was thinking of TeX input when I opened this.

If it's ok with you, I'd propose to leave this bug as.

On the one hand, the browser bug in the OP persists on WebKit (even though Blink seems to have fixed it). On the other hand, I think #474 is sufficient for the TeX-input problem.

@dpvc
Copy link
Member

dpvc commented Jul 13, 2016

the browser bug in the OP persists on WebKit

Do you mean in MathML or TeX? For me in Safari 9.1.1 the MathML version works as expected. The images I gave above were from Safari. It may have been fixed in a recent WebKit, so older WebKit browsers don't yet have the fix?

@pkra
Copy link
Contributor Author

pkra commented Jul 13, 2016

For me in Safari 9.1.1 the MathML version works as expected.

Interesting. I can confirm that. My other browser is Gnome's Web, using WebKit 2.10.9 which was released 4 days before Safari 9.1. (Then again, IIUC, they are not always comparable.)

Closing this then.

@pkra pkra closed this as completed Jul 13, 2016
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 Browser Bug
Projects
None yet
Development

No branches or pull requests

2 participants