2

Some OEM's such as Samsung's touchwiz allow the user to change the font in their phone and, hence, their apps. Is there a way to block this in my app?

Edit: As I said in the comment below, this is definitely NOT a duplicate. The question marked as possible duplicate specifies how to change the font of the entire app. It does not solve the issue of overriding a custom OEM's custom font. Not exactly sure how to properly dispute that claim.

Lv99Zubat
  • 853
  • 2
  • 10
  • 27
  • Possible duplicate of [How to set default font family for entire Android app](http://stackoverflow.com/questions/16404820/how-to-set-default-font-family-for-entire-android-app) – Mike 'Pomax' Kamermans Dec 29 '15 at 20:43
  • 3
    Definitely NOT a duplicate of that question. That question specifies how to change the font of the entire app. It does not solve the issue of overriding a custom OEM's custom font. – Lv99Zubat Jan 07 '16 at 01:58

1 Answers1

1

There are a few ways to do this.

this answer shows the proper way to do this.

this & this is a bit more involved but is more guaranteed as you ship your app with your own typeface.

Community
  • 1
  • 1
Austi01101110
  • 616
  • 4
  • 23
  • I have not had a chance to test the later two methods but the first method definitely does NOT override the OEM's custom font. – Lv99Zubat Jan 07 '16 at 01:55
  • 1
    That means that the manufacturer is basically doing what the second two methods have done, overriding the system default font with one there own typeface that they ship themselves. – Austi01101110 Jan 07 '16 at 06:02
  • hey, so the second method worked for me. Can you possibly provide a little more deeper reasoning as to how this is different than the first method? I think it has something to do with the timing of when the font is set. – Lv99Zubat Mar 03 '16 at 15:49
  • 1
    Whenever you create text, be it in a TextView or a Button ETC, the widget will use a system default font (DEFAULT,MONOSPACE,SERIF,SANS_SERIF). what the latter two methods do is they make the system default font point to a font you have provided instead of one that came with the system. This is exactly how samsung phones change the font: they make the default font(s) point to one they shipped with the phone. this way whenever a widget uses a system font it will use the one that the font pointer is pointing to (in this case yours). – Austi01101110 Mar 03 '16 at 16:29