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

⚡ Added more unicode characters not supported by MathTeXEngine. #212

Merged
merged 1 commit into from
Mar 24, 2022

Conversation

davibarreira
Copy link
Contributor

Very small PR adding more unsupported unicodes to the list to make them available for LaTeX users.

@davibarreira
Copy link
Contributor Author

I think it's all good now. My fork was a bit messy.

@cormullion cormullion merged commit e5932b8 into JuliaGraphics:master Mar 24, 2022
@cormullion
Copy link
Member

Cool, thanks!

At some point I want to find out what that function is doing with setfont/settext and get it working with text paths, like the other LaTex, but at the moment I don't want to know.... :)

@davibarreira
Copy link
Contributor Author

What function exactly ? :X
I could tell you, whenever you want to know haha.

@cormullion
Copy link
Member

Well, here you do both fontface and setfont, and both text and settext, and wasn't quite sure why your were switching between toy and pro.

latex.jl: 193...

    fontface(text[1].font.family_name)
    fontsize(font_size * text[3])

    if string(text[1].char) == ""
        setfont(text[1].font.family_name, font_size * text[3])
        Luxor.settext(string(text[1].char), Point(text[2]...) * font_size * (1, -1)+Point(0.25,0.3)*font_size)

    elseif text[1].represented_char == '{' || text[1].represented_char == '}'
        Luxor.text(string(text[1].char), Point(text[2]...) * font_size * (1, -1)+Point(0,-0.8)*font_size)

    elseif string(text[1].char) in extrachars
        setfont(text[1].font.family_name, 1.3font_size * text[3])
        Luxor.settext(string(text[1].char), Point(text[2]...) * font_size * (1, -1)+Point(0,0.3)*font_size)

    else
        Luxor.text(string(text[1].char), Point(text[2]...) * font_size * (1, -1))

Perhaps you can add some comments next time you're bored... :)

@davibarreira
Copy link
Contributor Author

Hmm, I don't know exactly the difference between fontface and setfont, and settextand text.
When I use Luxor, I use the fontface and text functions. Yet, for some reason, these functions did not work when I wanted to write these extra unicodes. I tested using setfont, and settext, and it worked. So I just went with it.

@davibarreira
Copy link
Contributor Author

The first fontface could have been placed inside the last else and inside of the second elseif, but I just used it on the top instead.

@cormullion
Copy link
Member

Oh yes, that jogs my memory - the available font lists are different in toy and pro, I think. One day … 😀

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.

None yet

2 participants