Custom Fonts not loaded, default font loaded
See original GitHub issueI have defined the default font which loads fine:
CalligraphyConfig.initDefault("fonts/Roboto-Regular.ttf", R.attr.fontPath);
and also:
@Override
protected void attachBaseContext(Context newBase) {
super.attachBaseContext(new CalligraphyContextWrapper(newBase));
}
This works fine. The Roboto-Regular font is then applied.
I am then trying to set a custom font to a TextView, however it doesn’t get loaded:
<TextView
android:id="@+id/titleDrawer"
android:layout_width="match_parent"
android:layout_height="wrap_content"
fontPath="fonts/Roboto-LightItalic.ttf"
android:textColor="@color/white"
android:textSize="18sp"
/>
No build issues or comments in the log.
What’s strange is, I looked at my app before and the custom font was loaded. I didn’t change any code, went to rebuild my app and now the custom fonts have gone. Not really sure what’s happening here!
Issue Analytics
- State:
- Created 9 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
How To Load and Use Custom Fonts with CSS | DigitalOcean
You can use the @font-face rule to load a custom font on a web page. The history of loading custom fonts has lead...
Read more >A New Way To Reduce Font Loading Impact: CSS Font ...
Web fonts are often terrible for web performance and none of the font loading strategies are particularly effective to address that.
Read more >Custom font not loading in CSS font-face - Stack Overflow
So I have a production project in laravel. The problem I'm facing is when I upload custom font to ...
Read more >How to load web fonts to avoid performance issues and speed ...
If text is still not ready, it will use a system font until the custom font is ready. Safari hides text until the...
Read more >The Best Font Loading Strategies and How to Execute Them
We only show the text when web fonts are loaded. FOUT means flash of unstyled text. When web fonts are loading, we show...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Closing. If you still have an issue please re-open, thanks.
@greghesp Did you manage to get this working?