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

support Unicode Emoji variant selectors #3181

Closed
hbghlyj opened this issue Feb 11, 2024 · 3 comments
Closed

support Unicode Emoji variant selectors #3181

hbghlyj opened this issue Feb 11, 2024 · 3 comments
Labels

Comments

@hbghlyj
Copy link

hbghlyj commented Feb 11, 2024

Is your feature request related to a problem? Please describe.
Unicode defines two variation selector characters, U+FE0E and U+FE0F, also respectively known as VS15 and VS16.

When VS15 is appended to a symbol, it forces it to be displayed as text (black and white glyph). Contrarily, when VS16 is appended, it forces the color version to be displayed (emoji).

Take monochrome version ❌︎ as the input of MathJax, the output is the color version ❌

image

Describe the solution you'd like
Take monochrome version ❌︎ as the input of MathJax, the output should remain monochrome.

@dpvc
Copy link
Member

dpvc commented Feb 12, 2024

This is not something that MathJax controls. You don't say what OS or browser you are using (as requested in the issue template), but on my Mac OS, U+274C shows the colored version regardless of whether it is followed by U+FE0E or U+FE0F, or by neither one. This is being handled by the system text renderer, since U+274C is not in the MathJax fonts, so it is up to the system to properly handle these selectors. MathJax doesn't have any control over that, other than to pass them along to the system in this case.

Of course, you should use \text{...} around any such multi-character sequences so that MathJax will put them into a single mtext node rather than treating each as a separate mi or mo.

@dpvc dpvc added the Upstream label Feb 12, 2024
@hbghlyj
Copy link
Author

hbghlyj commented Feb 12, 2024

This is not something that MathJax controls. You don't say what OS or browser you are using (as requested in the issue template)

Sorry, I didn't mention that I am using Mozilla Firefox (122.0.1) on Windows 11 Education version 10.0.22631 Build22631.

Of course, you should use \text{...} around any such multi-character sequences so that MathJax will put them into a single mtext node rather than treating each as a separate mi or mo.

Yes, I tried \text{❌︎} and the output MathML is

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block">
  <mtext>&#x274C;&#xFE0E;</mtext>
</math>

I think the problem is, in the output HTML, &#x274C; and &#xFE0E; is separately put into two nodes.
image

@dpvc
Copy link
Member

dpvc commented Feb 12, 2024

You haven't said what version of MathJax you are using (since you haven't filled out the issue template, as requested when you start an issue), and the handling of unknown characters has been evolving over time. Version 4 groups these together, but version 3 only does if you set mtextFontInherit: true, so try setting that. And version 4's SVG output didn't group elements until mathjax/MathJax-src#903, which is not in beta.4, but will be in beta.5.

@hbghlyj hbghlyj closed this as completed Feb 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants