[FontLoader] If font has "bold" in name, it gets truncated
djipco opened this issue · 0 comments
djipco commented
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.