InflationX / Calligraphy

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

Add Support for Google Downloadable Fonts? #57

Open ashiqursuperfly opened 3 years ago

ashiqursuperfly commented 3 years ago

Been using calligraphy for a while now. However, theres an issue i would like to share. The only way to use calligraphy is via including your own .ttf files. (afaik ;_; correct me if im wrong) Since, .ttf files can get large for most fonts, they contribute heavily to the overall app size. Therefore, Google downloadable fonts are a much light weight alternative for custom fonts in android now.

It would be great if we could set a google downloadable font as the calligraphy global font. I dont know if this is possible in the current implementation (if at all) but will really appreciate this feature.

chrisjenx commented 3 years ago

Probably unlikely as that would mean we would have to include something like OkHttp in the project and we try to keep things lightweight.

Pitel commented 10 months ago

What might be enough is to provide a way to set the Typeface object for the font, and not just the static path. Because the result of getting the downloadable font is the Typeface.

chrisjenx commented 10 months ago

True, I don't really have time look right now. But between ViewPump and Calligraphy should be possible, happy to look and shape up PR's if you have time to submit one