-
Notifications
You must be signed in to change notification settings - Fork 349
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
typst: generic font families / font stack names #11918
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some minor comments, but LGTM.
src/command/render/pandoc.ts
Outdated
@@ -1513,6 +1514,9 @@ async function resolveExtras( | |||
} | |||
fontdirs.add(font_cache); | |||
} | |||
const srcDir = Deno.env.get("QUARTO_SRC_PATH") || | |||
join(quartoConfig.sharePath(), "../../src"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We use Deno.env.get("QUARTO_SRC_PATH") || join(quartoConfig.sharePath(), "../../src")
in a few different places in our codebase. I wonder if we should be adding a srcPath()
to quartoConfig
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've implemented quartoConfig.srcPath()
in a separate commit on this PR. (I only found one other use?)
1d7b76a
to
f9f0bea
Compare
@cscheid, my only remaining reservation about this PR is that Noto Sans takes up 44MB of disk space. This is because it's is a non-variable font, which is what we currently need for Typst, and it has almost 80 variants (and lots of glyphs, being international). What do you think? |
9bcb6df
to
778cd2d
Compare
this is a minimal implementation using Noto Sans as the sans-serif font and the built-in Typst fonts for serif, math, monospace each has a synonym, e.g. ui-sans-serif other generic font families could be added and we could ship fonts to replace the built-in Typst fonts fixes #11683 "big numbers" i can't figure out a way to automate this test but we should have it for visual testing
778cd2d
to
0140417
Compare
Yikes. Thanks for catching that, and I agree it's bad. I don't think a 33% installation size increase is worth it, unless every other alternative is similarly large. Could you get an estimate of those sizes? |
We need to use the static version of a font because of typst/typst#185 not supporting variable fonts. Each font has 54-72 variants. Noto Sans is 44MB |
This is a minimal implementation of generic font families for Typst, using Noto Sans as the
sans-serif
font and the built-in Typst fonts forserif
,math
,monospace
.Each has a synonym, e.g.
ui-sans-serif
Other generic font families (or font stack names) could be added in the future, and we could ship fonts to replace the built-in Typst fonts.
Fixes #11683 "big numbers" in gt. I can't figure out a way to automate this test but at least we have a visual test.