[Solved] Problem rendering custom otf font

Hey All,

I am trying to embed a custom font to the app using roFontRegistry. I register 5 types of the same font (Bold, Extrabold, Light, Medium and Regular). All of these fonts are open type (.otf)

FontNameBold.otf
FontNameExtraBold.otf
FontNameLight.otf
FontNameMedium.otf
FontNameRegular.otf

The Register(path as String) call returns true for each font, but when I invoke GetFamilies(), it returns only 1 (“FontName”) instead of 5 (“FontNameBold”, “FontNameExtraBold”, “FontNameLight”, “FontNameMedium”, “FontNameRegular”). Also when I applied that font to a text on image canvas, it doesn’t seems to render the font properly.

Font type: Open type font file
Font embeddability: Installable

Any idea why this happens?

You could try using a font editor to rename each font differently. I had a similar problem and solved it by creating unique names for each file

I already have each of them as different files.

Like this:

FontNameBold.otf
FontNameExtraBold.otf
FontNameLight.otf
FontNameMedium.otf
FontNameRegular.otf

Is that what u are talking about?

You need to open each file with a font editor and change each family name to something different. I would change the font name to the same as the filename without the extension. Apparently there is some kind of issue with the api and font names. You can get a font editor as freeware

That solved the problem. Thank you NewManLiving!!

As a side benefit the font editor allows you to remove all the stuff you do not need thus reducing your font files by up to 2 thirds in size in some cases.