Bug 174031 - Safari always assumes mono-spaced square characters when loading fonts
Summary: Safari always assumes mono-spaced square characters when loading fonts
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: CSS (show other bugs)
Version: Safari 10
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2017-06-30 11:12 PDT by Dima Voytenko
Modified: 2017-07-05 18:09 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Dima Voytenko 2017-06-30 11:12:29 PDT
See example: http://output.jsbin.com/jexixam/quiet

Initially, before the "Slow" font-face has been loaded or timed out, the sample text takes about 2.5-3x more space to layout (on iOS, it takes about 8-9 lines and once the font is loaded/timed out, it takes only 3 lines). In other words, the estimate is too rough.

It appears that Safari assumes mono-wide square characters, which is very uncommon. It might be a better option to use a fallback font to estimate character layout before the desired font is loaded (as in `font-family: Slow, Arial` where "Arial" is already available as the fallback). This would also reduce the work the browser has to do in case of timeout.
Comment 1 Radar WebKit Bug Importer 2017-06-30 13:17:35 PDT
<rdar://problem/33083545>
Comment 2 Myles C. Maxfield 2017-07-05 14:57:00 PDT
I think I fixed this in r216944. Can you see if the problem still reproduces on a nightly build?
Comment 3 Dima Voytenko 2017-07-05 18:09:22 PDT
Does appear to be fixed in nightly. Thanks for the fix!