Skip to content

custom ttf fonts are not loaded correctly #474

@godexsoft

Description

@godexsoft

I have an issue with getting my custom fonts to work in Macaw.
In fact i found a way to make it work but let me explain what i'm experiencing.

If i attempt to load my custom font like so:
Font(name: "comfortaa", size: 16)
I get a Helvetica font. The reason is because this code:
return MFont(descriptor: fontDesc, size: CGFloat(size))
inside of RenderUtils.loadFont is not locating my font correctly even tho a few lines above the font is found in availableFonts. So it detects lower case 'comfortaa' and sets all descriptors up but iOS refuses to give me the correct font.

If i change this one return line to this everything works as expected (but weight is ignored of course):
return MFont(name: fontName, size: CGFloat(size))

Hope you can fix it somehow so we can at least use this method if we don't specify weight?
Thanks in advance.
Alex

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions