I have recently added a custom font to my Android project in Android Studio (following these instructions). This is not a regular font to show text but a custom font containing a large number of icons which are used all over my app.
This works fine. However now some users reported the problem, that on their devices only some icons can be used, while many other icons are shown as characters instead. All users have in common, that they have configured a custom font/theme in their device settings which seems override the app styles. Thus instead of my icon font the app now uses the device font which of course does not include my custom icons...
As far as I found out this option is not a native Android feature but is implemented independently by different devices manufactures. Since I have no such a device, I cannot reproduce or test this problem.
Is there any way to skip these device settings and force the app use my custom font?
EDIT:
This is how I added the custom font to my project:
- Created a new fonts folder in
res/
and put my font files there - Use
android:fontFamily="@font/my_custom_font"
onTextView
s, etc. - done
This is then overwritten by the system settings on some devices (e.g. by the Huawei Design Manager). Can this be avoided?