-
-
Notifications
You must be signed in to change notification settings - Fork 291
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
Fix compatibility issue with MathTeXEngine #1785
Conversation
The new version of MathTeXEngine has been merged to the registry so the CI can be retriggered (not sure if I can do it directly). |
(so that the way to do it... thanks Simon ^^') The tests fail because of one reference test: Essentially the sum symbol got a little bit bigger and the big square root symbol changed. To me it looks okay (but I don't quite understand how to update the reference or even if I need to do it manually). So I would say it is ready for review. |
Square root looks much better now. Y-label code would be better as |
Closes #1785 I suppose |
src/types.jl
Outdated
@@ -359,7 +359,7 @@ struct GlyphCollection | |||
glyphs::Vector{Char} | |||
fonts::Vector{FTFont} | |||
origins::Vector{Point3f} | |||
extents::Vector{FreeTypeAbstraction.FontExtent{Float32}} | |||
extents::Union{Vector{FreeTypeAbstraction.FontExtent{Float32}}, Vector{TeXChar}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why don't we use the same representation for both? It doesn't have to be FontExtent, but that is just a collection of a couple numbers anyway, so those should be extractable from TeXChar. Basically at the later point in the pipeline, I would like to not differentiate between different ways to generate text anymore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because I am lazy wanted to minimize changes for that PR.
That can totally be handled by the the GlyphCollection
constructor and then stored in an unique way. I will look into it.
Would this help with #1560? |
I think there is just a very minor change in the computation of the bounding box, but I haven't have time to go through all the references images to make sure I haven't break anything (I preferred to wait for the CI to make sure the tests are run correctly). I will ping you once I have gone through everything. |
Sorry to bump here, but is this ready to be merged? I suspect this may fix some problems in AlgebraOfGraphics: updating to new Makie somehow confuses the resolver, as the old MathTexEngine brings in an old version of RelocatableFolders, see here. I imagine upgrading to newer MathTexEngine would fix that. |
@Kolaru happy to help getting this over the finish line! |
I think one of my recent pr's messed up something with lines here. I'll try to merge master and fix it |
I looked through the GLMakie failures. As far as I can tell they all failed because the bottom white space is slightly less, like in Simons gif. I don't think it's a problem... |
Failures (in GLMakie) are still related to bounding box changes. Most are irrelevant but some are worth mentioning: It seems like something changes about axis limits in this test:Latex ticks (and latex labels) are very tight now: (Though you might count that as a problem of normal text, since that seems to use more space than it technically should) |
@ffreyer Could they be more accurate now, so that 7f0 is actually closer to the padding we want? |
The left/right alignment still has a gap between
The tallest character starts/ends at the y value of the given text position now. 3 of those share that position, so they touch now. Before it was based on the height of the font, which I guess means the tallest character in the font? |
I think these tight alignment changes are also part of #1847 (but probably implemented differently) Maybe we can merge the prs? |
The reason that I don't use the exact character bounding boxes anywhere else are that when you animate a title for example, you don't want it to jitter up and down when you change an |
Obsolete via #1952 |
Thanks everyone :) Really happy to get this finally merged :) |
Description
Fixes the compatibility problem discussed in #1491 using the changes introduced in MathTeXEngine in Kolaru/MathTeXEngine.jl#58
I have given the same interface to
TeXChar
thatFreeTypeAbstraction.FontExtent
has. This meansTeXChar
can be used interchangeably withFontExtent
, putting the full responsability to produce correct bounding boxes and positioning onMathTeXEngine
without requiring additional special cases for LaTeXString in Makie.I run the test locally and everything looked fine. Hopefully I did it correctly.
Type of change
Edit: Looks like it may have been wise to wait for the registration of the new version of MathTeXEngine to be fully register before using it here >_<