Skip to content

How to add custom font name and use it? #3

@Saad-Bashar

Description

@Saad-Bashar

First of all thanks for this amazing library. I am trying to add a custom font and use it in my app. I followed the docs https://arabold.github.io/react-native-whirlwind/customization/fonts and have been able to add custom fonts. My question is, in my theme, do I need to add my custom font name within the specific fonts that the library provides? For example, this works -

const t = createTheme({
    fontFamilies: {
        'sans': 'Spartan-Medium' ,
        'sansBold': 'Spartan-Bold'
    },
})

is it possible to do it like this -

const t = createTheme({
    fontFamilies: {
        'spartanMedium': 'Spartan-Medium' ,
        'spartanBold': 'Spartan-Bold'
    },
})

Or do I need to specify my fonts within the provided names like 'sans' 'mono' 'serif' etc?

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions