chrisjenx / Calligraphy

Custom fonts in Android the easy way...
Apache License 2.0
8.59k stars 1.1k forks source link

Load from font resource directory? #431

Closed kassim closed 5 years ago

kassim commented 6 years ago

Is this possible with Calligraphy?

I want to use the native font support but don't want to refactor all my old code that I've been using Calligraphy with. Is it possible for me to move the font files to the res/font folder and somehow have them still loaded by Calligraphy?

chrisjenx commented 5 years ago

resources don't allow that kind of file, they would be "raw" files a best, but no, they shouldn't live in resources, they are assets.

kassim commented 5 years ago

resources do allow that kind of file https://developer.android.com/guide/topics/resources/font-resource - specifically in the res/font folder

or you meant something else?

chrisjenx commented 5 years ago

They were added in Android 8.0 (API level 26), if your min version is 26+ then I would 100% use that instead of Calligraphy as thats offically supported. Otherwise older versions just don't read it.