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

Superscripts and subscripts contact each other when stacked #164

Open
amarakon opened this issue Mar 18, 2023 · 9 comments
Open

Superscripts and subscripts contact each other when stacked #164

amarakon opened this issue Mar 18, 2023 · 9 comments

Comments

@amarakon
Copy link

By using the subs and sups OpenType features for subscripts and superscripts respectively, I can stack superscripts on top of subscripts. In LaTeX this can be done with the \textsubsuperscript or \textsupersubscript command from the realscripts package. Because the superscript is too low and big and because the subscript is too high and big, they end up contacting each other. I think this problem can be solved by adjusting the vertical position of subscripts and superscripts or their size or both.

\documentclass{standalone}

\usepackage{fontspec, realscripts}
\setmainfont[Scale = 10]{Junicode Two Beta VF}

\begin{document}

\textsubsuperscript{1}{1}

\end{document}

another-1

@psb1558
Copy link
Owner

psb1558 commented Mar 20, 2023

Another little survey suggests that, yes, in most fonts that have sups and subs feature one can stack superscripts and subscripts. Interestingly, they come in a wide range of sizes. In Roboto Serif, for example, they are 56 percent of the height of lining figures, while in Brill they are 97 percent of the size.

I wanted mine to be fairly large: they are 60 percent of a lining figure. I may make them larger (more like Brill), but will make sure they can be stacked (though I don't know why anyone would want to do that).

@psb1558
Copy link
Owner

psb1558 commented Mar 20, 2023

BTW, I'm glad to see you are using the variable font with LaTeX. Only a year ago, the luaotfload code for variable fonts was too buggy to use at all, but now it seems rock solid.

@kenmcd
Copy link

kenmcd commented Mar 20, 2023

(though I don't know why anyone would want to do that).

That is typically a math font thing.
Not really in the scope what I think you are doing with Junicode (is it?).

@psb1558
Copy link
Owner

psb1558 commented Mar 20, 2023

Junicode is not good at math--this being mainly because I am also not good at math. However, a while ago some kind people guided me through a redesign of the math symbols in Elstob, and it's on my to do list to apply those lessons to Junicode, because I do hear regularly from people who use it for math.

In this case it appears that the problem was that the subscripts were not quite sub enough. I'm lowering them slightly.

@amarakon
Copy link
Author

(though I don't know why anyone would want to do that).

That is typically a math font thing.
Not really in the scope what I think you are doing with Junicode (is it?).

My use case is that I want to typeset standard atomic notation using OpenType features instead of sub- and superscripts in math mode. I’m not sure if I should be using the Roman font or math font for chemical symbols.

@psb1558
Copy link
Owner

psb1558 commented Mar 20, 2023

I don't believe there are any chemical symbols in Junicode. Lots of fonts appear to have them, though, and they're not the kind of thing that has to harmonize with any particular type style.

@amarakon
Copy link
Author

To clarify: by chemical symbol I mean one or two letters that represents an element. For hydrogen that would be "H". In atomic notation there is a superscript directly on top of a subscript.

@amarakon
Copy link
Author

amarakon commented Mar 20, 2023

In this case it appears that the problem was that the subscripts were not quite sub enough. I'm lowering them slightly.

You might also want to raise the superscripts by the same factor since they appear a bit too low. The ordn OpenType feature should be slightly lower than sups. I think you can use the current superscripts for ordn and then raise the superscripts for the sups feature.

See #166.

@psb1558
Copy link
Owner

psb1558 commented Mar 20, 2023

In my ignorance, I was reduced to Googling "Unicode chemical symbols" and got something quite different. Alas, I have no idea what one should do in setting chemical symbols as you define them.

On sups and subs: I noticed that in fonts that seem to know what they're doing in this area, a pair of stacked sups and subs would be vertically centered (approximately) in the em square (thus a little higher): I've been at work on that. Meanwhile, there is also a "superior" series which I can keep at its present height and use for ordn. Should be possible to do this without bulking up the file much.

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

3 participants