-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Custom font doesn't work with Text component #7
Comments
It's should, did you link the font into your app ? If you change the name now the text is like the one you use before |
The font is already linked when I use |
If possible may I see your code for this? I use this lib for like 7+ projects with custom fonts and work. Just to make sure. |
import { Text } from 'react-native-design-utility';
// I tested with this 2 ways
<Text font="Lato-Black">Some text</Text>
// and
<Text style={{fontFamily: "Lato-Black"}}>Some text</Text> |
Ha ok the issue is the font here need to match the theme. So you can example add this font to the base or example Lato. And now you can do font=“Lato” |
so your theme should have {
font: {
lato: 'Lato-Black',
base: 'Roboto'
}
}
<Text font="lato">Hello world</Text> |
The same, It does not work |
I am having the same issues with @andydev404 , The custom font isn't working properly on Android, but works well on iOS. Following the example you displayed above, if I add the bold or normal props to the text component, the text returns back to the default Android font |
I got it fixed. After you initialize a theme via npx react-native-design-utility init, remove the weight object on line 56, and everything would work properly |
@EQuimper it doesn't work for me, I have everything right and inspecting the text, I can see that there is no This is my theme config:
And I'm using like this:
I've tried not passing the font prop, tried passing |
As a User when I implement a custom font (Lato, Roboto, Poppins, etc.), the font is no taking effect on the Text component
The text was updated successfully, but these errors were encountered: