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.
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 Text.fontContext
)
An AS3 Command line executable (made with redtamarin) 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).
Use it to add more supported fonts for build in test (Waterfall demo). For generate font cache files simply use console: fcgen embed_fonts.swf
(or use --help
for display help), put generated files (by default *.foncache
) in fontcache folder and update fontlist.xml
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 “open”).
Not realy important but used for generated the template used in library for generate dynamically SWF file contain fonts data.
Here miss an other part used to modify the SWF template for keep only needed informations (remove debug, metadata …)
And finally an example to embed font with Flex SDK.
I’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 CJK texts. We use a (temporary ?) solution by caching requested files and serve again for same requests. This not include in sources.
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.
No licence explicitly declared but sure i think as GPL, no AS3 package, more examples, SVN, dedicated page, real name, logo … this will come.
Je viens de mettre au point un systĂšme qui permet d’utiliser des polices embarquĂ©es, mais seulement de charger les caractĂšres nĂ©cessaires.
Le systĂšme est simple :
La police Arial Unicode MS, contient la majoritĂ© des plages unicodes : Latin, CJK (Chinois, Japonais, CorĂ©en), Cyrillique, HĂ©breu, …
A titre d’information :
Total 31,48Mo (56,81Mo)
L’AS3 Ă permis d’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’a pas forcĂ©ment d’intĂ©rĂȘt immĂ©diat. Seulement, le fait de pouvoir modifier/gĂ©nĂ©rer les donnĂ©es binaires d’un SWF et de les charger pour les rĂ©cuperer sous forme native, ça change pas mal de choses !
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 son, du code ActionScript, ou pour une police embarquĂ©e. C’est ce dernier point, qui m’intĂ©resse et qui n’a pas encore vraiment Ă©tĂ© explorĂ©.
Pour ce faire, j’ai appris Ă lire les donnĂ©es brut du format SWF : demo, sources
Attention les logs gĂ©nĂ©rĂ©s sont assez lourds ~1Mo pour un SWF d’environ 30Ko contenant seulement une police embarquĂ©.
Ca lit les donnĂ©es global d’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 …). Il faudra ensuite que je fasse l’opĂ©ration inverse : gĂ©nerer les donnĂ©es nĂ©cĂ©ssaire Ă l’intĂ©gration d’une police dans un SWF.
Liens :