Skip to content

Font Family not working #61

@gcolotti

Description

@gcolotti

I tried with t.fontSans, t.fontSerif, t.fontMono, they show the same font. Also tried to add a custom font, as described here, but is not working.

Also, the fix used in #14 didn't work for me. The command npx RNtailwindcss is failing (cp: cannot stat '../react-native-tailwindcss/stubs/defaultConfig.stub.js': No such file or directory), so I created the config file with npx tailwind init --full .

I could configure custom a fontSize and colors, but fontFamily is not working at all.

This is how I have my fontFamily config:

 fontFamily: {
      sans: [
        '-apple-system',
        'BlinkMacSystemFont',
        '"Segoe UI"',
        'Roboto',
        '"Helvetica Neue"',
        'Arial',
        '"Noto Sans"',
        'sans-serif',
        '"Apple Color Emoji"',
        '"Segoe UI Emoji"',
        '"Segoe UI Symbol"',
        '"Noto Color Emoji"',
      ],
      serif: [
        'Georgia',
        'Cambria',
        '"Times New Roman"',
        'Times',
        'serif',
      ],
      mono: [
        'Menlo',
        'Monaco',
        'Consolas',
        '"Liberation Mono"',
        '"Courier New"',
        'monospace',
      ],
      metropolisLight: ['Metropolis-light'],
      metropolisSemibold: ['Metropolis-SemiBold'],
      metropolisMedium: ['Metropolis-Medium'],
      metropolisBold: ['Metropolis-Bold'],
    },

The custom fonts are working properly using react-native StyleSheet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions