-
Notifications
You must be signed in to change notification settings - Fork 75
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
What are CLM files and where to get them? #174
Comments
clm files contain precalculated metadata needed by µTeX to render glyphs, which we don't want to do at runtime. The name comes from cLaTeXMath, which was the name of the original library (thats whats still in the master branch) altho ironically cLaTeXMath doesn't use those clm files. Specifically, .clm1 files contain only metadata and .clm2 files contain both meta- and glyph data for usecases where there isn't a library available capably of laying out glyphs from font files. They can be generated using the otf2clm.py script. |
Thanks! Have you got some more information about the "use cases" you mentioned, that is which use cases require .clm1 and which require .clm2 files? Is that related to the different backends (cairo, GDI+, Flutter...) supported by MicroTeX or what exacxtly do you mean by "use case"? |
Yes. The backends provide a set of (more or less) primitive vector operations. MicroTeX doesn't actually read the otf font files, they just get passed to the backend on initialization. This way, characters can be drawn using |
Ok, is there an overview which backends require .clm2 and which are fine with .clm1? For example, I'm using the cairo backend. Does that require .clm1 or .clm2? I suppose .clm1 because looking at the backend source it passes the otf font file to fontconfig and then converts it into a cairo font face so I suppose the cairo backend doesn't require .clm2? But what about the other backends? Which ones need .clm1 and which need .clm2? |
Im not sure, the whole backend situation gets even more complicated, as some backend builds on top of others. While all backends seem to have implemented drawGlyph, I suspect some backends can't load arbitrary fonts (at least wasm can't) |
When initializing MicroTeX I always need to pass a CLM file as well as an OTF file. I'm currently using the
latinmodern-math.clm1
that is part of the MicroTeX distribution and that works just fine but what if I want to use some arbitrary font that is installed on the user's system? There are no CLM files but just OTF/TTF/TTC files in the system's font directory.So what if I want to use some arbitrary system font? Do I first have to generate a CLM file for that before it can be used with MicroTeX or how does that work? I've never heard of the CLM format before and Google doesn't really help here either. Is CLM a format proprietary to MicroTeX or is it some sort of standard?
Thanks for some clarification!
The text was updated successfully, but these errors were encountered: