I have made an Android library that contains visual components. This components style must be customizable by the main hosting application via resources files.
In order to let the font family customizable I have defined a string
<string name="customizableFontFamily" translatable="false">sans-serif</string>
Which is used in the main theme style:
<style name="MyMainTheme" parent="Theme.AppCompat.Light.NoActionBar">
<item name="android:fontFamily">@string/customizableFontFamily</item>
This works fine when using the basic Android fonts (casual, monospace, sans-serif, etc). However, if the user wants to define a custom font it does not work since it has to point to a reference:
<string name="customizableFontFamily" translatable="false">@font/myFont</string>
Is there any way to accomplish this?