-
-
Notifications
You must be signed in to change notification settings - Fork 815
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
More control over typst compilation environment #3892
Comments
Thank you for considering my request! |
In general this is a great goal, total control of the inputs and reproducibility of the outputs is fantastic. Just a nit though, for usability's sake the easiest to reach for options don't necessarily have to have this goal in mind. Specifically fonts, I think most people will want the fonts option to be additive to the system default, so a specific extra option to only use directly specified locations might be called for. |
I know this is fresh, but I want to add a simple motivating example: In preparation for releasing subpar, I added tests which, unknowingly to me, used font fallback (which is fine) to a system font (which was not fine). Being only caught in CI, where no font was missing, took me a while to debug. If I could remove all system fonts and only used built ins, then I would've noticed the lack of CJK glyphs in my test locally already. |
Not using system fonts is helpful for controlling the final result. Most of my projects currently have a dedicated font folder in the project directory. I think it would be useful to have an option to completely disable system font search. Maybe a CLI option, like |
Sounds like an idea, I think an env var for this wouldn't be very appropriate |
Working on this by the way 🙂 (Sorry to other interested contributors for not mentioning this very explicitly earlier - that was why I was assigned) |
Description
To improve reproducibility across systems compiling a Typst document, it would be beneficial to have complete control over the parts of the compilation environment which are implicitly used.
The following things are implicitly taken and not part of inputs of the typst binary:
$TYPST_FONTS
+ system fonts$XDG_DATA_HOME
$HOME/.local/share/typst
$XDG_CACHE_HOME
$HOME/.cache/typst
TYPST_FONTS
is currently additive, there is no way to configured Typst to not include system fonts to my knowledge. It would be great if this was not additive, but an absolute configuration of how to retrieve fonts, allowing the user to simply append the system directories if needed.Setting
XDG_DATA_DIR
/XDG_CACHE_DIR
can have side effects on other programs run in the same context as Typst. While they are good fallbacks, there should be a first-classTYPST_*
environment variable for the respective package cache and package data directories which is considered first before fallback to the respective$XDG_*/typst
occurs.During discussion about this in the Typst community discord, it was suggested that these should, similar to other options, also be optional compiler flags.
Use Case
This aids in isolating the effect of environment variables on the rest of the system and helps reproducibility by removing implicit assumptions on the compilation environment.
The text was updated successfully, but these errors were encountered: