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

In PDF, $A$ and $\Alpha$ give identical glyphs. But not in browser. #611

Closed
jfine2358 opened this issue Apr 23, 2023 · 7 comments
Closed

Comments

@jfine2358
Copy link

jfine2358 commented Apr 23, 2023

Description

The unicode code points

MATHEMATICAL ITALIC CAPITAL ALPHA
MATHEMATICAL ITALIC CAPITAL A

are represented by what appear to be identical glyphs. Please note that my shell (on fedora) provides different glyphs for these two code points (see further details below). The same goes for my browser, which is Firefox.

[Edit: Add strike-though and following comment] My browser, which is Firefox, has the same problem when I preview this issue, but not when I am writing it.

Minimal example demonstrating the issue

\documentclass[12pt]{article}
\usepackage[math-style=ISO]{unicode-math}
\begin{document}
\shipout\hbox{$\Alpha$ $A$}
\stop

Further details

This arise from a conversation on texhax, see: https://tug.org/pipermail/texhax/2023-April/026046.html

Most of the following comes from that post. Copy and paste from PDF to Python console (fedora) gives:

>>> tuple(map(ord, '𝛢𝐴'))
(120546, 119860)
>>> import unicodedata
>>> for c in '𝛢𝐴': print(unicodedata.name(c))
... 
MATHEMATICAL ITALIC CAPITAL ALPHA
MATHEMATICAL ITALIC CAPITAL A
@davidcarlisle
Copy link
Member

whether the glyphs are the same or not is purely down to the font designer. There is no issue for unicode-math here.

@u-fischer
Copy link
Member

yes, the latin and greek scripts share some glyph forms. That isn't really suprising in view that they have a common origin. Btw: cyrillic and latin share glyph forms too:

\documentclass{article}
\usepackage{fontspec}
\setmainfont{heuristica}
\begin{document}
AM АМ 
\end{document} 

image

@jfine2358
Copy link
Author

I'd like to focus on the user experience. A diligent user might look at the package documentation http://mirrors.ctan.org/macros/unicodetex/latex/unicode-math/unicode-math.pdf, which is recommended for users.

I've searched in that document for \Alpha. I get 3 matches, all for \alpha. From I conclude that even the diligent user would not discover that $\Alpha$ and $A$ produce identical glyphs. I believe that showing the user this feature in the package documentation would be helpful.

I note that the documentation states:

Maths input can also be simplified with Unicode since literal glyphs may be entered instead of control sequences in your document source.

I fully support this facility being made available. Unicode is a widely used standard for the interchange of text files containing special characters. However, this Unicode editing faciliity is not so useful if the fonts used by the editing software use identical glyphs for:

MATHEMATICAL ITALIC CAPITAL ALPHA
MATHEMATICAL ITALIC CAPITAL A

It is a little odd that unicode-math requires appropriate glyphs to properly utilise this Unicode-editing feature on input, but does not provide it (in this case) on output.

@davidcarlisle
Copy link
Member

It is a little odd that unicode-math requires appropriate glyphs to properly utilise this Unicode-editing feature on input, but does not provide it (in this case) on output.

sorry I can not guess what you mean by this. the issue seems unrelated to unicode-math. glyphs are purely a font issue, and as far as I can see all OpenType math fonts have both U+1D6E2 𝛢 and U+1D434 𝐴. Whether or not these glyphs look the same depends on the font not any latex package. But for cultural and historic reasons I would guess they are the same in most fonts, so I doubt any user is surprised by that.

@jfine2358
Copy link
Author

@davidcarlisle wrote

as far as I can see all OpenType math fonts have both U+1D6E2 𝛢 and U+1D434 𝐴.

Well said and most helpful. When I read and write in the Github issue tracker I see these two as distinct glyphs and so can tell the two code points apart.

But first note that my main point and concern is that the user documentation tell the user that $A$ and $\Alpha$ produce the same glyph. This is, I think we agree, a fact. I believe the user should have ready access to that fact.

Back to the side issue. I will clarify my previous comment.

It is a little odd that unicode-math requires appropriate glyphs to properly utilise this Unicode-editing feature on input, but does not provide it (in this case) on output.

When you created your comment (as quoted about) you could visually check that the two code points are different, because they look different.

This feature is of course useful for anyone authoring a LaTeX source document that uses these two code points in Unicode (as opposed to using $\Alpha$). Without that feature (different glyphs) authoring in math in Unicode would be less pleasant (when both the $A$ and $\Alpha$ code points are in use).

However, my main point is that I'd like the user documentation to tell the user that $A$ and $\Alpha$ produce the same glyph.

@davidcarlisle
Copy link
Member

Well said and most helpful. When I read and write in the Github issue tracker I see these two as distinct glyphs and so can tell the two code points apart.

You must be using different fonts, as they look the same here.

When you created your comment (as quoted about) you could visually check that the two code points are different, because they look different.

No.

I'd like the user documentation to tell the user that $A$ and $\Alpha$ produce the same glyph.

That would be wrong. They produce the glyphs specified by the font desiger of the font the document author chooses. This package has no control over that.

In the font I am seeing in this issue I and l are, as far as I can tell, identical. Do you expect latex to warn users of that as well?

@wspr wspr closed this as completed Aug 12, 2023
@wspr
Copy link
Collaborator

wspr commented Aug 12, 2023

As David mentioned, this is a font design choice and unrelated to this package.

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

No branches or pull requests

4 participants