Skip to content

How to use custom fonts #4

@RobertCordes

Description

@RobertCordes

Hi, I can't get custom fonts working. They’re in the public directory (eg. /public/fonts/Inter-Regular.ttf) which is an allowed directory as in the default configuration:

'allowed_directories' => [
    public_path(),
],
'base_dir' => '/',

In my CSS I've set the following:

@font-face {
    font-family: "Inter";
    src: url("/public/fonts/Inter-Regular.ttf") format("ttf");
    /* I also tried src: url("/fonts/Inter-Regular.ttf") format("ttf"); */
    font-weight: 400;
}

But I had no luck. I also tried using .woff. Do you have any idea what the problem could be?

PS: I love your package! ❤️

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions