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
Fontspec cannot find fonts by name #1118
Comments
This is essentially #9 once again. See also my comment here: #965 (comment). It's reassuring that even Will Robertson calls the font file name the better way of specifying the fonts to load. However, unfortunately many packages use font names. We can always patch packages, but, because it seems simpler, I assume that also many users use font names. Hence we need to do something about it. Tectonic here is based on XeTeX in that for font names it uses only In terms of reproducibility I think that Tectonic should preferably support only searching for fonts in TeX font paths. This is also encouraged now by emitting warnings for access of files with absolute paths (#8) which also uncovered #8 for people who didn't notice before, because they just installed the fonts to their system, when Tectonic was unable to find them in the bundles. Not using fontconfig would also allow us to (in theory) to get rid of a C dependency. But realistically we would need to allow people to use system fonts - perhaps with something like a However I think we still should allow font file names to be used and make things mostly "just work". A lot of fonts are included on CTAN and hence in Tectonic bundles. If, while generating the bundle, we can construct a mapping of font names to font file names, then we could put such mapping into the bundle (with a known unconflicting name, like |
I think that I've written about this issue before, but I don't quite remember where. I believe that the best approach would basically the idea mentioned by @vlasakm, of having a per-bundle magic file named something like A related issue is that I would love to replace the gnarly multi-platform font-loading C++ code from XeTeX with a more nicely designed Rust version. I think that it could probably be made a lot cleaner and easier to extend with this sort of functionality, and it might not even be that hard. |
Tectonic cannot find fonts when they are referenced by name. Referencing directly by filename works.
My first guess was that fontspec searches the system font cache when referencing fonts by name, and thus fails to find fonts in bundles. This doesn't seem to be the case, though: plain
latexmk -xetex
compiles both versions below perfectly well, even though I don't have the TeXlive fonts in my system font cache.Using
setmainfont
by name is discouraged, but I've found that some packages in TeXlive (fithesis4
, for example) use it anyway.This bug is tangentially related to tectonic-typesetting/tectonic-texlive-bundles#15, since many conflicts are caused by font
.map
and.enc
files.The text was updated successfully, but these errors were encountered: