![]() ![]() You may also have to add an entry to res/layout/values/preloaded_fonts.xml: reference it with the same changes will be generated if you add the font via selecting the weight in the Layout Editor, but I find it easier to just duplicate the font resource and edit the fontProviderQuery. You can fix it by creating a font resource for each weight you want to use. Maybe it doesn't prompt the app to actually download the font for that weight? I ran into the same thing-I'm not sure textFontWeight works correctly with downloadable fonts. Res/values/styles.xml hope the examples are helpful for someone else This is an example of how we apply it to TextView styles: Preloaded_fonts.xml: you tried this answer? We have implemented it with Inter Google Font and it worked well, displaying the right weights.Īll ttf files for Inter font are placed in res/font aswell. Files named both for iOS and android as Ubuntu-L.ttf. Of course, that also depends on whether or not your specific font HAS different weights. ![]() The color of the font and size changes according to the style I have defined but the bold effect is not registered. Regular weight is just ok - we are able to use fontFamily: 'Ubuntu' in app, but for light weight (100) we faced a problem. The font has changed but the font weight property does not seem to be work.Īs you can see, I have tried it in several ways but none have been successful yet. I was following this official guide and wanted to use Poppins font for my project. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |