Repository navigation
Change default font to Libertinus Serif - #4969
Conversation
|
I assume you're working with Libertinus 7.040? There are a few minor updates (e.g. I_J kerning for Dutch locales) since the last tagged release. If desired I could look into cutting a new release with that in place before this work merges just so the loop is as closed as it can be. |
|
That would be great! I indeed used the latest released the version. |
|
After a few years without a release there were some problems with the font tooling (changes in python-fonttools meant it wouldn't build against current versions) but I think I've got that worked out so I could cut a release at any time. That being said there are a couple PRs that look valuable and may be ready to go it, but it is 3 am and I can't do more tonight. What's your timeline on this? Should I cut a release so you can start testing it or do I have a couple days to review PRs and make a release with any of the pending contributions that seem ready for production? |
|
A few days are no problem. I've got some other stuff to do as well. I just wanted to get the ball rolling here and potentially get some feedback on the unresolved questions. Thanks for being so considerate of our timeline! |
Bundle all available weights.
I would keep Libertine for 0.12 and emit a compiler hint when the font is explicitly set. Then drop it for the next release. |
Some people might have Linux Libertine installed and if they want to use it, who am I to stop them. So a blanket warning seems problematic. That's why I think adding a hint to the "unknown font family" warning specifically for Linux Libertine is better, but it means removing the font now. |
Wouldn't warning when it is not explicitly set make more sense? In any case some transition time where both fonts are available so that people have a low friction way not to reflow anything is likely to be appreciated by a few folks. Even if Libertinus Serif is better in every way (of course I think it is) there are some differences in metrics to some glyphs that will cause many documents to reflow. For most people it probably won't matter at all, but there is bound to be a few documents where people are committed to exact metrics that do matter. |
Then, it would warn on almost every document, with no good way to get rid of the warning. I think that's rather something that should just be stated prominently in the changelog. My proposal was to warn only when it's explicitly set and not available on the system. The most likely cause of that situation is someone hardcoding the default font for some reason (maybe they needed to go back to the default within an equation) and they should likely update it to the new default. We can also keep bundling it for another version, but then I see no opportunity for a warning that doesn't trigger on pretty much everything. |
We've tuned hyphenation costs (to get rid of over-eager hyphenation), so 0.12 will probably reflow lots of documents anyway... And there are a few other breaking changes. |
Are you concerned about additional binary size, or just a plain question? I personally only use normal/bold/italic/bold+italic 99.9% of the time. I almost never had to tweak the weight parameter. But I think it's a safe bet that some people would do that, and therefore it's better to pack all variants in, than have an incomplete bundle which can lead to issues like "add x variant to the default font".
To be on the safe side, yeah. One (minor) version is probably enough?
I think this is the same question as the above, so yes, I think we should. Hard breaking changes (with no deprecations) is probably never nice to see as a user.
If it was explicitly set and is present on the system (if you can differentiate between system and built-in fonts), then I guess it's fine. If however the font is not present on the system, then a warning/hint should definitely be added ("the default font has changed, the old one is deprecated, and it's not found on the system, consider installing or changing to the new font", something like that). Either way, a warning in the changelog (or somewhere else as well?) should be enough for those who care (which font is the default one). |
|
I really don't see the point of a migration period. There are already breaking changes in 0.12, and the font is almost identical to the one we're already using. I'd wager the vast majority won't even notice that the font changed. |
|
Should we also bundle Libertinus Math? |
I don't think there's any plan to change the default math font. |
|
I know there’s no plan, that’s why I’m suggesting it. Linux Libertine doesn’t have a math font so it’s understandable that the team went for New CM; but Libertinus does, and this would be a good opportunity to make the default look more consistent. |
I don't think the math font works well enough in typst to be a default. See for instance #2860 It also has way fewer (less than half) symbols than the most complete fonts (e.g. ncm and stix two) This could of course change in the future. |
|
@laurmaedje Is the prior perceived need for a TTF variant resolved? (I have handled all outstanding PRs for Libertinus and am tinkering with release tooling). I can build TTFs with a one line config change, but I can't vouch for how good they would be. We've been releasing OTF only for a while and we know those builds are pretty robust, but any TTF builds I put out wouldn't have had much exercise. They could be hinted with |
|
I just shipped Libertinus v7.050. It's already deployed to all Arch Linux users via otf-libertinus and Homebrew users via Homebrew Cask and I've submitted bumps for Fedora and CTAN. The latter haven't landed yet but CTAN at least usually does so within a few hours. I'm going to bed now but if the issue tracker hasn't exploded in the next day or so then the OTF release at least should be good to go. |
|
Sounds great, thank you! There is no need for TTF anymore, the printer issues and suboptimal subsetting are fixed thanks to @LaurenzV. |
|
c.f. typst/typst-assets#3 |
|
What about bundling Libertinus Sans? Currently the only option for a sans-serif default that should work everywhere is to use the mono font. Having another option would be nice for slide themes and many other documents (for example popular styles like KOMA-Script use sans serif for titles). Maybe another sans serif font would be better though... |
|
A template opinionated enough to want a sans serif font will probably want a specific one, and not just the one type would hypothetically provide. Starting to bundle a ton of fonts feels like a mistake. |
|
Sure, but bundling one sans serif font could be a good middle-ground between "just one text font" and "a ton of fonts". Mixing a serif and a sans-serif font is a common technique to make a design more dynamic. The contrast is often more important than the precise choice of font. Even opinionated templates could use a standard sans-serif as fallback that works everywhere. For example, I'm working on some slide themes that use a two-font design. What should I use as fallback that looks OK if not great? Will it still make clear what part is in what font in case the user wants to change one font? |
|
The point of the built-in fonts wasn't really to ship a sensible base collection of fonts. It was to ship exactly the fonts Typst uses by default for text, math, and code, such that the defaults work out of the box. I agree that we have a problem with reproducibility and fonts (it's being discussed at various times in the #Fonts forge on discord), but I think the solution isn't to bundle more fonts, but rather to find a proper way to distribute a larger collection of fonts. |
#import "@font/fira-code-nerd-font"
#show raw: set text(font: "Fira Code Nerd Font") |
|
@laurmaedje OK that makes sense. |
b6a5b8b to
3abe8eb
Compare
|
Closes #1257.
While we could have kept Linux Libertine for the test suite, I prefer testing with the real default font. This updates ~800 reference images. This doesn't make me particularly happy, but the repository bloat shouldn't be much more than 2MB due to the work done so far in keeping reference images small.
Unresolved questions:
Todo: