Bug 174031

Summary: Safari always assumes mono-spaced square characters when loading fonts
Product: WebKit Reporter: Dima Voytenko <dvoytenko>
Component: CSSAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: mmaxfield, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 10   
Hardware: All   
OS: All   

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!