Skip to content
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 Fonts with React Native Paper 3 and Expo 35.0.0 #1500

Closed
niallcurtis opened this issue Dec 3, 2019 · 3 comments
Closed

Custom Fonts with React Native Paper 3 and Expo 35.0.0 #1500

niallcurtis opened this issue Dec 3, 2019 · 3 comments
Labels
question Question related to the library, not an issue

Comments

@niallcurtis
Copy link

Ask your Question

Hello,

I recently upgraded React Native Paper from version 2 to version 3 and am struggling to make custom fonts work. I updated my app to use the new theme management, using the exact format in the Fonts documentation, except replacing sans-serif with montserrat and montserrat-bold, etc. These fonts have been loaded using Expo's font loading systems in Expo SDK 35.0.0. However, in the app now, all RNPaper <Text /> components are using the system default font rather than montserrat. I was wondering whether there's further documentation or if I'm missing something here.

Thanks

@niallcurtis niallcurtis added the question Question related to the library, not an issue label Dec 3, 2019
@jonasgroendahl
Copy link

Maybe #1502 if using ios

@shiroze
Copy link

shiroze commented Dec 6, 2019

Simple Customize, this code what I use.

const fontConfig = {
  default: {
    regular: {
      fontFamily: Fonts.FONTS.PRIMARY,
      fontWeight: 'normal',
    },
  },
};

const theme = {
  ...DarkTheme,
  roundness: 5,
  colors: {
    ...DarkTheme.colors,
    text: Theme.COLORS.WHITE,
    placeholder: Theme.COLORS.WHITE,
    primary: Theme.COLORS.SWITCH_ON,
    background: 'transparent',
  },
  fonts: configureFonts(fontConfig),
};

or you can try use #1502 like @jonasgroendahl said

@niallcurtis
Copy link
Author

Maybe #1502 if using ios

Thanks, this helped!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Question related to the library, not an issue
Projects
None yet
Development

No branches or pull requests

3 participants