I have an OpenGL renderer that uses FreeType to render text. I would like to be able to use system fonts packaged with Android. There is a way on iOS to get the ttf font data for system fonts (see accepted answer here: On iOS, can I access the system-provided font's TTF file). Is there something equivalent on Android? Is there an API for getting the source file for a system font based on the font name, ideally without having to do any guesswork about where certain system files are stored?
Asked
Active
Viewed 430 times
0
-
[This answer](https://stackoverflow.com/a/10751193/6759241) may help. – greeble31 Aug 09 '19 at 18:20
-
@greeble31 thank you, that's an interesting link. It looks like what they're doing is rendering the glyphs themselves. I would prefer to use FreeType for that by handing it the TTF/OTF data though. – sweatervest Aug 12 '19 at 16:43
-
Why guess? All fonts on Android are located in `/system/fonts`, which is not particularly hard to discover with some web searching? – Mike 'Pomax' Kamermans Aug 18 '19 at 01:35
-
I did a lot of web searching and saw some comments that not all Android devices store them there, and if that ever changes in the future that method breaks. Thanks anyways. – sweatervest Aug 19 '19 at 02:55
-
Sure, and then that change will be documented and you can update your application accordingly, but that's hardly something to worry about today. – Mike 'Pomax' Kamermans Aug 21 '19 at 19:30
-
I don’t agree and I don’t consider that an acceptable solution. – sweatervest Aug 22 '19 at 20:37