-
Notifications
You must be signed in to change notification settings - Fork 29k
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
Fonts: consider to set font-display: block
#131396
Comments
I prefer not showing anything than the current empty squares which look like rendering glitches and are disturbing. |
Makes sense to me. I'll make the change. |
@bpasero Thanks for the research! |
Thanks! Yeah I cheated in my demo: I added code to specifically slow down the loading of |
I just noticed how file icons where still suffering from this and realised that
Needs to move, I guess into here:
|
Oh, yes, my bad. I'll make a PR. |
@aeschli I'll update this in the main codicons repo as well https://github.com/microsoft/vscode-codicons/blob/main/src/template/styles.hbs |
I found the perfect opportunity to verify this issue: I had Electron build in the background. |
As far as I know, we use custom fonts in 3 areas:
I often see the workbench appear similar to this because fonts were not loaded yet and the browser fallsback to a standard font that doesn't include the used characters, as such glyphs appear:
With
font-display: block
the browser will not use any fallback and will simply refuse to show the font until loaded (for up to 3s I think):More info on the available choices are in this great article:
(credits: https://sia.codes/posts/making-google-fonts-faster/)
The following locations in code are imho impacted:
productIconThemeData.ts
fileIconThemeData
iconStyleSheet.ts
contextView.ts
codicon.css
I realise that this might be a controversal change, so maybe alternatives can be discussed here as well. One alternative would be to try to load the fonts in parallel to the workbench loading to prevent the flicker alltogether,
The text was updated successfully, but these errors were encountered: