Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

Default to system font in attribution titles #7725

Merged
merged 1 commit into from
Jan 15, 2017

Conversation

1ec5
Copy link
Contributor

@1ec5 1ec5 commented Jan 14, 2017

The inline stylesheet used when converting an attribution HTML string to an attributed string now specifies the system font as the default font. It still isn’t clear to me why macosapp has been defaulting to the system font, but it makes sense to me that the default default font would be Times without this change. This change makes use of WebKit’s proprietary -apple-system keyword, which Apple recommends for this purpose.

There is still a slight difference between macosapp and an application outside macos.xcworkspace, but I think the two results are close enough:

fonts

Fixes #7722.

/cc @frederoni @friedbunny

@1ec5 1ec5 added bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS release blocker Blocks the next final release runtime styling labels Jan 14, 2017
@1ec5 1ec5 added this to the macos-v0.3.0 milestone Jan 14, 2017
@1ec5 1ec5 self-assigned this Jan 14, 2017
@1ec5 1ec5 requested a review from frederoni January 14, 2017 19:16
@1ec5
Copy link
Contributor Author

1ec5 commented Jan 14, 2017

This issue is tagged as a release blocker because it’s a highly visible regression on macOS compared to v0.2.1. It is not a release blocker on iOS, as it affects iOS only to the extent that a developer would try to display an MGLAttributionInfo title as rich text. The attribution sheet is unaffected because it displays each title as plain text. Even so, I’d like to land this change in time for macOS SDK v0.3.0, which means it’ll be in iOS SDK v3.4.0 as well.

@friedbunny
Copy link
Contributor

The WebKit blog says -apple-system is supported from OS X 10.11 (and iOS 9, incidentally). We support back to 10.10, so I think it’d make sense to also add "Helvetica Neue" to this rule, the previous system font.

The only question I would then have is if OS X 10.10 still used Helvetica Neue at small sizes...

@1ec5
Copy link
Contributor Author

1ec5 commented Jan 14, 2017

The only question I would then have is if OS X 10.10 still used Helvetica Neue at small sizes...

Yes, Lucida Grande was supplanted by Helvetica Neue at all three control sizes.

@1ec5 1ec5 force-pushed the 1ec5-attribution-font-times-7722 branch from 6102d60 to 15caf0f Compare January 14, 2017 22:46
@1ec5
Copy link
Contributor Author

1ec5 commented Jan 14, 2017

Support for the -apple-system keyword was introduced in WebKit/WebKit@a03afe2 for bug 144707, which made it into iOS 9 and OS X 10.11. But the same functionality was actually available earlier via the identical -apple-system-font keyword, upstreamed from iOS in WebKit/WebKit@b8ade58 for bug 126654 (which would’ve made it into iOS 8) and introduced to OS X in WebKit/WebKit@989ba14 for bug 133382 (which made it into Safari 538.1 and thus OS X 10.10). Therefore I’ve added -apple-system-font as a fallback. I also added sans-serif to at least ensure something reasonably close to Helvetica Neue on iOS 7.

Additionally, on macOS, I set font: -webkit-mini-control to apply a font identical to what macosapp displays:

font

@1ec5 1ec5 requested a review from friedbunny January 14, 2017 22:49
@friedbunny
Copy link
Contributor

@1ec5 You’re absolutely correct — the blog piece I cited doesn’t actually say when -apple-system became available, just that you could use San Francisco via that keyword in OS X 10.11 and iOS 9. 🙇

@1ec5 1ec5 merged commit 15caf0f into release-ios-v3.4.0 Jan 15, 2017
@1ec5 1ec5 deleted the 1ec5-attribution-font-times-7722 branch January 15, 2017 03:36
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug iOS Mapbox Maps SDK for iOS macOS Mapbox Maps SDK for macOS release blocker Blocks the next final release runtime styling
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants