0

Multiple coloring on Text and other styles

I am searching here in forum and into manual but I can’t find this information anywhere, so I am not sure if it's supported or not.

So I create this element.

CODE
var textparagraph = new KONtx.element.Text({
label: 'The color of this –word- is red.',
styles: {
color: '#FFFFFF',
fontSize: KONtx.utility.scale(12),
}
}).appendTo(this);

So what I want to do. I can’t find how to make whole paragraph to be with white color and the word “-word-” to be red.

Like this:

QUOTE
The color of this –word- is red.

Is this possible? Also how can I set different styles into one text, for example bold, italic etc.?

At last I think that I found one bug, I don’t know if is bug of emulator (my wdk version is 0.9.7.6 and I have installed on Ubuntu 9.10) or bug in OEM TV’s but I report it here to check it.

I can’t set the text align into styles as justify like this

CODE
textAlign: 'justify'

The result of this alignment is the left alignment.

Thanks

8 Replies
  • Not really. You could techincally create a call that slip a Text object based on the colors desired in the text and replaced words with ' ' (spaces).

    There is very limited support for HTMl type functionality.
    0
  • QUOTE (WidgetRealm @ Dec 20 2009, 10:53 PM) <{POST_SNAPBACK}>
    Not really. You could techincally create a call that slip a Text object based on the colors desired in the text and replaced words with ' ' (spaces).

    There is very limited support for HTMl type functionality.


    Yeah, but with this is works only if I have static content, but in dynamic content this will be problem, I have to calculate every time the spaces that I need for that.
    0
  • Rich text support will be coming in the future, until then there isn't any clean solutions.

    -Jeremy
    0
  • For bold and italics u can mention the following inside the styles
    fontWeight: 'bold'
    fontStyle: Italics

    U can color different words in a sentance by dividing the words into different "Text" elements.

    Harsha
    0
  • QUOTE (harsha s @ Jan 11 2010, 09:31 PM) <{POST_SNAPBACK}>
    U can color different words in a sentance by dividing the words into different "Text" elements.


    This is going to most likely be poorly performing and very brittle / error prone. I would advise you wait for the 2010 TVs which should support rich text to get this behavior.

    -Jeremy
    0
  • Its 2011, any documentation on Rich Text support and where could I find it?

    thanks,

    - Jason
    0
  • Unfortunately, there is still no support for rich text.

    Thanks,
    Vivek
    0
  • There is documentation available for developers. Have you checked out the links at http://developer.yahoo.com/connectedtv?(Under section Documentation and Related Links) If you have more specific doubts, feel free to ask in the developer forums.

    Thanks,
    Vivek
    0

Recent Posts

in Design / Interaction - Yahoo! TV Widgets