chrisjenx / Calligraphy

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

Adds A Config Option To Provide a FontPath Substitution Map #399

Open thorbenprimke opened 7 years ago

thorbenprimke commented 7 years ago

Summary: In order to A/B test fonts, this adds an option to the CalligraphyConfig to provide a fontPath substitution map. This enables dynamically changing fonts at run time and requires no changes to XML files. The logic to substitute the fontPath is in the TypefaceUtils. The reason the map is set on the TypeFaceUtils class instead of the TypefaceUtils checking the CalligraphyConfig is that this way it doesn't require constant invocations of CalligraphyConfig.get().

Test Plan: