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
Label point sizes appear visually different despite being set to the same size in Style #340
Comments
this is so weird. Do you think this is a regression from prior behavior or a latent bug? It's possible that it's MathJax3 behaving differently than 2. One way to test this is comparing to this commit, the last one before we added MathJax3: 3f077d9 (I really need to learn how git bisect works. Ive been using git checkout to do this manually) |
I thought the font sizes had misbehaved in the past (as in the bottom of this comment: https://github.com/penrose/TOG-2019/issues/5#issuecomment-546659288), but I don't remember if that was an actual issue or an optical illusion. |
optical illusions: #JustPenroseBugTypes |
Lol. Anyway, unfortunately setting the label height behaves poorly in the tree example:
Not sure what's going on with the first two. |
(Updated above comment to reflect that I resolved the unrelated padding issue) |
Speculation: our "output container" is ill-defined: http://docs.mathjax.org/en/latest/web/typeset.html#obtaining-the-output-metrics We aren't doing stuff in the DOM, we're rendering the label headlessly and then placing it, absolutely-positioned and relatively-sized, in a custom layout engine. This makes MathJax's job very hard since it has so many assumptions about how text will be situated. Hypothesis: in absolute terms, I don't think there's a quick fix for this :( unless @wodeni has hack ideas |
…nt font size issue (#340) (HACK: only works for examples where we know labels have the same height). also fix issue with centerArrow where the spacing was doubled on one end, not sure why
Tldr: what I grok from MathJax is that it sorta listens to font size but not really because translating that into concrete path dimensions is complicated ?? |
Sounds complicated. Thanks for looking into this! |
@wodeni just defer to this thingy and maybe it works https://github.com/mathjax/MathJax-demos-web/blob/master/input-tex2svg.html#L35-L37 |
Nimo's other hypothesis: the g's descender makes the height bigger |
some helpful comments from the MathJax folks: mathjax/MathJax#2437 (comment) |
I think I have a heuristic that fixes it for now (ignore my bad hand-alignment): I followed the maintainer's advice and corrected the height according to the (in Note the use of constant height: @wodeni, we may not be able to do "fancy" units headlessly (see how LiteAdaptor - MathJax's virtual dom - handles this https://github.com/mathjax/MathJax-src/blob/32213009962a887e262d9930adcfb468da4967ce/ts/adaptors/liteAdaptor.ts#L43) but we sure can do internal/pixel heights!! |
@maxkrieger That new screenshot looks great! So, in practice, how should we be setting label sizes in the future in Style? Still something like Also, can you confirm that your new changes don't break anything on the existing working examples for |
For now pixels only, until the maintainer gives a solution. We can also do our own heuristic and internally set the pixel values to match the unit's. Curious what @keenancrane thinks about these non-pixel units in the long run. I know it makes embedding in papers way easier (matching the global font) but I'm guessing that the relation to the shapes (which use pixel values) is important too?
Done! ✅ lgtm (not much different). Continuousmap currently throws an error but it was this way before my changes. |
I made some simple examples that Keenan requested for the Penrose blog post / Twitter thread, but am running into a weird font size issue.
@maxkrieger @wodeni can you take a quick look and let me know how to address this ASAP, or if there's a (reasonably principled) workaround? It's blocking us from posting examples :)
Repro with minimal example: on branch
set-example
, dorunpenrose set-theory-domain/intersection-venn-diagram.sub set-theory-domain/venn-simple.sty set-theory-domain/setTheory.dsl
Expected result: all labels have the same size, 15 pt
Actual result: "Circle" label looks smaller than the other two
Tried:
I also don't know if all three labels are actually mis-sized, but only "Circle" is the visually noticeable one.
Related issues: #301 (comment)
The text was updated successfully, but these errors were encountered: