-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add fallback support to local ideograph font families #15255
Conversation
While running on Android Q beta 4, I'm seeing:
this means that this reflection call is greylisted as is allowed for the time being. Probably because there isn't any other way of checking font avallability outside of the downloadable fonts in https://developers.google.com/fonts/docs/android which requires min api 16 when using the appcompat variant. Long term we will be switching to that setup instead. |
5cd9e17
to
d5ef1c9
Compare
On request from @LukasPaczos also verified that this solution works with https://developer.android.com/guide/topics/ui/look-and-feel/downloadable-fonts |
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.
Looks good, thanks for running additional tests 👍
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/FontUtils.java
Outdated
Show resolved
Hide resolved
platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/utils/FontUtils.java
Outdated
Show resolved
Hide resolved
...orm/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/maps/MapboxMapOptions.java
Show resolved
Hide resolved
d5ef1c9
to
719e3f3
Compare
...ndroid/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/snapshotter/MapSnapshotter.java
Outdated
Show resolved
Hide resolved
719e3f3
to
451c98f
Compare
…w setting a collection of fonts
451c98f
to
0c7223a
Compare
Hi! Do we have any update on this? I would like to know if and how I can use local fonts on my symbol layers. Thanks! |
Hey @EBiCS, thanks for using Mapbox! This PR references local ideographs generation, which means that the SDK will not download CJK glyphs but rather generate them locally. If you'd like to use a certain font, it has to be declared in your style using Mapbox Studio. |
This PR matches logic from #14862 and makes #15225 obsolete. Proposed change allows developers to pass in a array of string for localideographfamily and we will check if we can find a valid font and pass that to core. If not, fallback on
sans-serif
.Note: I'm currently not satisfied with taken approach, it uses reflection to lookup valid fonts from
TypeFace
. Sadly, there isn't an API on the Android SDK to do this cleanly. LMK if you are aware of any.