LiveSplitOne icon indicating copy to clipboard operation
LiveSplitOne copied to clipboard

Fonts aren't always monospace on Chromium

Open CryZe opened this issue 1 year ago • 0 comments

There unfortunately is no way to force the fonts to use tabular-nums at the moment. So we instead emulate it by turning off font kerning and manually placing each digit. This is fine, but also slow. When font kerning is off and all digits are the same width, that's usually a good indicator that you don't actually need to emulate anything. You can consider the font to already be monospace. So that's something we try to detect. However there is a bug in Chromium where telling the browser to turn off font kerning doesn't actually work sometimes. So on fonts like Segoe Print there is an interesting edge case where all digits technically are the same width, but the font has kerning support that places .1 closer together than .2. So in this case all digits seem to have the same width, so we don't try to do any monospace emulation, but kerning is still active and the entire thing breaks. Considering this is actually a Chromium bug, I opened an issue upstream:

https://issues.chromium.org/issues/338965374

CryZe avatar May 06 '24 15:05 CryZe