-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Don't force downloading of Open Sans fonts #11055
Conversation
When a SymbolLayer doesn't have a text-font defined, we automatically add Open Sans/Arial Unicode MS. However, when the SymbolLayer is only used for rendering icons, it doesn't have text-field defined either. In those cases, we still force downloading Open Sans/Arial Unicode MS during offline pack creation. If the user doesn't use this font, this change should save ~15MB and a few seconds in download time.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This could break apps that have styles without font-stack
and font-text
property but use the runtime APIs to add symbol layers.
Would be good to add a note to the [Offline Maps] (https://www.mapbox.com/help/mobile-offline/) documentation.
This is correct, however, using runtime-styling with offline downloads is a slipperly slope anyway; e.g. you can also use any other kind of font that isn't available offline. However, this PR does change the behavior to the default font not being available offline by default. |
This ended up being part of the confusion in: #12167 (comment) |
When a
SymbolLayer
doesn't have atext-font
defined, we automatically add Open Sans/Arial Unicode MS. However, when theSymbolLayer
is only used for rendering icons, it doesn't havetext-field
defined either. In those cases, we still force downloading Open Sans/Arial Unicode MS during offline pack creation. If the user doesn't use this font, this change should save ~15MB and a few seconds in download time.