You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently this feature is implemented naively in createTextStyle.
I think it might be interesting to expand on this feature by:
Detecting monospaced fonts
Detecting emoji/icon fonts
This could be done possibly by either checking the name (e.g. is font family ui-monospace, Consolas, ...`), actually analyzing the font's glyphs/code points programmatically or rendering it to see if it displays correctly. Fallback: Don't replace font.
It's not sustainable to hardcode a list of monospaced fonts for every broken site and keep that up-to-date.
Sometimes it's also non-trivial to match code blocks using CSS or HTML directly, so we need to use globs/wildcards and that's not trivial. Not overriding the font in the first place for an element that should be excluded would be ideal.
The text was updated successfully, but these errors were encountered:
Currently there are multiple inherent issues with replacing the font globally:
Currently this feature is implemented naively in
createTextStyle
.I think it might be interesting to expand on this feature by:
This could be done possibly by either checking the name (e.g. is font family
ui-monospace
,Consolas
, ...`), actually analyzing the font's glyphs/code points programmatically or rendering it to see if it displays correctly. Fallback: Don't replace font.This would allow to offer a much more granular control over font replacement, for example based on the standard CSS font-family aliases
ui-*
,emoji
,math
, etc.Example: Chromium font selection
Why not fix inside dynamic theme fixes?
It's not sustainable to hardcode a list of monospaced fonts for every broken site and keep that up-to-date.
Sometimes it's also non-trivial to match code blocks using CSS or HTML directly, so we need to use globs/wildcards and that's not trivial. Not overriding the font in the first place for an element that should be excluded would be ideal.
The text was updated successfully, but these errors were encountered: