Skip to content

Conversation

@manuelbb-upb
Copy link
Contributor

this pull should help with #93:
image
and #105:
image

the changes are a bit involved;

  • we actually try to load the MATH table of the :math font to get recommended constants for typesetting y-positions
  • rules similar to the TeXBook PDF are applied; it's a bit complicated to follow, unfortunately
  • primes get special treatment:
    • as before L"f'" will be treated as a superscript; but other unicode symbols work, too (this is what unicode-math does, I think)
    • doube and tripple ticks are converted to appropriate unicode symbols and
    • however, \prime gives just the glyph
    • i.e., the string L"x' f' x'' f'' x′ f′ x\prime f\prime x^\prime f^\prime x'_y f_g'" gives image
  • some more prime commands are defined (\dprime, \backdprime,...)
  • scaling is now constant from decoration level 2 upwards; L"A^{B^{C^{D^E}}}_{F_{G_{H_I}}} f^{A'}" gives image

The level dependent styling required changes to the state structure; this feels a bit hacky, but easier than inspecting the stack.

Here is the reference images from master:
subsuper
and the current pull:
subsuper

@manuelbb-upb
Copy link
Contributor Author

If OpenType Table parsing is too adventurous, constant defaults can be used.
Otherwise we can go all in and even check for the ssty feature to get nice sub- and superscript glyphs, see the ssty branch.

@manuelbb-upb manuelbb-upb marked this pull request as draft November 26, 2025 08:41
@manuelbb-upb
Copy link
Contributor Author

I have marked this "draft" again so that we can decide on whether or not to simply use constants or try to parse opentype tables.
I think the latter option is nicer in that results should look closer to LuaLaTeX output, but I am always a bit nervous around ccall. Locally, things seem to work fine. Should we go for table parsing, I will merge the ssty branch into this pull request, so that we can even have dedicated scriptstyle symbols.

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

Successfully merging this pull request may close these issues.

1 participant