-
-
Notifications
You must be signed in to change notification settings - Fork 313
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
some latex strings can not be correctly rendered #1991
Comments
Regarding |
Also: [13f3f980] CairoMakie v0.8.0
[b964fa9f] LaTeXStrings v1.3.0
[0a4f8689] MathTeXEngine v0.4.0 as can be seen here (second to last slide): https://github.com/fatteneder/MakieSlides.jl/blob/ff2615ed9678abd6f9bd55baac80265531678ddb/examples/presentation.pdf |
@fatteneder It can be checked that
although the result is different from:
|
I vaguely remember that @Kolaru said that some difficulty lies in the way needed symbols are accessed in the computer modern fonts. The pipeline we use accesses glyphs from FreeType fonts via unicode Chars. However, imagine a font that has two different glyphs for the character 'a', you would not be able to pick the correct glyph by passing the Char. You instead need an integer specifying the position of the glyph in the font. And I can imagine that there would be more symbols to access for MathTeXEngine if Makie allowed glyph indexing by integer instead of by Char. Buy that's just an educated guess from my side. |
That's a very interesting one. The pipeline for symbol finding in MathTexEngine is currently
The problem is just that
This problem is why we need step 3 above and we can not use a unicode font directly. It is a bit trickier than that even, since, as far as I understood, different glyphs for the same char are at the same index in the font ( |
Isn't this why Unicode variation sequences exist? https://freetype.org/freetype2/docs/reference/ft2-glyph_variants.html I am currently in the process of understanding how unicode emojis can be rendered, because some of those come with such a sequence (usually flags, peoples and their skin tones). However I am having trouble in using the |
Oh yes you are right. After some looking I also see that the variation glyphs seem to just be outside of the unicode indices in the font, so it may be possible to do it with Makie and Cairo actually. Still, I haven't check if FreeTypeAbstraction.jl supports the variation sequence. |
I think it does not, but there is a feature request from you :) JuliaGraphics/FreeTypeAbstraction.jl#59 |
One problem is that GLMakie will not be able to render emoji with the SDF pipeline. |
Indeed, I was made aware of this at fatteneder/MakieSlides.jl#15 (comment) We are working around this for now using The problem I had with |
I found two more characters that can not be rendered: |
@Kolaru I've added a draft PR that switches the GlyphCollection representation to |
Tested a couple, seems to be fixed |
By now, I have found 2 latex characters that can not be correctly rendered. The MWE is
, which results in
And similarly,
L"\degree"
is rendered intoThe infomation of
julia
isand the versions of packages are:
I have tried to generate tex elements by:
, which are normal.
And to check if the
.ttf
files are correct:, which also works fine.
The text was updated successfully, but these errors were encountered: