philotas
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
08:16 AM
How to modify System Fonts in SceneGraph?
Is it possible to make different version of the Build in SceneGraph Fonts, for example making a smaller, bigger or italic version of one font?
In BrightScript i could do something like this to get 10pt italic font, but in SceneGraph?
I know, that I could create a Font node with my embedded TTF but I am asking for creating versions of the build in fonts.
thanks!
In BrightScript i could do something like this to get 10pt italic font, but in SceneGraph?
reg = CreateObject("roFontRegistry")
font = reg.GetDefaultFont(10, false, true)
I know, that I could create a Font node with my embedded TTF but I am asking for creating versions of the build in fonts.
thanks!
14 REPLIES 14
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
09:48 AM
Re: How to modify System Fonts in SceneGraph?
<scratches head>... well, ordinarily i'd expect you should be able to assign to the font attribute a roFont, which is what you get from getDefaultFont(). But seems the RSG Maker - "bless the Maker and His water!" - thinks different.
Hm. The "Currently only font files included in the application can be specified." comment for the URI attribute is not encouraging. The choices the Maker giveth ("font:SmallestSystemFont", SmallestBoldSystemFont, ..., LargeBoldSystemFont) don't satisfy you?
Hm. The "Currently only font files included in the application can be specified." comment for the URI attribute is not encouraging. The choices the Maker giveth ("font:SmallestSystemFont", SmallestBoldSystemFont, ..., LargeBoldSystemFont) don't satisfy you?
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
10:15 AM
Re: How to modify System Fonts in SceneGraph?
You can change the font size of any of the system fonts to any value you want, and the system fonts provide bold equivalents for each of the non-bolded fonts; however, I don't see any way to create an italic font from a system font.
philotas
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
03:26 PM
Re: How to modify System Fonts in SceneGraph?
"EnTerr" wrote:
("font:SmallestSystemFont", SmallestBoldSystemFont, ..., LargeBoldSystemFont) don't satisfy you?
no, because I need italic (although it is not a nice way for formatting on a TV I admit)
philotas
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
03:28 PM
Re: How to modify System Fonts in SceneGraph?
"belltown" wrote:
You can change the font size of any of the system fonts to any value you want,
How do I do that in SceneGraph for a Label Node?
I can set the Size of a Font Node, but afaik I cannot create a Font Node with a system font?
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
03:49 PM
Re: How to modify System Fonts in SceneGraph?
"philotas" wrote:"belltown" wrote:
You can change the font size of any of the system fonts to any value you want,
How do I do that in SceneGraph for a Label Node?
I can set the Size of a Font Node, but afaik I cannot create a Font Node with a system font?
Set the size property of the label's font property, e.g. in your component's init() function:
<Label
id="labelNode"
text="Ultimate Label"
font="font:LargeBoldSystemFont" />
label = m.top.findNode("labelNode")
label.font.size = 42
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
06:16 PM
Re: How to modify System Fonts in SceneGraph?
Any chance it can be done via karnapidasana?
i.e. does "font:" qualify as URI protocol?
<label text="Ultimate Label">
<font role="font" uri="font:LargeBoldSystemFont" size="24"/>
</label>
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
06:40 PM
Re: How to modify System Fonts in SceneGraph?
"EnTerr" wrote:
Any chance it can be done via karnapidasana?
<label text="Ultimate Label">
<font role="font" uri="font:LargeBoldSystemFont" size="24"/>
</label>
i.e. does "font:" qualify as URI protocol?
I just tried it and it didn't work. It does say in the docs under uri: Specifies a TrueType or OpenType font file. Currently only font files included in the application can be specified.
EnTerr
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
07:16 PM
Re: How to modify System Fonts in SceneGraph?
it was a "Hail Mary pass".
ostensibly, "font:LargeBoldSystemFont" could be a file specifier. 🙂
ostensibly, "font:LargeBoldSystemFont" could be a file specifier. 🙂
belltown
Roku Guru
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-12-2016
07:38 PM
Re: How to modify System Fonts in SceneGraph?
"EnTerr" wrote:
it was a "Hail Mary pass".
ostensibly, "font:LargeBoldSystemFont" could be a file specifier. 🙂
Let's hope that's why they used the word 'Currently' in the docs.