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: 
squirreltown
Roku Guru

Fonts

In the SDk, customvideoplayer, there is an external font "caps". Sort of a Roman serif type.
If you load the example, you see that indeed, the font you get is different from the standard Gotham Narrow the Roku uses - but its not "caps" its sort of a light Helvetica.

In fact , any font you register shows as this light Helvetica, not the font type you register.
You can actually remove the registered font from your package completely, the app wont error, and will still show the light Helvetica - you can even style it.
Removing the fontRegistry code gets you back to standard Gotham Narrow.

Whats going on with this?
Kinetics Screensavers
0 Kudos
6 REPLIES 6
squirreltown
Roku Guru

Re: Fonts

Ok, I'll try this a different way. Anybody out there successfully registering and using external fonts, and if so does your syntax differ from the code below?
Thanks

	fontReg = CreateObject("roFontRegistry")
fontReg.Register("pkg:/fonts/caps.otf")
font = fontReg.Get("caps",28,50,true)

text = {
Text: "test",
TextAttrs:{Color:"#960404", Font:font,
HAlign:"Left", VAlign:"Top", Direction:"LeftToRight"}
TargetRect:{x:50, y:20, w:700, h:100}}
Kinetics Screensavers
0 Kudos
TheEndless
Channel Surfer

Re: Fonts

Are you sure "caps" is the registered font name? Print the results of "fontReg.GetFamilies()" to the console to see the registered font names. It won't necessarily match the name of the file.

Oh, and to answer your question, yes I've used custom fonts successfully an numerous channels. Your syntax looks correct for use on an roImageCanvas.
My Channels: http://roku.permanence.com - Twitter: @TheEndlessDev
Instant Watch Browser (NetflixIWB), Aquarium Screensaver (AQUARIUM), Clever Clocks Screensaver (CLEVERCLOCKS), iTunes Podcasts (ITPC), My Channels (MYCHANNELS)
0 Kudos
squirreltown
Roku Guru

Re: Fonts

Thank You theEndless, thats a start, I'll investigate.

Edit - Ok it took exactly two minutes to confirm you were right about the name thing and to make the font work. The actual name for "caps" in the SDK is "LMRoman10-Caps". I was thrown off the track by the fact that the SDK lists it as "lmroman10 caps" which doesn't work, so getting the console check was the solution.
Kinetics Screensavers
0 Kudos
RokuMarkn
Visitor

Re: Fonts

The name of the font should be case insensitive. I tried the customvideoplayer sample and I don't see any difference in appearance whether the name of the font is "lmroman10-caps" or "LMRoman10-Caps". I notice that you gave the original name with the dash replaced with a space -- was that a typo in your post or did you change it in the source?

--Mark
0 Kudos
squirreltown
Roku Guru

Re: Fonts

typo is in the source file in the SDK
Kinetics Screensavers
0 Kudos
RokuMarkn
Visitor

Re: Fonts

Ah you're right. This has been fixed internally so the version I was looking at has the correct name.

--Mark
0 Kudos