Roku Developer Program

Developers and content creators—a complete solution for growing an audience directly.
cancel
Showing results for 
Search instead for 
Did you mean: 
sonnykr
Level 7

[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
NewManLiving
Level 7

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
Level 7

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
Level 7

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
Level 7

Re: Problem rendering custom otf font

That solved the problem. Thank you NewManLiving!!
0 Kudos
Highlighted
NewManLiving
Level 7

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