Repository navigation
Add warning when using fallback font - #3352
Enter-tainer wants to merge 4 commits into
Conversation
af8ac15 to
47c35aa
Compare
|
🤔 seems that test runner is not happy with new warnings. Any idea to fix this? |
|
Some disorganized thoughts and observations:
|
Agree. It's missing. It would be better if this can also trigger the warning. But it seems that the usage of that list is somehow scattered everywhere in the code, so I didn't change it. Currently it can only produce warning when all the list is used up, like inputting Chinese characters without setting other fonts. I can move the code which add the well-known list into consideration to
idk either. I feel awkward when adding
Yes. We should provide a way to silent warnings. And warnings should be enabled by default.
It's hard. I think we can add warning to this as long as user can suppress it. This can help user find problems with their font config.
Yes, it should be improved. |
|
I also want to note that just adding an emoji will already trigger this warning as few people will explicitly list an emoji font in the fallback chain. One might argue that this is reasonable behaviour for a typesetting system, but at the same time it feels like bad ergonomics. |
Would it make sense for there to be a compiler flag for the level of warnings displayed? Personally I'd love to be inundated with warnings, but others might not want to see them at all. |
|
In general I think we could wait for warning suppression to land. I believe there isn't an issue for that, so we could open it. |
IIUC it wouldn't land in weeks or a few months. And there is a lot of design work to do. But font matching is already causing many problems. New users keep asking "doesn't typst support bold?" or "Why does typst choose X as the default Chinese font?". I think adding a warning atm would yield better UX. |
It's true that it will take a while (unless we take action now). But the alternative is to have users inadvertently stuck with warnings in their documents they can't get rid of, such as when using emoji or certain symbols, as Laurenz mentions. So, ideally, we'd use a unified system for toggleable warnings so we can add a ton of them - not just for fallback fonts. |
|
They can get rid of the warning using options: As for the "unified warning", can we simply add a warning filter arg or something like |
|
I've posted some thoughts about warning supression and spam in the discord forge. In particular, I am now of the opinion that we
|
|
currently i'm on LNY vacation. i will give a more detailed design later. |
47c35aa to
c31d834
Compare
c31d834 to
20819a0
Compare
cdc0f96 to
813b2ed
Compare
|
Someone else also started looking into this and asked a few questions, the answers to which might also be relevant here. |
|
Maybe i will close this since I have no plan continue working on this in near future |
Print a warning message when no font is selected and we are using heuristic method to select font.
This typically happens when inputing chinese characters without setting specific font.
related issue: #2818