Open borstessi opened 7 months ago
it is somehow related to the fontWeight, if i apply fontWeight 400 the font is loaded correctly
Hey @borstessi, Thanks for reporting issue. We will have a look.
Just here to report that we have the same issue. Applying fontWeight: 400
on config fixes the issue.
I have a similar issue. I am working in Android and Expo. Despite I have imported the fonts using UseFont in the expo and changed the tokens the fonts are not applied to the global theme.
import { config as defaultConfig } from "@gluestack-ui/config";
import { createConfig } from "@gluestack-ui/themed";
export const themeConfig = createConfig({
...defaultConfig,
tokens: {
...defaultConfig.tokens,
fontSizes: {
...defaultConfig.tokens.fontSizes,
newFontSize: 90,
},
fonts: {
heading: 'Futura-Bold',
body: 'Futura-Medium',
mono: 'Futura-Book',
},
colors: {
...defaultConfig.tokens.colors,
primary0: "#E5F1FB",
primary50: "#e2ebff",
primary100: "#b2c3ff",
primary200: "#809bff",
primary300: "#4e72fe",
primary400: "#204afd",
primary500: "#0b32e4",
primary600: "#0426b2",
primary700: "#001b80",
primary800: "#001871",
primary900: "#00051f",
primary950: "#000711",
brandPrimary: '#001871',
brandSecondary: '#007aff',
brandInfo: '#C0E7F7',
brandSuccess: '#4DD298',
brandDanger: '#F58BA0',
brandWarning: '#FA8202',
brandDark: '#000',
brandLight: '#a9a9a9',
}
}
});
When I do this the font is not applied,
<Text style={{ alignSelf: "center", marginTop: 500}}>Styling! :D Hooray!</Text>
The only way it works is forcing the font in each component like this.
<Text style={{fontFamily: "Futura-Bold", alignSelf: "center", marginTop: 500}}>Styling! :D Hooray!</Text>
I am using
"@gluestack-style/react": "^1.0.52",
"@gluestack-ui/config": "^1.1.16",
"@gluestack-ui/themed": "^1.1.22",
"expo": "~50.0.14",
"expo-font": "~11.10.3",
Same issue, setting fontWeight to 400 seems to fix I guess the fontWeight's don't actually do anything
Hi hi can anyone show where you add the fontweight: 400 code? I dded in my config file but the font on android still doesnt change
I am having same issue, loading any custom font from google or local. font colors/sizes does not works. any solution or bug fix?
I have the same issue, in my project I have both expo-google-fonts
and local ones: on iOS everything's ok, on Android it only works but with several issue by adding the FontResolver
so it seems it isn't a real solution
@Viraj-10 I believe this is still present in gluestack-ui v2.
If in my tailwind config I have custom: ["Poppins_400Regular"],
and I use a heading with <Heading className="font-custom">{title}</Heading>
, it will not work unless I add the font-normal or font-medium classes such as <Heading className="font-normal font-custom">{title}</Heading>
and now it'll work, but again that's just for an hardcoded font with a predefined weight.
In the tailwind config, custom: ["Poppins", "sans-serif"]
or custom: ["Poppins"]
will not work.
I've been having issues with gluestack-ui with the fonts since the very beginning, even in v1. It'd be nice if someone could look into this and have a good in-depth documentation and one of the example apps using a custom font as the default font for everything.
Description
On Android the FontFamily of the Heading Component is not applied correctly
CodeSandbox/Snack link
No response
Steps to reproduce
If i install gluestack and eject theme and use expo font to load a font to apply it to the heading - the font doesnt get applied on android.
Works fine on ios.
Workaround with
<Text fontFamily="$heading"></Text>
work on android as well.gluestack-ui Version
1.1.18
Platform
Other Platform
No response
Additional Information
No response