-
Notifications
You must be signed in to change notification settings - Fork 20
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
[FEATURE] Provide Function to Install CMU Fonts on a User's Machine #45
Comments
Wow, that looks absolutely amazing! Installing the font seems to be easy for linux, but some kind of black magic for windows. So it will require further investigation. What is your use case for this? In MathTeXEngine I currently only include the subset of the CM family we are using. |
Hey @Kolaru ! Yea, with Linux, using a tool like In my case, I have two main use cases currently:
As Javis is built on top of Luxor, solving the first use case would help solve the second. Totally understand if you don't want to work on this but figured I would ask to see if it was possible. |
P.S. An additional use case that I forgot about was the fact that the above image was created for use within the AlgebraicJulia ecosystem. Having a function or alert that could assist a user in installing these fonts would be great as I spent a couple hours tracking down this strange issue. |
I see. I build the package on the assumption that any dependency would load the fonts from the files included in the package using for example Would it be feasible for Luxor to load the font directly without needing a system installation? |
@Kolaru - unfortunately, I do not know. The best person who would probably know is @cormullion . |
TL;DR: Cairo.jl does all the font-finding and font-rendering work for Luxor.jl, and I don't know enough about how it works or whether adding new features would be possible. I wish I could be more helpful. :( I think there are two tasks here: finding the desired font files on disk, and extracting the glyph outlines to draw the glyphs on some surface. I suspect Cairo.jl and Makie.jl use different code paths for both tasks. I don't know what Makie.jl does. ¯\_(ツ)_/¯ Finding fontsI think Cairo.jl uses Drawing glyphsPresumably Cairo is using FreeType on Linux, Quartz on MacOS, and Win-something on Windows? (See https://cairographics.org/manual/cairo-fonts.html) When drawing text to PNGs and GIFs, I think Cairo.jl passes the job of actually rasterizing the glyph outlines to the operating system's text rendering routines. This might explain why you get different output on different platforms see this section. When drawing text to SVGs, Cairo.jl extracts the outlines and converts them to Bezier-based paths; this is also how you can draw text outlines in Luxor. When drawing text to EPS and PDF, Cairo.jl just makes a copy of a subset of the original font data and embeds it in the file. That's about all I know... :) |
This will be fixed on the Cairo side, all font information is included by MathTeXEngine through FreeTypeAbstraction. |
Hey @Kolaru ,
This is an amazing package!
Thanks to @davibarreira, we have it working with enabling LaTeX to work within Luxor.jl to make really professional looking diagrams:
Would it be possible to create a function that allows one to install the CMU fonts onto a user's machine?
I see you distribute the package with the fonts already and it would be nice if this package installed the fonts for you as well.
Thanks!
~ tcp
The text was updated successfully, but these errors were encountered: