<?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>Handnotes &#187; fstream</title>
	<atom:link href="http://memmie.lenglet.name/tag/fstream/feed" rel="self" type="application/rss+xml" />
	<link>http://memmie.lenglet.name</link>
	<description>Some tests, tricks and sugar</description>
	<lastBuildDate>Sat, 03 Oct 2009 14:49:56 +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>Font streaming</title>
		<link>http://memmie.lenglet.name/flash/actionscript/font-streaming</link>
		<comments>http://memmie.lenglet.name/flash/actionscript/font-streaming#comments</comments>
		<pubDate>Sun, 19 Jul 2009 01:32:26 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[fstream]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=64</guid>
		<description><![CDATA[Update: Now the project is on google code A promise is a promise Now you can download sources of my library handling progressive download of fonts for Flash. I clean up all to separate different works. 1. Waterfall demo Main demo proof of concept. Demonstrate the system with non embed fonts where chars are loaded [...]]]></description>
			<content:encoded><![CDATA[<p><ins>Update: Now the project is on <a href="http://code.google.com/p/fstream/">google code</a></ins></p>
<p>A promise is a promise <img src='http://memmie.lenglet.name/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  Now you can download sources of my library handling progressive download of fonts for Flash.</p>
<p>I clean up all to separate different works.</p>
<h3>1. Waterfall demo</h3>
<p><a href="http://memmie.lenglet.name/documents/lab/fontstream/waterfall_demo.html"><img src="http://memmie.lenglet.name/wp-content/uploads/2009/07/fontstream.png" alt="Font stream waterfall demo" title="Font stream waterfall demo" /></a></p>
<p>Main demo proof of concept. Demonstrate the system with non embed fonts where chars are loaded when them entered. Also give an example to the usage with Flex on custom components (through <code>Text.fontContext</code>)</p>
<h3>2. Font cache generator</h3>
<p>An AS3 Command line executable (made with <a href="http://code.google.com/p/redtamarin/">redtamarin</a>) allow quickly generate fonts cache. A binary file format used to serve fast small amount of font data (optionaly a format used to storage data).</p>
<p>Use it to add more supported fonts for build in test (Waterfall demo). For generate font cache files simply use console: <code>fcgen embed_fonts.swf</code> (or use <code>--help</code> for display help), put generated files (by default <code>*.foncache</code>) in fontcache folder and update <code>fontlist.xml</code></p>
<p>This contains also 2 others version, an old version in AS3/SWF by passing the SWF file by clicking on stage first and save the result by click second, and an not working flex alternative (read only some information about the SWF file passing through the button &#8220;open&#8221;).</p>
<h3>3. SWF template base</h3>
<p>Not realy important but used for generated the template used in library for generate dynamically SWF file contain fonts data.</p>
<p>Here miss an other part used to modify the SWF template for keep only needed informations (remove debug, metadata &#8230;)</p>
<p>And finally an example to embed font with Flex SDK.</p>
<h3>Notice</h3>
<p>I&#8217;m currently work on a big multilingual project which use it. But the server get in trouble (we suppose) with PHP when handling huge file like for Arial Unicode MS for <abbr title="Chinese Japanese and Korean">CJK</abbr> texts. We use a (temporary ?) solution by caching requested files and serve again for same requests. This not include in sources.</p>
<p>Beyond, is hard to get styles applied on HTML text. This for what, I had create a class handling HTML text and parsing it to know used text/fonts, improve HTML support by TextField (by some hack and HTML transformations). Is not yet include in souces.</p>
<ul>
<li>Can have memory impact or CPU time when intensive usage for large range of chars (need be more tested)</li>
<li>Not all font information supported, but maybe no real impact (Small text ? and language code ? )</li>
<li><strong>Server performance</strong> (PHP parsing and generating are time consumer) (need enhance by optimizing the script or use an other language like C/C++ or use a DB for stocking gyphs data instead a unique file)</li>
<li>Only TextField can use it, not supported by new Flash 10 TextEngine, it use an other way to embed font (CFF Fonts) (need support DefineFont4 tag)</li>
<li>The font embedded by Flash are cleaner than Flex SDK, but Flash CS3 allow generate fake italic and bold whereas Flash CS4 allow used real font styles (Light, Condensed, Heavy &#8230;)</li>
</ul>
<p>No licence explicitly declared but sure i think as GPL, no AS3 package, more examples, SVN, dedicated page, real name, logo &#8230; this will come.</p>
<p><del><a href="http://memmie.lenglet.name/documents/lab/fontstream/FontStream.zip">Download it</a> ~50Mo</del> <ins><a href="http://code.google.com/p/fstream/downloads/list">Download it on google code</a></ins></p>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/actionscript/font-streaming/feed</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Streaming de polices</title>
		<link>http://memmie.lenglet.name/flash/actionscript/streaming-de-polices</link>
		<comments>http://memmie.lenglet.name/flash/actionscript/streaming-de-polices#comments</comments>
		<pubDate>Sun, 15 Mar 2009 18:36:01 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Typography]]></category>
		<category><![CDATA[fstream]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=33</guid>
		<description><![CDATA[Je viens de mettre au point un système qui permet d&#8217;utiliser des polices embarquées, mais seulement de charger les caractères nécessaires. Le système est simple : Le server de streaming Il va s&#8217;occuper de la sélection des caractères à retourner en fonction de ceux demandés. Le client Il va s&#8217;occuper de faire le choix des [...]]]></description>
			<content:encoded><![CDATA[<p>Je viens de mettre au point un système qui permet d&#8217;utiliser des polices embarquées, mais seulement de charger les caractères nécessaires.</p>
<p>Le système est simple :</p>
<dl>
<dt>Le server de streaming</dt>
<dd>Il va s&#8217;occuper de la sélection des caractères à retourner en fonction de ceux demandés.</dd>
<dt>Le client</dt>
<dd>Il va s&#8217;occuper de faire le choix des caractères nécessaires (en fonction du texte à afficher) ainsi que le leur rapatriement et l&#8217;intégration aux polices à utiliser.</dd>
</dl>
<p><img src="http://memmie.lenglet.name/wp-content/uploads/2009/03/scheme.png" alt="SWF to Font cache to SWF" title="Font stream scheme" /></p>
<p><a href="/documents/lab/fontstream/waterfall_demo.html">Voir la démo</a></p>
<p>La police Arial Unicode MS, contient la majorité des plages unicodes : Latin, CJK (Chinois, Japonais, Coréen), Cyrillique, Hébreu, &#8230;</p>
<p>A titre d&#8217;information :</p>
<ul>
<li>ShinGoPro-Medium_regular.fontcache 3,38Mo (A-OTF-ShinGoPro-Medium.otf 3,11Mo)</li>
<li>Arial Unicode MS_regular.fontcache 9,96Mo (Arial Unicode MS.otf 23,28Mo)</li>
<li>CodingFontTobi_regular.fontcache 53Ko (cft.ttf 47Ko)</li>
<li>Coca Cola ii_regular.fontcacheCoca 20Ko (Cola ii.ttf 58Ko)</li>
<li>Futura_boldItalic.fontcache 27Ko (Futura Bold Italic.ttf 35Ko)</li>
<li>Futura_bold.fontcache 25Ko (Futura Bold.ttf 34Ko)</li>
<li>Futura Heavy_regular.fontcache 28Ko (Futura-Heavy.otf 17Ko)</li>
<li>Futura Heavy_italic.fontcache 29Ko (Futura-HeavyOblique.otf 17Ko)</li>
<li>Futura Light_regular.fontcache 29Ko (Futura-Light.otf 17Ko)</li>
<li>Futura_italic.fontcache 29Ko (Futura-Oblique.otf 16Ko)</li>
<li>Futura Heavy_regular.fontcache 28Ko (Futura.otf 16Ko)</li>
<li>Futura Condensed_regular.fontcache 28Ko (FuturaCondMedium.otf 22Ko)</li>
<li>Microsoft YaHei_bold.fontcache 8,7Mo (Microsoft YaHei Bold.otf 14,69Mo)</li>
<li>Microsoft YaHei_regular.fontcache 8,89Mo (Microsoft YaHei.otf 15,04Mo)</li>
<li>SegoeUI_regular.fontcache 252Ko (segoeui.ttf 415Ko)</li>
</ul>
<p>Total 31,48Mo (56,81Mo)</p>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/actionscript/streaming-de-polices/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Cadratin &#8211; part 1</title>
		<link>http://memmie.lenglet.name/flash/actionscript/cadratin-part-1</link>
		<comments>http://memmie.lenglet.name/flash/actionscript/cadratin-part-1#comments</comments>
		<pubDate>Mon, 26 May 2008 23:35:32 +0000</pubDate>
		<dc:creator>Mem's</dc:creator>
				<category><![CDATA[AS3]]></category>
		<category><![CDATA[ActionScript]]></category>
		<category><![CDATA[fstream]]></category>

		<guid isPermaLink="false">http://memmie.lenglet.name/?p=21</guid>
		<description><![CDATA[L&#8217;AS3 à permis d&#8217;ouvrir la porte à pas mal de choses dont 2 intéressantes : la gestion native de ByteArray et le chargement dynamique de SWF à partir de données contenu dans un ByteArray. Dit comme ça, ça n&#8217;a pas forcément d&#8217;intérêt immédiat. Seulement, le fait de pouvoir modifier/générer les données binaires d&#8217;un SWF et [...]]]></description>
			<content:encoded><![CDATA[<p>L&#8217;AS3 à permis d&#8217;ouvrir la porte à pas mal de choses dont 2 intéressantes : la gestion native de ByteArray et le chargement dynamique de SWF à partir de données contenu dans un ByteArray.</p>
<p>Dit comme ça, ça n&#8217;a pas forcément d&#8217;intérêt immédiat. Seulement, le fait de pouvoir modifier/générer les données binaires d&#8217;un SWF et de les charger pour les récuperer sous forme native, ça change pas mal de choses !<br />
Image, vidéo ou vectoriel bon ça on peut déjà le faire nativement avec BitmapData et Video ou Shape. Mais on peux aussi le faire pour du <a href="http://www.flashcodersbrighton.org/wordpress/?p=9">son</a>, du code <a href="http://eval.hurlant.com/">ActionScript</a>, ou pour une police embarquée. C&#8217;est ce dernier point, qui m&#8217;intéresse et qui n&#8217;a pas encore vraiment été exploré.</p>
<p>Pour ce faire, j&#8217;ai appris à lire les données brut du format SWF : <a href="/documents/lab/cadratin/index.html">demo</a>, <a href="/documents/lab/cadratin/Cadratin.zip">sources</a><br />
Attention les logs générés sont assez lourds ~1Mo pour un SWF d&#8217;environ 30Ko contenant seulement une police embarqué.</p>
<p>Ca lit les données global d&#8217;un SWF (dimensions, couleur de fond, bibliothèque) ainsi que tout la partie qui gère les polices (le nom de la police, les données de dessins des glyphs &#8230;). Il faudra ensuite que je fasse l&#8217;opération inverse : génerer les données nécéssaire à l&#8217;intégration d&#8217;une police dans un SWF.</p>
<p>Liens :</p>
<ul>
<li><a href="http://en.wikipedia.org/wiki/Em_%28typography%29">Em</a></li>
<li><a href="http://fr.wikipedia.org/wiki/Cadratin">Cadratin</a></li>
<li><a href="http://www.m2osw.com/fr/swf_alexref.html">Alexis&#8217; SWF Reference</a> <a href="/web-archive/swf_alexref.html">Mirror</a></li>
<li><a href="http://developer.apple.com/textfonts/TTRefMan/RM08/appendixE.html">Converting Outlines to the TrueType Format</a></li>
<li><a href="http://code.google.com/p/flash-decompiler/">flash-decompiler</a></li>
<li><a href="http://steve.hollasch.net/cgindex/curves/cbez-quadspline.html">Converting Bezier Curves to Quadratic Splines</a></li>
<li><a href="http://lab.libspark.org/trac/browser/as3/ByteCodeDisassembler">ByteCodeDisassembler</a></li>
<li><a href="http://xmlgraphics.apache.org/fop/">Formatting Objects Processor</a></li>
<li><a href="http://jnode.org/">JNode</a></li>
<li><a href="http://www.pdfbox.org/">PDFBox</a></li>
<li><a href="http://www.libming.org">Ming</a></li>
<li><a href="http://sourceforge.net/projects/jarexplorer/">Jar Explorer (with JODE)</a></li>
<li><a href="http://java.sun.com/j2se/1.5.0/docs/api/java/awt/Font.html#createFont(int,%20java.io.InputStream)">java.awt.Font</a></li>
<li><a href="http://www.sephiroth.it/weblog/archives/2007/07/fontreader_convert_truetype_fonts_in.php">Ming</a> – by sephiroth / Alessandro Crugnola</li>
<li><a href="http://www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v9.pdf">SWF file format specification</a></li>
<li><a href="http://www.half-serious.com/swf/format/">Macromedia Flash File Format (SWF)</a></li>
<li><a href="http://www.codeplex.com/swf">SWF.Net</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://memmie.lenglet.name/flash/actionscript/cadratin-part-1/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
