-
-
Notifications
You must be signed in to change notification settings - Fork 217
feat: custom font family configuration #148
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
Conversation
|
@alerque I coincidentally stumbled across your comment against the integration of Google Fonts in Typst. Since the use case via HTML is a bit different here and the font is not downloaded directly by the compiler but rather delegated to the browser, I would say this doesn't imply any security or privacy concerns. Do you agree? |
|
Typst actually has a security model and a goal of being able to run on untrusted content without leaving a gaping security hole (including data exfiltration). As far as I can tell Quarkdown is not even remotely close to anything of the kind and there are several layers that are completely "compromised". You're reliant on a headless Chromium instance anyway, and even the browser sandboxing is compromised since it is being fed local supposedly trusted content. I don't think denying remote font loading would be anything more than a bandaid on a femoral artery bleed in either the privacy or security departments. |
This PR introduces the capability to override the default font families.
Font configuration can be applied via
.fontthrough itsmain,headingandcodeparameters.A font can be loaded from any of the following sources:
path/to/font.ttf)https://example.com/font.ttf)Arial,Times New Roman)GoogleFonts:Roboto).Font resources are processed by the media storage.
This means, for instance, HTML output will carry local fonts into the output directory for increased portability.
As for security concerns, the compiler won't interact with remote fonts, but rather just let them go through until the post-processor can bundle them into the final output. This means a font loaded from Google Fonts or a remote URL will be fetched remotely at runtime by the browser, as long as the media storage system is turned off for remote resources (which is the case for the HTML target).