typefaces
typefaces copied to clipboard
React Native?
I'm not working with React Native so am not super familiar with font loading there but if I'd love it if someone added a PR to make it easy to require fonts into react native projects.
I might be able to help here, but that would require .ttf fonts in the packages. I don't think you can use woff fonts in native apps.
You could export a class that depends on Expo to load the font.
This is how I load my fonts at the moment:
async componentDidMount(): Promise<void> {
await Font.loadAsync({
"SFProText-Bold": SFProTextBold,
"SFProText-Semibold": SFProTextSemibold,
"SFProText-Regular": SFProTextRegular
});
await Promise.all([fonts, ...images, icons]);
// App is ready now
}
Support for woff might be available via the packagerOpts
option in app.json (need to double check). In my app I have:
"packagerOpts": {
"assetExts": ["otf"]
},
Any updates on this?