Skip to content

[FontLoader] If font has "bold" in name, it gets truncated #259

@djipco

Description

@djipco

When FontLoader tries to guess the name of the font, it strips the weight string from the filename. The problem is that the weight string might already be part of the font's name.

I realized this while trying to load a font called Grobold. In this case, the font-family generated by FontLoader becomes Gro. The substring bold is being stripped out.

It took me quite a while to figure this one out. The problem is with line 488. I would've submitted a PR but I'm not sure what would be the best way to fix this...

On a related note, now that there is broader support for FontFaceSet.load(), it might be better to use that and fallback to the current method when unavailable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions