Some fonts causes load error "already has key" with Safari
See original GitHub issueLoading MuseoSans300Italic.otf or BrandonText_Medium.otf causes the
entriesToObject
method to crash.
Current Behavior
entriesToObject, in Safari seems to fail if it gets an entries list with numbered keys out of order. Eg.
entries =
[
[0, [380]],
[1, [647]],
[1200, [648]],
[2, [649]]
]
will crash when trying to add key = 2 (last in array). It seems like Safari has an error that when adding o[1200]= [648], it also adds o[2] = NaN. This causes o.hasOwnProperty(key) to trigger an error.
Possible Solution
Is the o.hasOwnProperty(key)
test necessary? Can it be expanded to do o.hasOwnProperty(key) && !isNaN(o[key])
?
Both work for the font I’ve encountered problems with.
Your Environment
- Version used: 0.6.9
- Font used: MuseoSans300Italic.otf, BrandonText_Medium.otf
- Browser Name and version: Safari 10.1
- Operating System and version (desktop or mobile): Macos 10.12.4
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Safari fonts messed up - Apple Community
A while ago I changed something about Safari that caused displayed fonts to get all messed up. Now I want to reset it...
Read more >How to fix font problems on your Mac that can make Safari and ...
Open Font Book, click on All Fonts, then click on any of them in the list and press Command-A to Select All. Then...
Read more >[troika-three-text] IOS Safari Loading Issues #88 - GitHub
Anyways I've recently put this on a site I'm still working on and noticed some inconsistencies on mobile. Sometimes everything would load but...
Read more >Fix font size issue on Mobile Safari (iPhone) where text is ...
1) Visit http://www.panabee.com. 2) Conduct a search for a domain name. The boxes on the left side show the incorrect font sizes.
Read more >Troubleshooting Connect Fonts for Safari Extension - Extensis
Make sure Connect Fonts for Safari Has Been Enabled in the Browser Itself · In Safari, navigate to Safari>Preferences>Websites · In the Extensions ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m also seeing this issue in Safari using Regina Black. It seems to be happening when calling
opentype.load
twice on the same font (though I’ve only seen it happen with this one font). @casperno’s proposed fix works for me.Edit: I submitted a preemptive PR in case you decide this is an acceptable solution.
I was on holiday in the last weeks. I just fixed this, and release 0.7.3, which contains the fix, should appear on npm soon.