<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>BlackBerry Developer Blog &#187; Font</title>
	<atom:link href="http://devblog.blackberry.com/tag/font/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.blackberry.com</link>
	<description></description>
	<lastBuildDate>Tue, 18 Jun 2013 16:50:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='devblog.blackberry.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://1.gravatar.com/blavatar/9ef0a66c09615fa946c4179662398878?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>BlackBerry Developer Blog &#187; Font</title>
		<link>http://devblog.blackberry.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://devblog.blackberry.com/osd.xml" title="BlackBerry Developer Blog" />
	<atom:link rel='hub' href='http://devblog.blackberry.com/?pushpress=hub'/>
		<item>
		<title>Defining Your App’s Style with Active Rich Text</title>
		<link>http://devblog.blackberry.com/2013/02/active-rich-text/</link>
		<comments>http://devblog.blackberry.com/2013/02/active-rich-text/#comments</comments>
		<pubDate>Tue, 12 Feb 2013 16:23:09 +0000</pubDate>
		<dc:creator>Alex Kinsella</dc:creator>
				<category><![CDATA[Native SDK Development]]></category>
		<category><![CDATA[Font]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[richtext]]></category>
		<category><![CDATA[text]]></category>

		<guid isPermaLink="false">http://devblog.blackberry.com/?p=12183</guid>
		<description><![CDATA[Guest post from Erin Rahnenfuehrer. &#8211; Ed. Everyone has their own personal style. The way you choose to present yourself is one of the ways you communicate to others. The same holds true for your app. The stylistic choices that you make when designing your app convey a message to the end user. Through colours, [&#8230;]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=12183&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p><i>Guest post from <a href="https://twitter.com/ERahnen" target="_blank">Erin Rahnenfuehrer</a>. &#8211; Ed.</i></p>
<p><img class="aligncenter size-full wp-image-13583" alt="ActiveRichTextPic1" src="http://rimdevblog.files.wordpress.com/2013/02/activerichtextpic1.jpg?w=500&#038;h=330" width="500" height="330" /></p>
<p>Everyone has their own personal style. The way you choose to present yourself is one of the ways you communicate to others.</p>
<p>The same holds true for your app. The stylistic choices that you make when designing your app convey a message to the end user. Through colours, fonts, and layout, your app has a specific “look and feel” that users come to expect. This is your brand, and every product for sale today is designed with this in mind.</p>
<p>To fully express your app’s style, and to reinforce your brand, you may need a more granular level of control over how text is displayed. In order to help developers style their apps the Cascades Label, TextField, and TextArea controls support active rich text.</p>
<p><span id="more-12183"></span></p>
<h3><strong>Supported elements</strong></h3>
<p>Cascades supports a strict subset of <a href="http://xhtml.com/en/xhtml/reference/" target="_new">XHTML</a>:</p>
<table style="width:620px;" border="5" cellspacing="5" cellpadding="5">
<tbody>
<tr>
<td><strong>Element</strong></td>
<td><strong>Description</strong></td>
<td><strong>Comments</strong></td>
</tr>
<tr>
<td><a href="http://xhtml.com/en/xhtml/reference/a/" target="_new">&lt;a&gt;</a></td>
<td>A hyperlink</td>
<td>The <strong>href</strong> and <strong>style</strong> attributes are supported. Links must be fully qualified with “http://” or “https://”</td>
</tr>
<tr>
<td><a href="http://xhtml.com/en/xhtml/reference/b/" target="_new">&lt;b&gt;</a></td>
<td>Instruction to render text in bold style</td>
<td></td>
</tr>
<tr>
<td><a href="http://xhtml.com/en/xhtml/reference/br/" target="_new">&lt;br/&gt;</a></td>
<td>Line break</td>
<td>Inserts a forced line break character: a carriage return (U+000C).</td>
</tr>
<tr>
<td><a href="http://xhtml.com/en/xhtml/reference/i/" target="_new">&lt;i&gt;</a></td>
<td>Instruction to render text in italic style</td>
<td></td>
</tr>
<tr>
<td><a href="http://xhtml.com/en/xhtml/reference/span/" target="_new">&lt;span&gt;</a></td>
<td>Generic way to add structure to content</td>
<td>The <strong>style</strong> attribute is supported; used for CSS styles (see <a href="http://wikis.rim.net/display/i18nServices/Markup+Handling#MarkupHandling-Styling" target="_new">below</a>)</td>
</tr>
<tr>
<td><a href="http://xhtml.com/en/xhtml/reference/p/" target="_new">&lt;p&gt;</a></td>
<td>A paragraph: paragraph breaks are forced before and after it.</td>
<td>The <strong>style</strong> attribute is supported; used for CSS styles</td>
</tr>
<tr>
<td><a href="http://xhtml.com/en/xhtml/reference/div/" target="_new">&lt;div&gt;</a></td>
<td>A section: paragraph breaks are forced before and after it.</td>
<td>The <strong>style</strong> attribute is supported; used for CSS styles</td>
</tr>
<tr>
<td><a href="http://xhtml.com/en/xhtml/reference/em/" target="_new">&lt;em&gt;</a></td>
<td>Emphasize text</td>
<td>Implemented using italics</td>
</tr>
<tr>
<td><a href="http://xhtml.com/en/xhtml/reference/strong/" target="_new">&lt;strong&gt;</a></td>
<td>Use a strong style</td>
<td>Implemented using bold face</td>
</tr>
</tbody>
</table>
<h3><strong>Common attributes</strong></h3>
<p>The common attributes <strong>style</strong>, <strong>lang</strong>, and <strong>xml:lang</strong> are supported for all XHTML elements. The <strong>lang</strong> and <strong>xml:lang</strong> attributes are used to specify a language tag, which is identical to a standard locale string like <strong>en</strong> or <strong>zh_CN</strong>.</p>
<h3><strong>Character entities</strong></h3>
<p>The following character entities are supported:</p>
<ul>
<li>#number</li>
<li>#xNumber</li>
<li>lt</li>
<li>gt</li>
<li>amp</li>
<li>quot</li>
<li>apos</li>
<li>nbsp</li>
<li>iexcl</li>
<li>pound</li>
<li>yen</li>
<li>brvbar</li>
<li>section</li>
<li>copy</li>
<li>ordf</li>
<li>laquo</li>
<li>not</li>
<li>shy</li>
<li>reg</li>
<li>deg</li>
<li>micro</li>
<li>ordm</li>
<li>raquo</li>
<li>iquest</li>
<li>bull</li>
<li>prime</li>
<li>trade</li>
<li>ndash</li>
<li>mdash</li>
<li>lsquo</li>
<li>rsquo</li>
<li>sbquo</li>
<li>ldquo</li>
<li>rdquo</li>
<li>bdquo</li>
<li>euro</li>
</ul>
<h3><strong>Interpretation of the style attribute</strong></h3>
<p>HTML allows the use of CSS to style text. All styles must be specified in-line using the style attribute.</p>
<pre>&lt;span style="font-weight:bold;color:red;"&gt;Here's some bold red text!&lt;/span&gt;</pre>
<p>The following CSS properties are supported:</p>
<table style="width:100%;" border="5" cellpadding="5">
<tbody>
<tr>
<td><strong>Property</strong></td>
<td><strong>Values</strong></td>
<td><strong>Description</strong></td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_background-color.asp" target="_new">background-color</a></td>
<td>&lt;color&gt; (Supports 147 standard color names as well as rgb(n,n,n), rgba(n,n,n,n), hsl(n,n,n), hsla(n,n,n,n) and #NNNNNN)</td>
<td>Sets the background color of an element</td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_text_color.asp" target="_new">color</a></td>
<td>&lt;color&gt; (Supports 147 standard color names as well as rgb(n,n,n), rgba(n,n,n,n), hsl(n,n,n), hsla(n,n,n,n) and #NNNNNN)</td>
<td>Sets the color of text</td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_text_direction.asp" target="_new">direction</a></td>
<td>[ ltr | rtl ]</td>
<td>Specifies the base paragraph direction</td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_font_font-size.asp" target="_new">font-size</a></td>
<td>[ xx-small | x-small | small | medium | large | x-large | xx-large | smaller | larger | &lt;dimension&gt;</td>
<td>Specifies the font size of text</td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_font_font-style.asp" target="_new">font-style</a></td>
<td>[ normal | italic | oblique ]</td>
<td>Specifies the font style for text</td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_font_weight.asp" target="_new">font-weight</a></td>
<td>[ normal | bold | lighter | bolder | 100 | 200 | 300 | 400 | 500 | 600 | 700 | 800 | 900 ]</td>
<td>Specifies the weight of a font</td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_dim_line-height.asp" target="_new">line-height</a></td>
<td>[ normal | &lt;multiplier&gt; | &lt;dimension&gt; ]</td>
<td>Sets the line height</td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_text_text-align.asp" target="_new">text-align</a></td>
<td>[ left | right | center | justify ]</td>
<td>Specifies the horizontal alignment of text</td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_text_text-decoration.asp" target="_new">text-decoration</a></td>
<td>[underline | line-through | none ]</td>
<td>Allows underlining or line-through (also known as strike-through) to be turned on or off</td>
</tr>
<tr>
<td><a href="http://www.w3schools.com/cssref/pr_text_letter-spacing.asp" target="_new">letter-spacing</a></td>
<td>&lt;dimension&gt;</td>
<td>Adjusts the space between letters; also known as tracking, track kerning or character spacing</td>
</tr>
</tbody>
</table>
<p>Where &lt;dimension&gt; is a number optionally followed by a unit: % (percentage of standard value), pt (printer&#8217;s point: 1/72in), pc (printer&#8217;s pica: 1/6in), in (inch), cm (centimetre), mm (millimetre), em (printer&#8217;s em: font size), ex (printer&#8217;s ex height; 0.5em is used when ex height is not known). If no unit is present a standard unit is assumed. This is a printer&#8217;s point for font-size, or the normal line height for line-height.</p>
<pre>&lt;span style='letter-spacing:10pt;'&gt;Action is eloquence&lt;/span&gt;
&lt;span style='letter-spacing:25%;'&gt;Action is eloquence&lt;/span&gt;
&lt;span style='letter-spacing:-3px;'&gt;Action is eloquence&lt;/span&gt;
&lt;span style='letter-spacing:0.4cm;'&gt;Action is eloquence&lt;/span&gt;</pre>
<p>Will display text as the following:</p>
<p><img class="aligncenter size-full wp-image-12186" title="" alt="" src="http://rimdevblog.files.wordpress.com/2012/11/rich-text-3.jpg?w=440&#038;h=212" width="440" height="212" /></p>
<h3><strong>Handling unsupported tags</strong></h3>
<p>Unsupported tags will be ignored.</p>
<h3><strong>Markup editing</strong></h3>
<p>When a style is applied in a TextField or TextArea, all text entered by the user will be interpreted as plain text, and will inherit the text style of the current cursor position.</p>
<h3><strong>Error handling</strong></h3>
<p>If text doesn&#8217;t follow the XML standard it will be treated as raw text and an error will be printed into a log.<br />
<strong>Note:</strong> if you&#8217;re using HTML metacharacters &lt;, &gt;, &amp;, and &#8221; in your markup &#8211; you either need to escape them manually using character entities or use <a href="http://qt-project.org/doc/qt-4.8/qt.html#escape" target="_new">Qt::escape</a></p>
<h3><strong>Markup filtering</strong></h3>
<p>The TextField control is a height-restricted control and does not support tags which assume multi-line, like &lt;br/ &gt;, &lt;div &gt;, and &lt;p &gt;. To use these tags with TextArea and Label, make sure that you set the multiline property to true.</p>
<p><strong>Example</strong></p>
<pre>Label {
            text: "&lt;html&gt;&lt;div style='background-color:yellow;letter-spacing:10px;'&gt;Virtue is &lt;b&gt;bold&lt;/b&gt;&lt;/div&gt;&amp; &lt;a href='http://www.rim.com' style='text-decoration:none'&gt;goodness&lt;/a&gt; never fearful&lt;/html&gt;"
            multiline: true
        }
</pre>
<p style="text-align:center;"><img alt="" src="http://rimdevblog.files.wordpress.com/2013/02/activerichtextpic2.jpg?w=300" /></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/rimdevblog.wordpress.com/12183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rimdevblog.wordpress.com/12183/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=devblog.blackberry.com&#038;blog=17235680&#038;post=12183&#038;subd=rimdevblog&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://devblog.blackberry.com/2013/02/active-rich-text/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/7d0e94a7e96e80d5911732d43f31a39c?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">Alex K.</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2013/02/activerichtextpic1.jpg" medium="image">
			<media:title type="html">ActiveRichTextPic1</media:title>
		</media:content>

		<media:content url="http://rimdevblog.files.wordpress.com/2012/11/rich-text-3.jpg" medium="image" />

		<media:content url="http://rimdevblog.files.wordpress.com/2013/02/activerichtextpic2.jpg?w=300" medium="image" />
	</item>
	</channel>
</rss>
