Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
sonnykr
Visitor

[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?
0 Kudos
5 REPLIES 5
NewManLiving
Visitor

Re: Problem rendering custom otf font

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
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
sonnykr
Visitor

Re: Problem rendering custom otf font

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?
0 Kudos
NewManLiving
Visitor

Re: Problem rendering custom otf font

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
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos
sonnykr
Visitor

Re: Problem rendering custom otf font

That solved the problem. Thank you NewManLiving!!
0 Kudos
NewManLiving
Visitor

Re: [Solved] Problem rendering custom otf font

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.
My Channels: 2D API Framework Presentation: https://owner.roku.com/add/2M9LCVC
Updated: 11-11-2015 - Completed Keyboard interface
The Joel Channel ( Final Beta )
0 Kudos