<?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/"
	>

<channel>
	<title>fortes.com &#187; Work</title>
	<atom:link href="http://archive.fortes.com/work/feed/" rel="self" type="application/rss+xml" />
	<link>http://archive.fortes.com</link>
	<description>Typed live in front of a studio audience in Seattle</description>
	<lastBuildDate>Mon, 14 Sep 2009 13:40:05 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Introducing Sistr</title>
		<link>http://archive.fortes.com/2007/09/17/introducing-sistr/</link>
		<comments>http://archive.fortes.com/2007/09/17/introducing-sistr/#comments</comments>
		<pubDate>Mon, 17 Sep 2007 23:20:58 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Sistr]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/09/17/introducing-sistr/</guid>
		<description><![CDATA[Over the weekend I spent some time seeing if I could replicate the functionality found in the excellent sIFR, using Silverlight instead of Flash. The result is Sistr. For the impatient &#8212; here&#8217;s a demo test page. Note: This definitely isn&#8217;t ready for a production site, this is an early version for feedback purposes only. [...]]]></description>
			<content:encoded><![CDATA[<ul class="photo">
<li><a href="http://flickr.com/photos/fortes/1337717840/"><img src="http://farm2.static.flickr.com/1255/1337717840_78497e0379.jpg" alt="Plane Engine over the midwest" /></a></li>
</ul>
<p>Over the weekend I spent some time seeing if I could replicate the functionality found in the excellent <a href="http://www.mikeindustries.com/sifr">sIFR</a>, using <a href="http://silverlight.net/">Silverlight</a> instead of Flash. The result is <a href="http://fortes.com/projects/silverlight/sistr">Sistr</a>. For the impatient &#8212; here&#8217;s a <a href="http://static.fortes.com/projects/silverlight/sistr/side-by-side.html">demo test page</a>.</p>
<p><strong>Note:</strong> This <em>definitely</em> isn&#8217;t ready for a production site, this is an early version for feedback purposes only. There are still plenty of bugs, trust me.</p>
<h3>Usage</h3>
<ol>
<li>Download <a href="http://static.fortes.com/projects/silverlight/sistr/sistr.js"><tt>sistr.js</tt></a> and save it to your web server (or reference it directly from <a href="http://static.fortes.com/projects/silverlight/sistr/sistr.js">this site</a>).</li>
<li>Create a zip file with the font(s) you wish to use. Upload this to your webserver as well (Silverlight will only use fonts that are retrieved via HTTP).</li>
<li>Add the following into your HTML page:
<pre><code class="html sch">&lt;script type=&quot;text/javascript&quot; src=&quot;sistr.js&quot;&gt;&lt;/script&gt;</code></pre>
</li>
<li>In your CSS file, define a new class called <code>sistr-replace</code> (anything that starts with &#8220;sistr-&#8221; works). Here&#8217;s an example:
<pre><code class="html sch">.sistr&#x002D;replace { }</code></pre>
</li>
<li>Use the <code>font-family</code> property to set the font name and URL to the font files, enclose them in quotes and separate with the &#8220;|&#8221; character (e.g. <code>font-family: "Fil's Font|filfont.zip"</code>). Make sure you also specify backup fonts for users who don&#8217;t have Silverlight installed, like so:
<pre><code class="html sch">.sistr&#x002D;replace { font&#x002D;family: &quot;FontName|fonts.zip&quot;, Verdana, Arial, Sans&#x002D;Serif; }</code></pre>
</li>
<li>Set the <code>class</code> property on some of your HTML elements to <code>sistr-replace</code> (or whatever else you used) and re-load. For example:
<pre><code class="html sch">&lt;h3 class=&quot;entry&#x002D;title sistr&#x002D;replace&quot;&gt;Hello World!&lt;/h3&gt;</code></pre>
</li>
<li>Your text should now be rendered using Silverlight.</li>
</ol>
<p>Take a look at the <a href="http://static.fortes.com/projects/silverlight/sistr/side-by-side.html">demo test page</a> as well.</p>
<h3>Pros &#038; Cons vs. sIFR</h3>
<p>Pro:</p>
<ul>
<li><strong>Simpler setup</strong>: All you need to do is include the <tt>sistr.js</tt> file in your page and edit your CSS &#8212; you do not need to edit any Silverlight or JavaScript code. sIFR is pretty easy too, but you need the Flash editing program in order to create a SWF file.</li>
<li><strong>Support for Transparent Backgrounds</strong>: sIFR provides partial support, but it&#8217;s not recommended within Firefox (I believe this is an issue with Flash).</li>
</ul>
<p>Con:</p>
<ul>
<li><strong>Lack of Silverlight Install Base</strong>: Silverlight is nowhere near as common as Flash.</li>
<li><strong>No protection for Font Files</strong>: In order to use a custom font with Silverlight, you have to have the font file available for download on a web server &#8212; you cannot embed it or protect it in any way. This means you must use fonts that you either created or are liberally licensed (public domain, etc).</li>
<li><strong>Immature</strong>: Both Flash and sIFR are much, much more mature than Silverlight and Sistr. There are many bugs that I have not sorted out yet.</li>
<li><strong>Many limitations</strong>: See below</li>
</ul>
<h3>Known Issues</h3>
<ul>
<li><strong>No support for line height</strong>: Limitation in Silverlight</li>
<li><strong>Must use absolute units for <code>font-size</code> in IE</strong>: Due to IE&#8217;s lack of a <code>getComputedStyle</code> equivalent.</li>
<li><strong>Occasional sizing issues</strong>: I think this may be a Silverlight bug, but occasionally text will get cut off in the vertical direction. Not sure how to fix it yet</li>
<li><strong>Font size doesn&#8217;t respond to user changes</strong>: Works fine if you reload though</li>
<li><strong>No support for <code>:hover</code> state</strong></li>
<li><strong>No support for nested hyperlinks</strong></li>
<li><strong>Text selection does not work</strong>: Not sure how screen readers react either</li>
<li><strong>Cannot support nested bold in Firefox</strong>: Works in IE though</li>
</ul>
<p>Let me know if you find others &#8212; or want to help fix bugs!</p>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/09/17/introducing-sistr/feed/</wfw:commentRss>
		<slash:comments>10</slash:comments>
		</item>
		<item>
		<title>Adobe OnAir Seattle</title>
		<link>http://archive.fortes.com/2007/07/11/adobe-onair-seattle/</link>
		<comments>http://archive.fortes.com/2007/07/11/adobe-onair-seattle/#comments</comments>
		<pubDate>Thu, 12 Jul 2007 01:24:19 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/07/11/adobe-onair-seattle/</guid>
		<description><![CDATA[I went to Adobe&#8217;s OnAir Seattle yesterday, which was a really interesting event that I&#8217;d recommend attending if you have the time. Unfortunately, I had to leave before the end of the day, but here&#8217;s a summary of the notes I took while I was there. The Big Picture Adobe&#8217;s goal is to let web [...]]]></description>
			<content:encoded><![CDATA[<p class="img"><a href="http://fortes.com/wp-content/uploads/2007/07/adobe-air-roadmap.jpg"><img alt="Adobe AIR product roadmap" src="http://fortes.com/wp-content/uploads/2007/07/adobe-air-roadmap-thumb.jpg"/></a></p>
<p>I went to <a href="http://onair.adobe.com/schedule/cities/seattle.php">Adobe&#8217;s OnAir Seattle</a> yesterday, which was a really interesting event that I&#8217;d recommend attending if you have the time. Unfortunately, I had to leave before the end of the day, but here&#8217;s a summary of the notes I took while I was there.</p>
<h3>The Big Picture</h3>
<p>Adobe&#8217;s goal is to let web developers can use their existing skills (<abbr title="HyperText Markup Language">HTML</abbr>, <abbr title="Cascading StyleSheets">CSS</abbr>, JavaScript, Flash, and Flex) to create desktop applications. <a href="http://labs.adobe.com/technologies/air/"><abbr title="Adobe Integrated Runtime">AIR</abbr></a> (formerly Apollo) provides cross-platform installation and application updates, a local database, and a variety of new APIs for managing local resources (local file access, controlling window chrome, drag and drop, etc). The Adobe guys were clear that this isn&#8217;t about porting existing web sites onto the desktop &#8212; assets and web services will obviously be re-used, but the emphasis was on not needing to learn new technologies (just a few new APIs). </p>
<h3>Interesting Tidbits / Nerdy Technical Details</h3>
<ul>
<li><strong>Installation: </strong>Applications are installed via a single <tt>.air</tt> file. Installed applications can be removed just like normal applications (i.e. via Add/Remove Programs on Windows, or by throwing the application in the trash on the Mac). An <a href="http://www.andrewwooldridge.com/blog/2007/06/air-express-install-example.html">express install</a> (which can bootstrap the AIR runtime) and detection is also possible via Flash.</li>
<li><strong>Application Updates: </strong>AIR will provide support for automatic application update checking and upgrading. </li>
<li><strong>HTML Rendering: </strong>Adobe chose the WebKit HTML engine (used by Safari and Konqueror) specifically because of it&#8217;s size and speed. Someone asked if they were considering moving to Firefox at some point, and they were clear that Firefox just couldn&#8217;t meet their size requirements for mobile.This cements WebKit&#8217;s position as the number three browser family (sorry Opera).</li>
<li><strong>PDF Support: </strong>Requires Adobe Reader 8.1 &#8212; unlike HTML and Flash support, the Adobe Reader must be installed separately (I&#8217;m not sure what happens if it&#8217;s not installed).</li>
<li><strong>HTML / Flash Integration:</strong> It looks like Adobe&#8217;s done a good job integrating the two &#8212; you can make script calls between the two, and there don&#8217;t appear to be any visual differences between the technologies. I&#8217;m not sure about PDF though, I&#8217;ll need to look into that.</li>
<li><strong>Script Engine: </strong>They&#8217;re using the <a href="http://www.mozilla.org/projects/tamarin/">Tamarin JavaScript engine</a>, which is far faster than what&#8217;s in browsers today. They showed a demo of <a href="http://preview.getbuzzword.com/">BuzzWord</a>, a word-processing program built on Flash, which implements their own line layout and pagination APIs that run pretty fast thanks to the JS engine. The Mozilla team plans to use Tamarin in Firefox version 4.0.</li>
<li><strong>SQLite: </strong>This must be fairly new, because none of the talks or demos I saw were using the local database. Adobe did mention that they&#8217;re working with Google to make sure they&#8217;re API-compatible with <a href="http://gears.google.com/">Google Gears</a>, which also uses SQLite.</li>
<li><strong>Native Windows:</strong> Can create native windows, or go chrome-less windows with transparency that give full-freedom (at the potential cost of consistency with other applications on that OS).</li>
<li><strong>Plugin Support: </strong>Currently only Flash and PDF can be embedded within HTML. Adobe says they&#8217;re open to feedback as far as other plugins (QuickTime was requested by a member of the audience).</li>
<li><strong>SDK and Tools</strong>: Adobe already has mature tools with the Flash authoring environment, Flex builder, and Dreamweaver. They making sure to adding support for creating AIR packages (which are ZIP files) in their existing products, lowering the learning curve for developers. Command-line tools for packaging AIR files are provided as well.</li>
<li><strong>Adoption Rates:</strong> Adobe made sure to mention how quickly new versions of Flash get adopted by users &#8212; they get 85% penetration within 9 months, which is quite impressive. Obviously, it&#8217;s unclear if AIR could get this</li>
<li><strong>Linux Support: </strong>Planned in late 2008. Adobe says they&#8217;ve been waiting for the latest version of Flash for Linux before they port AIR.</li>
<li><strong>Random Notes: </strong>Built-in support for associating file types at install time, don&#8217;t need admin rights to install AIR or AIR applications, events for regaining network connection, file dialogs, drag and drop support, use PNGs instead of dealing with .ico files, and Creative Commons licensing for the books. </li>
</ul>
<h3>MS vs. Adobe: My Take</h3>
<p>This is the right strategic move for Adobe. They&#8217;ve managed to attack the biggest weaknesses of their chief competition, <a href="http://wpf.netfx3.com/">Microsoft&#8217;s <abbr title="Windows Presentation Foundation">WPF</abbr></a>, by being cross-platform and leveraging existing technologies already used by web developers. Using existing technologies also means there are many mature tools for both designers and developers coding in HTML/Flash, which is not the case with WPF. Adobe made a good choice not trying to boil the ocean with a lot of new technology. </p>
<p>Granted, WPF&#8217;s target market is a bit different than AIR&#8217;s (there are a large number of WinForms developers already using .NET technologies), but for web developers the learning curve and lack of cross-platform support made WPF a non-starter (notice how much <a href="http://www.techcrunch.com/tag/silverlight/">more interest</a> Silverlight has recieved in the community). Obviously, there are still many areas where WPF is superior (3D and document layout, to name two), but I think AIR&#8217;s advantages more than make up for these drawbacks (from a web developer&#8217;s point of view).</p>
<p>Although still in it&#8217;s infancy, Silverlight will likely become the real competitor to AIR. Although it&#8217;s feature-poor in comparison to Flash, Microsoft&#8217;s clearly devoting a lot of resources to catching up quickly (notice the <a href="http://silverlight.net/GetStarted/">simultaneous release of 1.0 beta and 1.1 alpha</a> &#8212; which surely required <em>a lot</em> of testing resources). Silverlight plays nicely with HTML and JavaScript, provides good language support (including trendy languages like Ruby and Python), and has a very fast script runtime as well. It already <a href="http://msdn2.microsoft.com/en-us/library/bb412397.aspx">lets you go into full-screen</a>, I don&#8217;t think adding more windowing APIs wouldn&#8217;t be a stretch. I fully expect Microsoft to move in this direction.</p>
<p><em>Obvious Disclaimer: I do not work for Microsoft (although I used to). I don&#8217;t have any inside information. Don&#8217;t take blog posts too seriously, especially ones typed hurriedly on <a href="http://seattletimes.nwsource.com/html/localnews/2003783900_weather11m.html">a hot day</a>.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/07/11/adobe-onair-seattle/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Font Rendering Across Rich Platforms</title>
		<link>http://archive.fortes.com/2007/05/25/font-rendering-in-across-rich-platforms/</link>
		<comments>http://archive.fortes.com/2007/05/25/font-rendering-in-across-rich-platforms/#comments</comments>
		<pubDate>Fri, 25 May 2007 20:37:33 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/05/25/font-rendering-in-across-rich-platforms/</guid>
		<description><![CDATA[Although I used to work for Microsoft on the WPF team, I&#8217;m not tied to the platform. WPF and its alternatives (Flash, HTML, Apollo, Silverlight) each have advantages and disadvantages and choosing between them depends on your requirements. Since I&#8217;m doing a lot of work around reading experiences, I thought it was a good time [...]]]></description>
			<content:encoded><![CDATA[<p>Although I used to work for Microsoft on the <abbr title="Windows Presentation Foundation">WPF</abbr> team, I&#8217;m not tied to the platform. WPF and its alternatives (Flash, HTML, Apollo, Silverlight) each have advantages and disadvantages and choosing between them depends on your requirements. Since I&#8217;m doing a lot of work around reading experiences, I thought it was a good time to go back and re-evaluate the existing choices.</p>
<p>In this post, we&#8217;ll look at how each platform renders fonts at 9, 10, 12, and 14 points &#8212; sizes commonly used for reading. I&#8217;ve used three fonts:</p>
<ul>
<li>Verdana: The old standby, installed on many systems.</li>
<li>ITC Cheltenham: A serif frequently used in newspapers.</li>
<li>Gotham Rounded: A sans-serif that I happen to like.</li>
</ul>
<p>For no good reason, I&#8217;ve placed the results in alphabetical order. First up is Flash.</p>
<h3>Flash</h3>
<p>Up until a few years ago, Flash used to render fonts poorly at small sizes. Most authors worked around this limitation by changing the type of anti-aliasing used when displaying fonts. Flash provides two anti-aliasing options, one for readability and the other for animation. Additionally, Flash also allows the author to disable anti-aliasing altogether, and use aliased bitmap fonts. Flash 8 introduced <a href="http://www.rogerblack.com/blog/screen_fonts_from_adobes_view">a new rendering engine</a> that vastly improved the quality of small-type text.</p>
<p>At small sizes, the readability setting is (unsurprisingly) far superior to the animation setting. Here&#8217;s a sample of the readability anti-aliasing for Verdana at 10 point:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/flash-verdana-10-read.png" alt="10pt Verdana in Flash readability setting" /></p>
<p>For the same font and size, the animation setting is quite ugly:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/flash-verdana-10-anim.png" alt="10pt Verdana in Flash animation setting" /></p>
<p>Although it creates clearly more readable results, the readability smoothing creates a strange coloring affect that can be pretty noticeable at small sizes. Here&#8217;s Gotham Rounded at 9pt:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/flash-gotham-9-readability.png" alt="9pt Gotham Rounded in Flash readability setting" /></p>
<p>On my monitor, the effect is subtle, but noticeable &#8212; I see a bit of color around the edges of the letters.</p>
<h3>Flex / Apollo</h3>
<p>Apollo (through Flex) has <a href="http://livedocs.adobe.com/flex/2/docs/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Parts&#038;file=00000791.html">two different font rendering engines</a> &#8212; one of which seems to be shared with Flash (the documentation is a little vague here, so feel free to correct me if I&#8217;m wrong). The other rendering engine has access to installed fonts, and is <a href="http://livedocs.adobe.com/flex/201/html/wwhelp/wwhimpl/common/html/wwhelp.htm?context=LiveDocs_Book_Parts&#038;file=fonts_070_04.html">recommended for small type sizes</a> &#8212; however the quality is quite bad. From my simple tests, it seems that the fonts are always aliased, producing the jaggy look seen below:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/flex-verdana-10.png" alt="10pt Verdana in Flex" /></p>
<p>This aliased look is acceptable for some fonts, such as Verdana, that have reasonable bitmap representations at small sizes. However, for many fonts the result is unacceptable, such as this sample of Cheltenham at 10 point (from Flash set to bitmap, not Flex):</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/flash-cheltenham-10-bitmap.png" alt="10pt Cheltenham, Bitmap mode in Flash"/></p>
<p>Except for extreme cases, it looks like it&#8217;s best to use the Flash font rendering system when writing an Apollo (or Flex) application. <em>(Once again, I&#8217;m under-educated in the Apollo and Flex realms, feel free to drop some knowledge in the comments)</em></p>
<h3>HTML</h3>
<p>On my machine, the Firefox and Internet Explorer 6 both rendered extremely similar results. The Firefox rendering is shown below:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/html-cheltenham-10.png" alt="10pt Cheltenham in Firefox"/></p>
<p>The lack of subpixel positioning destroys the serif font at small sizes. You can see the effect at larger sizes as well &#8212; here is Cheltenham at 14 point:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/html-cheltenham-14.png" alt="14pt Cheltenham in Firefox"/></p>
<p>You can see the strange letter spacing in the first line &#8212; compare &#8220;Marketing&#8221; and &#8220;cross&#8221; to see the difference.</p>
<p>The sans-serif fonts fared better in the browser, with Verdana doing particularly well as it was <a href="http://www.will-harris.com/verdana-georgia.htm">specifically tuned for on-screen use</a>.</p>
<p>Internet Explorer 7 <a href="http://blogs.msdn.com/ie/archive/2006/02/03/524367.aspx">uses ClearType</a> for its font rendering, and should therefore produce results that are nearly identical to WPF.</p>
<h3>Silverlight</h3>
<p>Silverlight is the least mature of the platforms (since Apollo leverages both Flex and Flash). The 1.1 Alpha version that I tested unfortunately does not support for the Adobe CFF font format &#8212; meaning I was unable to test Cheltenham or Gotham Rounded. Silverlight doesn&#8217;t use the ClearType algorithm used by WPF, instead it uses <a href="http://silverlight.net/forums/t/454.aspx">gray scale anti-aliasing with gamma correction</a>. The results are generally good, with the clear weakness being at small sizes. Here is Verdana at 9pt in Silverlight:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/silverlight-verdana-9.png" alt="9pt Verdana in Silverlight" /></p>
<p>At this small size, Verdana looks a bit fuzzy. The effect is less noticeable at 10 point, but still there.</p>
<h3>WPF</h3>
<p>All text in WPF is rendered with ClearType &#8212; developers have no way of opting out of this (actually, there is a way, but it&#8217;s pretty awkward and not really well known). The quality of text at small sizes is impressive, here&#8217;s Gotham Rounded at 9pt in WPF:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/wpf-gotham-9.png" alt="10pt Cheltenham, Bitmap mode in Flash"/></p>
<p>It&#8217;s slightly fuzzy and a bit gray, but overall a bit better than the <a href="http://fortes.com/wp-content/uploads/2007/05/flash-gotham-9-readability.png">flash version</a>.</p>
<h3>Verdict</h3>
<p>Overall, the results are pretty good. The only engine with poor results is the native Flex engine, but with support for Flash, there&#8217;s a clear, easy to use alternative at your disposal.</p>
<p>Although the browsers work quite well with standard web fonts (and any other specifically tuned for small sizes), they are not an acceptable choice for traditional print fonts &#8212; especially Serif faces (Internet Explorer 7 being the exception). Considering the lack of cross-browser font-embedding, this probably isn&#8217;t a problem for most.</p>
<p>Silverlight is still a baby in this space, and it shows (there&#8217;s currently no way to set line height, for example). The anti-aliasing looks pretty good at larger sizes, but is noticeably fuzzy at smaller sizes. Although it&#8217;s better than what most browsers provide, it still has a way to go before catching up to Flash and WPF.</p>
<p>The final two contenders are Flash and WPF &#8212; and it&#8217;s a close call when it comes to rendering. Here are three side-by-side samples for WPF and Flash. The first is Verdana at 9 point (all samples show Flash with readability anti-aliasing):</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/wpf-flash-verdana-9.png" alt="WPF vs. Flash for Verdana 9 point"/></p>
<p>Although the Flash version has a nicer color, the WPF wins by a hair here, for being a bit smoother and less blurry (look at the &#8220;B&#8221; in &#8220;Branding&#8221; in the Flash version, third line from the bottom). Let&#8217;s move on to Gotham Rounded at 9pt:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/wpf-flash-gotham-9.png" alt="WPF vs. Flash for Gotham Rounded 9 point"/></p>
<p>Once again, Flash has stronger lines that WPF, but it&#8217;s uneven and has a bit of color fringing. Finally, let&#8217;s look at Cheltenham at 12 point:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/wpf-flash-cheltenham-12.png" alt="WPF vs. Flash for Cheltenham 12 point"/></p>
<p>This time, WPF is a bit darker than Flash. This one is really a toss-up and depends on personal preference. Flash is a bit sharper, but the WPF version is smoother and more consistent.</p>
<p>Overall, I think WPF has the edge when it comes to font rendering, although it&#8217;s quite close and could easily come down to user preference.</p>
<h3>Next Steps</h3>
<p>This analysis is a bit rough, there&#8217;s a bunch on my to-do list here, including:</p>
<ul>
<li>Testing FlashType in Flex and Apollo</li>
<li>Testing non-CFF fonts in Silverlight</li>
<li>IE 7, Mac OS, and Ubuntu screenshots</li>
<li>More fonts</li>
</ul>
<p>Also, the font rendering is just <em>one</em> aspect of a user&#8217;s reading experience. Obviously layout, performance, installation, and many other factors come in to play here. Subscribe to <a href="http://fortes.com/work/feed">feed</a> to make sure you don&#8217;t miss the next installments.</p>
<h3>Raw Results</h3>
<p>If you&#8217;re interested, here are the screenshots from each test application, in PNG format: <a href="http://fortes.com/wp-content/uploads/2007/05/fontrendering.zip">fontrendering.zip</a> (Zip, 500K)</p>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/05/25/font-rendering-in-across-rich-platforms/feed/</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>The Sad State of Online Advertising</title>
		<link>http://archive.fortes.com/2007/05/22/the-sad-state-of-online-advertising/</link>
		<comments>http://archive.fortes.com/2007/05/22/the-sad-state-of-online-advertising/#comments</comments>
		<pubDate>Tue, 22 May 2007 21:52:52 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/05/22/the-sad-state-of-online-advertising/</guid>
		<description><![CDATA[While reading an article in today&#8217;s New York Times, I saw the following sleazy ad: How tall is Paris? Answer correctly to receive your Pink Laptop You&#8217;ve probably seen this genre of ad before, which offers free merchandise for a trivial task &#8212; of course, the ads always state that &#8220;Details Apply&#8221; in tiny text [...]]]></description>
			<content:encoded><![CDATA[<p>While reading <a href="http://www.nytimes.com/2007/05/22/science/earth/22ander.html?ei=5087%0A&#038;em=&#038;en=01239fc7204acafc&#038;ex=1179979200&#038;pagewanted=all">an article</a> in today&#8217;s New York Times, I saw the following sleazy ad:</p>
<p class="screenshot img"><img src="http://fortes.com/wp-content/uploads/2007/05/nytimes-paris-hilton-ad.jpg" alt="Paris Hilton Ad in NYTimes" /></p>
<blockquote><p>How tall is Paris?</p>
<p>Answer correctly to receive your Pink Laptop</p></blockquote>
<p>You&#8217;ve probably seen this genre of ad before, which offers free merchandise for a trivial task &#8212; of course, the ads always state that &#8220;Details Apply&#8221; in tiny text (I wonder how the <abbr title="Federal Trade Commission">FTC</abbr> feels about these &#8220;details&#8221;).</p>
<p>As stupid as these ads are, they&#8217;re not much worse than the <a href="http://business.bostonherald.com/businessNews/view.bg?articleid=137549">advertisements for escort services</a> that you see in back pages of a <a href="http://www.thestranger.com/seattle/Home">free weeky</a> &#8212; but you&#8217;d never see one of those next to a top story in the print edition of the New York Times! </p>
<p>Why not? Money, of course. A prominent ad in the print edition of the NYT is far too expensive to be purchased by the low-class advertisers &#8212; and even if it were cheap enough, the NYT&#8217;s higher-end advertisers (luxury companies such as Tiffany&#8217;s, who spend <em>a lot</em> of money to consistently advertise in the paper) would never allow their brand to be anywhere near an ad like that.</p>
<p>But it turns out that Tiffany&#8217;s and other high-end advertisers don&#8217;t advertise on the web &#8212; because there&#8217;s no appropriate online advertising surface out there for them. This missing business causes two side-effects: </p>
<ol>
<li>The scummy advertisers aren&#8217;t priced out of the market</li>
<li>The Times, faced with low-revenues in their online edition, can&#8217;t be as choosy when it comes to advertisers</li>
</ol>
<h4>Broader Markets are Good</h4>
<p>One could mis-interpret my previous statements and say that I&#8217;m an advertiser snob, looking to price out the little guy. This, of course, is false. Even with <a href="http://www.marketingvox.com/archives/2006/07/24/online_advertising_to_reach_nine_percent_of_total_ad_spend_by_2011/">way less than ten percent</a> of the advertising market, the Internet has brought more advertisers into the market &#8212; this is undoubtedly a <em>good thing</em>.</p>
<p>Large publishers, like the Times, can (and should) still cater to the little guy. Unlike the print version, an online edition need not display the same advertisement for all readers in perpetuity. A digital publication can sell limited run, or niche-targeted advertisements at a lower total cost and higher visibility than they could in the one-size-fits-all print edition. In fact, I&#8217;m certain they already do so.</p>
<p>Publishers like the Times have to start being picky and demanding a certain level of quality from their advertisers. In the print world, it&#8217;s clear that advertisements are <em>part of the content</em> (look at any fashion magazine if you&#8217;re in doubt) &#8212; this attitude needs to extend to the digital realm.</p>
<h4>Moving toward a better future</h4>
<p>At Mix, I showed some <a href="http://fortes.com/2007/05/03/video-and-screenshots-from-the-mix-panel/">sketches of what online Magazines can become</a>. <a href="http://rogerblack.com/">Roger Black</a> and I are working to create higher-end content experiences that won&#8217;t dilute the brand of luxury advertisers. Rest assured, you won&#8217;t be asked to <a href="http://www.everything2.com/index.pl?node_id=448903">punch a monkey</a>.</p>
<p>It&#8217;s still early, so all I have to show are sketches &#8212; but there&#8217;s a lot of room for improvement in this space! I&#8217;m a bit surprised by the state we&#8217;re in today, because so many of today&#8217;s mistakes come from ignoring the lessons learned during decades of print publishing. Of course, digital is a different medium than print, which means that we need new plenty of new paradigms in order to succeed &#8212; but that just makes it all the more exciting!</p>
<h4>Update: Other Voices</h4>
<p>After writing this post, I found P.J. Onori&#8217;s excellent (and similarly-titled) article <a href="http://www.somerandomdude.net/blog/opinion/sorry-state-of-online-advertising/">The Sorry State of Online Advertising</a> &#8212; which I recommend. He makes similar points (and posted them first, so he wins):</p>
<blockquote><p>I would argue that the sheer number of advertisements some of these sites have on their site is evidence that the current ad model is not working. Instead of thinking of more original, symbiotic and user-friendly forms of advertising, most site creators have subscribed to the “more ads means more revenue” philosophy. This current relationship between the site creator and advertisers is much like a building landlord and a renter. Space is offered to the advertiser and other than the exchange of money, there is little to no relationship between the two. Under this model, the landlord attempts to rent out all the space to whoever offers money. The problem with this model is that if the landlord just rents out rooms to anyone without any discernment, the landlord’s property could be quickly destroyed by the renters. Meanwhile, the apartment building is in shambles and no one is interested to look at the space, much less rent it. Similarly, if a website does not carefully choose its advertisers, the web site could shortly be a ghost town. An interest in short-term gains can ultimately disenfranchise a site’s users to the point that they do not come back. Guess what, advertisers are going to drop you like a bad habit once you are not giving them what they want &#8211; click-throughs and revenue.</p></blockquote>
<p>Another article worth reading is <a href="http://www.younggogetter.com/2007/04/15/the-devil-online-advertising/">The Devil &#038; Online Advertising</a> by Darius A Monsef IV. Here&#8217;s an excerpt:</p>
<blockquote><p>Do you know why you only see those terrible, low-budget ads on your local television stations? Because it costs too much for those guys to hock their “Super-Mega-One-Day-Only-Sales-Extravaganza!” on national television. When the price point to advertise online is in the pennies per CPM, then you’re going to end up with low-quality advertisers.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/05/22/the-sad-state-of-online-advertising/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>UniformPanel</title>
		<link>http://archive.fortes.com/2007/05/07/uniformpanel/</link>
		<comments>http://archive.fortes.com/2007/05/07/uniformpanel/#comments</comments>
		<pubDate>Tue, 08 May 2007 02:49:06 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/05/07/uniformpanel/</guid>
		<description><![CDATA[A few months ago, Nick Thuesen posted his SpanningStackPanel class, which is basically a cross beween UniformGrid and StackPanel. Around that time, I was working on a project that called for exactly that layout. Unfortunately, Nick&#8217;s panel didn&#8217;t work in my application because he was modifying the Children collection in his code, which is a [...]]]></description>
			<content:encoded><![CDATA[<p>A few months ago, Nick Thuesen posted his <a href="http://www.nickthuesen.com/?p=15"><code>SpanningStackPanel</code></a> class, which is basically a cross beween <code>UniformGrid</code> and <code>StackPanel</code>. Around that time, I was working on a project that called for exactly that layout. </p>
<p>Unfortunately, Nick&#8217;s panel didn&#8217;t work in my application because he was modifying the <code>Children</code> collection in his code, which is a big no-no if you want to support databinding (e.g. in order to use it as the <code>ItemsPanel</code> within a <code>ListBox</code>). I ended up writing my own version, adding a few features that were required for the project.</p>
<p>At Mix, I promised Nick I&#8217;d post and get him the fixed source code. You can download the source (plus some basic tests) in the first version of the <a href="http://fortes.com/wp-content/uploads/2007/05/fortespanelpack.zip">Fortes Panel Pack</a> (currently &#8220;Pack&#8221; is a misnomer, since there&#8217;s only one &#8212; but I have a few more waiting to be packaged for external consumption).</p>
<p><strong>Features / Release Notes:</strong></p>
<ul>
<li>All the features of Nick&#8217;s original</li>
<li>Support for data-bound children</li>
<li>Special support for <code>Expander</code> children: Detects collapsed <code>Expander</code> elements and treats them as fixed-size elements</li>
<li>Bug: Support for <code>Expander</code> within a <code>Template</code> does not lay out correctly on the first pass &#8212; see the <code>DataBoundPanels.xaml</code> file in the sample project. Resizing the window, or any other action that causes a relayout, fixes the issue. (I&#8217;ll fix it in the next release)</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/05/07/uniformpanel/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Video and Screenshots from the Mix Panel</title>
		<link>http://archive.fortes.com/2007/05/03/video-and-screenshots-from-the-mix-panel/</link>
		<comments>http://archive.fortes.com/2007/05/03/video-and-screenshots-from-the-mix-panel/#comments</comments>
		<pubDate>Fri, 04 May 2007 06:14:09 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/05/03/video-and-screenshots-from-the-mix-panel/</guid>
		<description><![CDATA[Microsoft has posted videos from the Mix sessions, which means you can view the video of our panel online. There&#8217;s also a WMV version you can download directly (roughly 80 MB). Unfortunately, the production quality of the video isn&#8217;t very good. The video shows only the projection feed, which was fairly static except for about [...]]]></description>
			<content:encoded><![CDATA[<p>Microsoft has <a href="http://sessions.visitmix.com/">posted videos from the Mix sessions</a>, which means you can <a href="http://sessions.visitmix.com/default.asp?event=1015&#038;session=2013,2014&#038;pid=PAN04&#038;disc=&#038;id=1537&#038;year=2007&#038;search=PAN04">view the video of our panel</a> online. There&#8217;s also a <a href="http://int1.fp.sandpiper.net/soma/applications/silverlight/v1/videos/PAN04.wmv">WMV version you can download directly</a> (roughly 80 MB). </p>
<p>Unfortunately, the production quality of the video isn&#8217;t very good. The video shows only the projection feed, which was fairly static except for about 25 minutes worth of demos by myself and Tom Bodkin. Also, the projector in the room was running at 1280 by 720 pixels, which was then (stupidly) stretched to a different aspect ratio for the video. I&#8217;ve included a few non-stretched screenshots from my demo below:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/indigo-mixdemo-frontpage.jpg" alt="Indigo Demo - Front Page" /></p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/indigo-mixdemo-geicoad.jpg" alt="Indigo Demo - Geico Ad" /></p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/05/indigo-mixdemo-mostpopular.jpg" alt="Indigo Demo - Most Popular" /></p>
<p>If you don&#8217;t feel like watching the video, Tim Anderson has written a <a href="http://www.itwriting.com/blog/?p=207">good summary of the panel</a>. </p>
<p>During the session, I showed a demo that myself and Roger Black (amongst others) have been working on in the past couple of weeks. It&#8217;s a rendition of the English-language version of <a href="http://www.reporteindigo.com">Reporte Indigo</a>, a Mexican online weekly magazine currently done in Flash. Our goal was to show some of the directions we see online reading experiences moving toward: richer, branded layouts that look good across a variety of screen dimensions, integrated media, richer advertisements, and continued increases in community-driven features. My big fat mouth has more to say about this area, but that will have to wait until another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/05/03/video-and-screenshots-from-the-mix-panel/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Come See Me at Mix</title>
		<link>http://archive.fortes.com/2007/04/23/come-see-me-at-mix/</link>
		<comments>http://archive.fortes.com/2007/04/23/come-see-me-at-mix/#comments</comments>
		<pubDate>Mon, 23 Apr 2007 18:27:42 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/04/23/come-see-me-at-mix/</guid>
		<description><![CDATA[Those attending Mix 07 next week in Las Vegas might be interested in going to Beyond the Reader: Improving the Online Media Experience, a panel discussion featuring yours truly (along with Roger Black of The Font Bureau/Danilo Black and Tom Bodkin of the New York Times). It&#8217;s currently scheduled during the first timeslot on Wednesday [...]]]></description>
			<content:encoded><![CDATA[<p>Those attending <a href="http://visitmix.com/">Mix 07</a> next week in Las Vegas might be interested in going to <a href="https://content.visitmix.com/public/sessions.aspx">Beyond the Reader: Improving the Online Media Experience</a>, a panel discussion featuring yours truly (along with <a href="http://rogerblack.com/">Roger Black</a> of <a href="http://www.fontbureau.com/">The Font Bureau</a>/<a href="http://daniloblackusa.com/">Danilo Black</a> and <a href="http://en.wikipedia.org/wiki/Tom_Bodkin">Tom Bodkin</a> of the New York Times). It&#8217;s currently scheduled during the first timeslot on Wednesday morning.</p>
<p>Here&#8217;s the abstract:</p>
<blockquote><p>Is it really possible to make online narrative content glamorous? Smart designers are complementing their traditional strengths in branding and narrative with technologies such as WPF to create highly flexible, readable and vibrant online media products. See how designer-delivered digital media can work on-and-off-line, in-and-outside the browser. Envision next year’s portal digital world and how can you become part of it. For producers of newspapers, magazines, and TV content, this is the next Web.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/04/23/come-see-me-at-mix/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Block Elements</title>
		<link>http://archive.fortes.com/2007/04/09/block-elements/</link>
		<comments>http://archive.fortes.com/2007/04/09/block-elements/#comments</comments>
		<pubDate>Mon, 09 Apr 2007 23:22:20 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/04/09/block-elements/</guid>
		<description><![CDATA[Unlike Inline elements, Block elements take up the entire width of the text column and have line breaks before and after their content. By far, the most common block element is Paragraph. Here are the elements that shipped with WPF that derive from Block: Paragraph: With a straightforward name, this element (along with TextBlock) is [...]]]></description>
			<content:encoded><![CDATA[<p>Unlike <code>Inline</code> elements, <code>Block</code> elements take up the entire width of the text column and have line breaks before and after their content. By far, the most common block element is <code>Paragraph</code>.</p>
<p>Here are the elements that shipped with WPF that derive from <code>Block</code>:</p>
<ul>
<li><code>Paragraph</code>: With a straightforward name, this element (along with <code>TextBlock</code>) is the <em>only</em> container for <code>Inline</code> elements.</li>
<li><code>Section</code>: A container for other <code>Block</code> elements &#8212; analogous to <code>Span</code>, which contains <code>Inline</code> elements.</li>
<li><code>BlockUIContainer</code>: A container for <code>UIElement</code>-derived classes to be displayed as a block. Analogous to <code>InlineUIElement</code>.</li>
<li><code>List</code>: Creates an ordered or unordered list. Contains <code>ListItem</code> elements.</li>
<li><code>Table</code>: Contains <code>TableRowGroup</code></li>
<p> elements.
</ul>
<p>Additionally, there are a few helper classes that are a bit block-ish:</p>
<ul>
<li><code>ListItem</code>: <code>Block</code> container for use within a <code>List</code>.</li>
<li><code>TableRowGroup</code>: Container for <code>TableRow</code> objects.</li>
<li><code>TableRow</code>: Container for <code>TableCell</code> objects.</li>
<li><code>TableCell</code>: <code>Block</code> container for use within a <code>TableRow</code>.</li>
</ul>
<p>Just like the <a href="http://fortes.com/2007/03/29/inline-elements/">inline elements</a>, all of these elements do not derive from <code>UIElement</code> or <code>Visual</code> &#8212; this is because they do not have a one-to-one mapping between their content and visuals on screen. The reasons for this, and their ramifications, will have to wait for the next post.</p>
<h3>Differences from HTML</h3>
<ul>
<li><strong>No nested paragraphs:</strong> It&#8217;s worth re-iterating, because you&#8217;ll probably run into it some time.</li>
<li><strong>Strict structure for Lists and Tables</strong>: WPF is strict about the structure of Lists and, in particular, Tables. This leads to verbose markup.</li>
<li><strong>Only one <code>List</code>:</strong> Unlike HTML, there are no specialized elements for ordered and unordered list. You use the <code>MarkerStyle</code> property.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/04/09/block-elements/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inline Properties</title>
		<link>http://archive.fortes.com/2007/03/30/inline-properties/</link>
		<comments>http://archive.fortes.com/2007/03/30/inline-properties/#comments</comments>
		<pubDate>Fri, 30 Mar 2007 17:58:50 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/03/30/inline-properties/</guid>
		<description><![CDATA[Now that we&#8217;re roughly familiar with the inline elements, let&#8217;s look at the formatting properties each of them expose. Properties from TextElement TextElement is the superclass for all classes used for text (with the exception of TextBlock). TextElement defines formatting properties that can be applied universally to text. FontFamily Controls what is commonly known as [...]]]></description>
			<content:encoded><![CDATA[<p>Now that we&#8217;re roughly familiar with the <a href="http://fortes.com/2007/03/29/inline-elements/">inline elements</a>, let&#8217;s look at the formatting properties each of them expose.</p>
<h3>Properties from <code>TextElement</code></h3>
<p><code>TextElement</code> is the superclass for all classes used for text (with the exception of <code>TextBlock</code>). <code>TextElement</code> defines formatting properties that can be applied universally to text.</p>
<h4><code>FontFamily</code></h4>
<p>Controls what is commonly known as the &#8220;font&#8221; of the text. Like CSS, you can give a comma-separated list of alternatives such as <code>FontFamily="Calibri, Verdana, Helvetica, Arial"</code>. <del datetime="2007-04-06T18:00:27+00:00">Note that, unlike CSS, you cannot use generic names such as <code>Serif</code>, <code>Sans-Serif</code>, and <code>Monospace</code>.</del> <ins datetime="2007-04-06T18:00:27+00:00">Like CSS, there are a few generic names you can use: <code>Global Monospace</code>, <code>Global Serif</code>, <code>Global Sans Serif</code>, and <code>Global User Interface</code>.</ins></p>
<h4><code>FontSize</code></h4>
<p>The size of the font in &#8220;WPF pixels&#8221; (1/96 of an inch). Note that this is <em>not</em> equal to the traditional font size measure of points (1/72 or 1/72.27 of an inch depending on how precise you want to be). As with other measures, you can use shorthand in markup to get sizes in points, inches, etc (e.g. <code>FontSize="12pt"</code> or <code>FontSize="2cm"</code>).</p>
<h4><code>Foreground</code></h4>
<p>The color of the text. This property is actually a <code>Brush</code>, which means you can do cool things like <a href="http://fortes.com/2005/05/23/cffsupport/">draw text with a gradient</a>.</p>
<h4><code>FontWeight</code></h4>
<p>Controls the darkness of the font face &#8212; typically used to make text <strong>bold</strong>. This is a value between 1 and 999, or one of the following value shortcuts: <code>Thin</code>, <code>ExtraLight</code>, <code>Light</code>, <code>Normal</code>, <code>Medium</code>, <code>SemiBold</code>, <code>Bold</code>, <code>ExtraBold</code>, <code>Black</code>, <code>ExtraBlack</code>. Most fonts only have two weights (<code>Normal</code> and <code>Bold</code>) &#8212; but the nice ones that designers like <a href="http://www.linotype.com/472/futura-family.html">have many more</a>. If the font doesn&#8217;t have the weight you request, WPF will choose the weight closest to the value you specified.</p>
<h4><code>FontStyle</code></h4>
<p>Used to italicize text. There are three values: <code>Normal</code>, <code>Italic</code>, and <code>Oblique</code>. Almost every font defines special characters for the <code>Italic</code> style, while <code>Oblique</code> draws the same characters as <code>Normal</code>, but on a slant (inevitably looking worse, and being less readable, than the italic face). The difference is illustrated below:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/03/inlineproperties-italic-vs-oblique.png" alt="Examples of Italic, Oblique, and Normal-styled text" /></p>
<h4><code>FontStretch</code></h4>
<p>If a font has multiple faces with different widths, this allows you to choose between them. Valid values are between 1 and 9, but like <code>FontWeight</code>, there are named shortcuts: <code>UltraCondensed</code>, <code>ExtraCondensed</code>, <code>Condensed</code>, <code>SemiCondensed</code>, <code>Normal</code>, <code>SemiExpanded</code>, <code>Expanded</code>, <code>ExtraExpanded</code>, <code>UltraExpanded</code>. Unfortunately, only <a href="http://www.linotype.com/1560/univers-family.html">high-end</a> fonts come with these faces  (WPF will <em>not</em> algorithmically stretch a font).</p>
<h4><code>TextEffects</code></h4>
<p>Used to apply an effect to a piece of text. See my previous post on <a href="http://fortes.com/2007/03/16/texteffects/"><code>TextEffects</code></a> for a thorough description.</p>
<h4><code>Typography</code></h4>
<p>This property is very large, and merits (several) posts of it&#8217;s own. Basically, this property exposes the many of the <a href="http://www.microsoft.com/typography/otspec/TTOCHAP1.htm">advanced features available from OpenType fonts</a> (<abbr title="Also Known As">aka</abbr>, expensive fonts you probably don&#8217;t have but wish you did).</p>
<p>Here&#8217;s a list of the various options available through the property (I&#8217;ve already posted examples for some of these properties, I&#8217;ll add links as I write more samples &#8212; <strong>Warning:</strong> the XAML in those older posts is probably no longer valid due to namespace changes and property renames):</p>
<ul>
<li><code>AnnotationAlternates</code></li>
<li><code>Capitals</code>: Small caps, etc</li>
<li><code>CapitalSpacing</code></li>
<li><code>CaseSensitiveForms</code></li>
<li><a href="http://fortes.com/2005/03/10/contextualalternates/"><code>ContextualAlternates</code></a></li>
<li><a href="http://fortes.com/2005/03/09/ligatures/"><code>ContextualLigatures</code></a></li>
<li><code>ContextualSwashes</code></li>
<li><a href="http://fortes.com/2005/03/09/ligatures/"><code>DiscretionaryLigatures</code></a></li>
<li><code>EastAsianExpertForms</code></li>
<li><code>EastAsianLanguage</code></li>
<li><code>EastAsianWidths</code></li>
<li><a href="http://fortes.com/2005/04/02/fractions/"><code>Fraction</code></a></li>
<li><code>HistoricalForms</code></li>
<li><code>HistoricalLigatures</code></li>
<li><code>Kerning</code></li>
<li><code>MathematicalGreek</code></li>
<li><code>NumeralAlignment</code></li>
<li><a href="http://fortes.com/2005/05/27/numerals/"><code>NumeralStyle</code></a></li>
<li><code>SlashedZero</code></li>
<li><code>StandardLigatures</code></li>
<li><code>StandardSwashes</code></li>
<li><a href="http://fortes.com/2005/05/24/stylisticalternates/"><code>StylisticAlternates</code></a></li>
<li><code>StylisticSet1</code> through <code>StylisticSet20</code>: Yes, there are really twenty of them.</li>
<li><code>Variants</code>: Used for Subscript, Superscript, etc</li>
</ul>
<p>Phew, that was a long list! Lucky for you, there won&#8217;t be a test any time soon. Moving on &#8230;</p>
<h3>Properties from <code>Inline</code></h3>
<p>The <code>Inline</code> superclass defines three new properties that can be applied on inline text.</p>
<h4><code>TextDecorations</code></h4>
<p>This property lets you draw a horizontal line around the text &#8212; it&#8217;s mostly used to underline a word. There are four possible line positions: <code>Underline</code>, <code>Overline</code>, <code>Strikethrough</code>, and <code>Baseline</code>. <code>Underline</code> draws a bit below the baseline so the line doesn&#8217;t touch the (most of) the actual letters, while <code>Baseline</code> is drawn directly on the text baseline.</p>
<p>You may have noticed that the name of this property is plural, that&#8217;s because you can set more than one decoration for the text. Unfortunately, the syntax for this isn&#8217;t as clean as <code>TextDecorations="Underline Overline"</code>, you have to use much more verbose syntax:</p>
<pre><code class="xaml sch"><span class="sc3"></span><span class="re1">&lt;Run</span><span class="re2">&gt;</span>
  <span class="sc3"></span><span class="re1">&lt;Run</span>.<span class="me0">TextDecorations</span><span class="re2">&gt;</span>
    <span class="sc3"></span><span class="re1">&lt;TextDecoration</span> <span class="re0">Location</span>=<span class="st0">&quot;Underline&quot;</span> <span class="re2">/&gt;</span>
    <span class="sc3"></span><span class="re1">&lt;TextDecoration</span> <span class="re0">Location</span>=<span class="st0">&quot;Overline&quot;</span> <span class="re2">/&gt;</span>
  <span class="sc3"></span><span class="re1">&lt;/Run</span>.<span class="me0">TextDecorations</span><span class="re2">&gt;</span>
  Help! I&#x0027;m surrounded by lines
<span class="sc3"></span><span class="re1">&lt;/Run</span><span class="re2">&gt;</span></code></pre>
<p>Also, an individual <code>TextDecoration</code> has a <code>Pen</code> property, meaning you can choose the <code>Brush</code> used to draw the line, change the <code>Thickness</code>, or each use the <code>DashStyle</code> property to change how your underlines work (it will surely look awesome on your MySpace).</p>
<h4><code>BaselineAlignment</code></h4>
<p>This property allows you to vertically position an inline element within the line. The legal values are: <code>Bottom</code>, <code>Baseline</code>, <code>Center</code>, <code>Top</code>, <code>Subscript</code>, <code>Superscript</code>, <code>TextBottom</code>, and <code>TextTop</code>. The image shows the values in action:</p>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/03/inlineproperties-baseline-alignment.png" alt="Illustration of the values of the BaselineAlignment property" /></p>
<p>There are some <a href="http://msdn2.microsoft.com/en-us/library/system.windows.baselinealignment.aspx">fine typographic distinctions</a> between <code>TextTop</code>, <code>Top</code>, and <code>Superscript</code> (as well as their mirror values for the bottom) &#8212; but I&#8217;m guessing you don&#8217;t really care about those (they&#8217;re pretty much the same as CSS, if you really must know). </p>
<p>You probably won&#8217;t use this property very much, but it comes in handy when you&#8217;re dealing with non-text objects (i.e. things within an <code>InlineUIContainer</code>), or if you&#8217;re trying to create a fake subscript or superscript effect because your font doesn&#8217;t support the real thing.</p>
<h4><code>FlowDirection</code></h4>
<p>This property is useful if you&#8217;re including text from languages that use a right-to-left reading order (such as Arabic or Hebrew). It&#8217;s also exposed on many other elements, such as <code>FlowDocument</code> and all the <code>Block</code>-derived classes.</p>
<h3>&#8220;Content&#8221; properties of inlines</h3>
<p>Except for <code>LineBreak</code>, each <code>Inline</code> exposes a property that allows you to set it&#8217;s content. Unlike <code>Control.Content</code>, which is of type <code>object</code>, each of these properties is strongly-typed to the kind of content it can contain:</p>
<ul>
<li><code>Run.Text</code> of type <code>string</code></li>
<li><code>Span.Inlines</code> of type <code>InlineCollection</code></li>
<li><code>InlineUIContainer.Child</code> of type <code>UIElement</code></li>
</ul>
<p>Additionally, <code>Hyperlink</code> exposes a few properties (such as <code>NavigateUri</code>) so you can actually make a link functional.</p>
<p>Once again, we&#8217;ll skip over <code>Figure</code> and <code>Floater</code> for now &#8212; we don&#8217;t have enough background for them yet.</p>
<h3>Differences from HTML</h3>
<p>With the exception of <code>TextEffects</code> and <code>Typography</code>, these properties are quite similar to their <abbr title="Cascading StyleSheets">CSS</abbr> counterparts. You&#8217;ll run into slight spelling annoyances (CSS uses dashes in their names and values, while WPF does not, <code>href</code> is much easier to type than <code>NavigateUri</code>) &#8212; but you should feel pretty comfortable.</p>
<p>The exceptions would be the properties that don&#8217;t have CSS analogues: <code>TextEffects</code> and <code>Typography</code>. However, these properties aren&#8217;t used very frequently, so you rarely need to mess with the defaults.</p>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/03/30/inline-properties/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inline Elements</title>
		<link>http://archive.fortes.com/2007/03/29/inline-elements/</link>
		<comments>http://archive.fortes.com/2007/03/29/inline-elements/#comments</comments>
		<pubDate>Thu, 29 Mar 2007 21:54:20 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/03/29/inline-elements/</guid>
		<description><![CDATA[The term inline may be familiar if you know HTML and CSS &#8212; an inline element is displayed within an existing flow of text, positioned on lines of text shared with other inline elements. Let&#8217;s make this more clear with a screenshot and a bit of code: &#60;Border xmlns=&#34;http://schemas.microsoft.com/winfx/2006/xaml/presentation&#34; xmlns:x=&#34;http://schemas.microsoft.com/winfx/2006/xaml&#34; HorizontalAlignment=&#34;Center&#34; VerticalAlignment=&#34;Center&#34; BorderThickness=&#34;1&#34; BorderBrush=&#34;#ccc&#34; Padding=&#34;10&#34;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>The term <em>inline</em> may be familiar if you know HTML and <abbr title="Cascading StyleSheets">CSS</abbr> &#8212; an inline element is displayed within an existing flow of text, positioned on lines of text shared with other inline elements.</p>
<p>Let&#8217;s make this more clear with a screenshot and a bit of code:</p>
<pre><code class="xaml sch"><span class="sc3"></span><span class="re1">&lt;Border</span> <span class="re0">xmlns</span>=<span class="st0">&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> <span class="re0">xmlns:x</span>=<span class="st0">&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> <span class="re0">HorizontalAlignment</span>=<span class="st0">&quot;Center&quot;</span> <span class="re0">VerticalAlignment</span>=<span class="st0">&quot;Center&quot;</span> <span class="re0">BorderThickness</span>=<span class="st0">&quot;1&quot;</span> <span class="re0">BorderBrush</span>=<span class="st0">&quot;#ccc&quot;</span> <span class="re0">Padding</span>=<span class="st0">&quot;10&quot;</span><span class="re2">&gt;</span>
  <span class="sc3"></span><span class="re1">&lt;TextBlock</span> <span class="re0">TextAlignment</span>=<span class="st0">&quot;Left&quot;</span> <span class="re0">TextWrapping</span>=<span class="st0">&quot;Wrap&quot;</span> <span class="re0">Width</span>=<span class="st0">&quot;400&quot;</span> <span class="re0">FontSize</span>=<span class="st0">&quot;25&quot;</span> <span class="re0">FontFamily</span>=<span class="st0">&quot;Candara&quot;</span><span class="re2">&gt;</span>
    <span class="sc3"></span><span class="re1">&lt;Bold</span><span class="re2">&gt;</span>Of Montreal:<span class="sc3"></span><span class="re1">&lt;/Bold</span><span class="re2">&gt;</span>
    <span class="sc3"></span><span class="re1">&lt;Hyperlink</span> <span class="re0">Background</span>=<span class="st0">&quot;#cef&quot;</span><span class="re2">&gt;</span>Hissing Fauna, Are You The Destroyer?<span class="sc3"></span><span class="re1">&lt;/Hyperlink</span><span class="re2">&gt;</span>
    <span class="sc3"></span><span class="re1">&lt;Italic</span><span class="re2">&gt;</span>(2007)<span class="sc3"></span><span class="re1">&lt;/Italic</span><span class="re2">&gt;</span>
  <span class="sc3"></span><span class="re1">&lt;/TextBlock</span><span class="re2">&gt;</span>
<span class="sc3"></span><span class="re1">&lt;/Border</span><span class="re2">&gt;</span></code></pre>
<p class="img screenshot"><img src="http://fortes.com/wp-content/uploads/2007/03/inlines-sharedline.png" alt="The text 'Of Montreal: Hissing Fauna, Are You The Destroyer? (2007)'" /></p>
<p>In our example, we are using three inline elements: <code>Bold</code>, <code>Hyperlink</code>, and <code>Italic</code>. Each of these shares space on a line within our <code>TextBlock</code> (you can think of it as a paragraph). I added a background to the <code>Hyperlink</code> element to emphasize the fact that the element is broken across a line.</p>
<p>Here are all the elements shipped with WPF that derive from <code>Inline</code> (you can, of course, <a href="http://fortes.com/2007/03/20/bindablerun/">subclass and add your own</a>):</p>
<ul>
<li><code>Run</code>: A string of text.</li>
<li><code>Span</code>: A container for grouping other <code>Inline</code> elements. Its subclasses provide default formatting, and linking:
<ul>
<li><code>Bold</code></li>
<li><code>Italic</code></li>
<li><code>Underline</code></li>
<li><code>Hyperlink</code></li>
</ul>
</li>
<li><code>LineBreak</code>: Forces a hard line break within a text flow. Provided as a markup convenience (newline characters are honored if used within code).</li>
<li><code>InlineUIContainer</code>: A container for <code>UIElement</code>-derived classes within text.</li>
<li><code>AnchoredBlock</code>: I&#8217;ll cover these in detail later, but note that these cannot be used within a <code>TextBlock</code>
<ul>
<li><code>Floater</code></li>
<li><code>Figure</code></li>
</ul>
</li>
</ul>
<p>As <a href="http://fortes.com/2007/03/14/hidden-run/">I&#8217;ve mentioned before</a>, it&#8217;s rarely necessary to explicitly use <code>Run</code> when writing markup (although it&#8217;s important when writing code). The same mechanism is used with <code>InlineUIContainer</code> for convenience.</p>
<p><code>Span</code> and its subclasses are straightforward for those with experience with HTML, as is <code>LineBreak</code>.</p>
<p><code>Figure</code> and <code>Floater</code> don&#8217;t have direct analogues in HTML, but the functionality is similar to the <abbr title="Cascading StyleSheets">CSS</abbr> property <code>float</code>. More on these later.</p>
<h3>Differences from HTML</h3>
<p>If you&#8217;re already familiar with HTML/CSS, then the concepts in this entry are old news to you. For easy skim-reading, here are the major differences between WPF XAML markup and HTML markup for <em>inline elements</em>:</p>
<ul>
<li><strong>No semantic classes:</strong> This is a subtle, but important, point &#8212; the markup classes exposed in WPF have no semantics, they are <em>presentational</em> only.</li>
<li><strong>Once an <code>Inline</code>, always an <code>Inline</code>:</strong> This is partially a consequence of the previous point, but unlike CSS, you cannot change the display-type of an element &#8212; i.e. you can&#8217;t change an element from inline to block, or vice-versa. If you want to do that, you must change the elements used and the tree structure.</li>
<li><strong>Can&#8217;t nest paragraphs:</strong> The content model is strict, so you can&#8217;t directly put a block element within a <code>Paragraph</code> (we&#8217;ll learn how to do this via <code>InlineUIContainer</code> or an <code>AnchoredBlock</code> in later posts).</li>
<li><strong>Invisible container elements:</strong> <code>Run</code> and <code>InlineUIContainer</code> may not be in the markup, but they&#8217;re there if you walk the tree.</li>
</ul>
<p>Next, we&#8217;ll look at the properties you can apply to inline elements.</p>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/03/29/inline-elements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating WPF Text Layouts is Hard</title>
		<link>http://archive.fortes.com/2007/03/28/creating-wpf-text-layouts-is-hard/</link>
		<comments>http://archive.fortes.com/2007/03/28/creating-wpf-text-layouts-is-hard/#comments</comments>
		<pubDate>Wed, 28 Mar 2007 15:36:11 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/03/28/creating-wpf-text-layouts-is-hard/</guid>
		<description><![CDATA[I&#8217;ve heard many people ask for advice on creating attractive text layouts using WPF &#8212; with good reason! There are quite a few challenges, in my opinion, the top difficulties are: Differences from HTML/CSS: More than any other part of WPF, the System.Windows.Documents namespace has many similarities with HTML/CSS &#8212; but the differences are significant [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve heard many people ask for advice on creating attractive text layouts using <abbr title="Windows Presentation Foundation">WPF</abbr> &#8212; with good reason! There are quite a few challenges, in my opinion, the top difficulties are:</p>
<ol>
<li><strong>Differences from <abbr title="Hypertext Markup Language">HTML</abbr>/<abbr title="Cascading StyleSheets">CSS</abbr>:</strong> More than any other part of WPF, the <code>System.Windows.Documents</code> namespace has many similarities with HTML/CSS &#8212; but the differences are significant enough to cause real issues.</li>
<li><strong>Lack of good examples:</strong> The technology is still new, so there aren&#8217;t many role-models out there to learn from. The lack of view-source capability makes it tough to <del>steal</del> learn from others.</li>
<li><strong>Variable-column layout is hard:</strong> Without a doubt, designing a document that looks good when reflowed into a variable-number of columns is <strong>difficult</strong>.</li>
<li><strong>Lack of a designer:</strong> This is a tough one.</li>
</ol>
<p>It&#8217;s a bit ambitious, but I&#8217;m going to do what I can to help fix these problems.</p>
<p>Obviously, this will take many entries &#8212; let me know if I&#8217;m missing anything, or if you have specific questions you&#8217;d like me to address.</p>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/03/28/creating-wpf-text-layouts-is-hard/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>BindableRun</title>
		<link>http://archive.fortes.com/2007/03/20/bindablerun/</link>
		<comments>http://archive.fortes.com/2007/03/20/bindablerun/#comments</comments>
		<pubDate>Wed, 21 Mar 2007 00:32:35 +0000</pubDate>
		<dc:creator>fil</dc:creator>
				<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://archive.fortes.com/2007/03/20/bindablerun/</guid>
		<description><![CDATA[A useful feature that was left out of the first version of WPF is the ability to databind the value of Run.Text. I was still around when this feature was (unfortunately) cut &#8212; but don&#8217;t despair! It&#8217;s not actually that hard to write yourself. We&#8217;ll do this by creating a subclass of Run, which I&#8217;ve [...]]]></description>
			<content:encoded><![CDATA[<p>A useful feature that was left out of the first version of <abbr title="Windows Presentation Foundation">WPF</abbr> is the ability to databind the value of <code>Run.Text</code>. I was still around when this feature was (unfortunately) cut &#8212; but don&#8217;t despair! It&#8217;s not actually that hard to write yourself.</p>
<p>We&#8217;ll do this by creating a subclass of <code>Run</code>, which I&#8217;ve creatively named <code>BindableRun</code>.</p>
<pre><code class="csharp sch"><span class="kw1">using</span> <span class="kw5">System</span>;
<span class="kw1">using</span> <span class="kw5">System</span>.<span class="me1">Windows</span>;
<span class="kw1">using</span> <span class="kw5">System</span>.<span class="me1">Windows</span>.<span class="me1">Documents</span>;
&nbsp;
<span class="kw1">namespace</span> BindableText
<span class="br0">&#123;</span>
  <span class="co1">/// &lt;summary&gt;</span>
  <span class="co1">/// A subclass of the Run element that exposes a DependencyProperty property </span>
  <span class="co1">/// to allow data binding.</span>
  <span class="co1">/// &lt;/summary&gt;</span>
  <span class="kw1">public</span> <span class="kw4">class</span> BindableRun : Run
  <span class="br0">&#123;</span>
    <span class="kw1">public</span> <span class="kw1">static</span> <span class="kw1">readonly</span> DependencyProperty BoundTextProperty = DependencyProperty.<span class="me1">Register</span><span class="br0">&#40;</span><span class="st0">&quot;BoundText&quot;</span>, <span class="kw3">typeof</span><span class="br0">&#40;</span><span class="kw4">string</span><span class="br0">&#41;</span>, <span class="kw3">typeof</span><span class="br0">&#40;</span>BindableRun<span class="br0">&#41;</span>, <span class="kw3">new</span> PropertyMetadata<span class="br0">&#40;</span><span class="kw3">new</span> PropertyChangedCallback<span class="br0">&#40;</span>BindableRun.<span class="me1">onBoundTextChanged</span><span class="br0">&#41;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;
&nbsp;
    <span class="kw1">private</span> <span class="kw1">static</span> <span class="kw1">void</span> onBoundTextChanged<span class="br0">&#40;</span>DependencyObject d, DependencyPropertyChangedEventArgs e<span class="br0">&#41;</span>
    <span class="br0">&#123;</span>
      <span class="br0">&#40;</span><span class="br0">&#40;</span>Run<span class="br0">&#41;</span> d<span class="br0">&#41;</span>.<span class="me1">Text</span> = <span class="br0">&#40;</span><span class="kw4">string</span><span class="br0">&#41;</span> e.<span class="me1">NewValue</span>;
    <span class="br0">&#125;</span>
&nbsp;
    <span class="kw1">public</span> <span class="kw4">String</span> BoundText
&nbsp;
      get <span class="br0">&#123;</span> <span class="kw1">return</span> <span class="br0">&#40;</span><span class="kw4">string</span><span class="br0">&#41;</span>GetValue<span class="br0">&#40;</span>BoundTextProperty<span class="br0">&#41;</span>; <span class="br0">&#125;</span>
      set <span class="br0">&#123;</span> SetValue<span class="br0">&#40;</span>BoundTextProperty, value<span class="br0">&#41;</span>; <span class="br0">&#125;</span>
    <span class="br0">&#125;</span>
  <span class="br0">&#125;</span>
<span class="br0">&#125;</span></code></pre>
<p>The code is pretty straightforward, we create a new <code>DependencyProperty</code> <a href="http://msdn2.microsoft.com/en-us/library/ms753358.aspx">in the usual manner</a>. Then we add a <code>PropertyChangedCallback</code> that manually sets the <code>Text</code> property. That&#8217;s it! We rely on the base class to take care of everything else.</p>
<p>You can use this in <abbr title="eXtensible Application Markup Language>XAML</abbr> the same way you would any other classes in a <abbr title="Dynamically Linked Library">DLL</abbr>, by declaring an <abbr title="eXtensible Markup Language">XML</abbr> namespace and linking it to a <abbr title="Common Language Runtime">CLR</abbr> namespace, as in the example below:</p>
<pre><code class="xaml sch"><span class="sc3"></span><span class="re1">&lt;Page</span> <span class="re0">xmlns</span>=<span class="st0">&quot;http://schemas.microsoft.com/winfx/2006/xaml/presentation&quot;</span> <span class="re0">xmlns:x</span>=<span class="st0">&quot;http://schemas.microsoft.com/winfx/2006/xaml&quot;</span> <span class="re0">xmlns:bt</span>=<span class="st0">&quot;clr&#x002D;namespace:BindableText;assembly=BindableText&quot;</span><span class="re2">&gt;</span>
  <span class="sc3"></span><span class="re1">&lt;FlowDocumentScrollViewer</span><span class="re2">&gt;</span>
    <span class="sc3"></span><span class="re1">&lt;FlowDocument</span><span class="re2">&gt;</span>
      <span class="sc3"></span><span class="re1">&lt;Paragraph</span><span class="re2">&gt;</span>
        You can control the value of this text through the TextBox below: <span class="sc3"></span><span class="re1">&lt;bt:BindableRun</span> <span class="re0">FontWeight</span>=<span class="st0">&quot;Bold&quot;</span> <span class="re0">BoundText</span>=<span class="st0">&quot;{Binding ElementName=tb, Path=Text}&quot;</span> <span class="re2">/&gt;</span>
      <span class="sc3"></span><span class="re1">&lt;/Paragraph</span><span class="re2">&gt;</span>
      <span class="sc3"></span><span class="re1">&lt;BlockUIContainer</span><span class="re2">&gt;</span>
        <span class="sc3"></span><span class="re1">&lt;TextBox</span> <span class="re0">Name</span>=<span class="st0">&quot;tb&quot;</span> <span class="re0">Text</span>=<span class="st0">&quot;This is text with spaces that wraps across a line ... like this!&quot;</span><span class="re2">/&gt;</span>
      <span class="sc3"></span><span class="re1">&lt;/BlockUIContainer</span><span class="re2">&gt;</span>
    <span class="sc3"></span><span class="re1">&lt;/FlowDocument</span><span class="re2">&gt;</span>
  <span class="sc3"></span><span class="re1">&lt;/FlowDocumentScrollViewer</span><span class="re2">&gt;</span>
<span class="sc3"></span><span class="re1">&lt;/Page</span><span class="re2">&gt;</span></code></pre>
<p>If you&#8217;re running this in XamlPad, you&#8217;ll have to make sure that the <tt>BindableRun.dll</tt> file is in the same directory as XamlPad itself. You can do this by either creating a new copy of <tt>XamlPad.exe</tt> or copying the <tt>BindableRun.dll</tt> into the directory where you keep XamlPad (<tt>C:\Program Files\Microsoft SDKs\Windows\v6.0\Bin</tt> in my case).</p>
<p>If you want to download this class, I&#8217;ve created a project (with the <abbr title="Dynamically Linked Library">DLL</abbr>) that you can download and use: <a href="http://fortes.com/wp-content/uploads/2007/03/bindabletext.zip">BindableText.zip</a> (13 <abbr title="Kilobytes">KB</abbr>). </p>
<p><ins datetime="2007-03-21T16:04:01+00:00"><strong>Update 3/21:</strong> Paul Stovell <a href="http://www.paulstovell.net/blog/index.php/attached-bindablerun/"> mentions an alternate technique</a> that creates an attached property instead of a subclass to achieve the same effect.</ins></p>
]]></content:encoded>
			<wfw:commentRss>http://archive.fortes.com/2007/03/20/bindablerun/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 2.226 seconds -->
