FontReader, convert TrueType fonts in graphics with Flex

In the last period I was trying to find a way to convert a TrueType font character into graphics for a new Flex project.
First I found a way using TTX which can convert a font file into an XML with all the Glyph informations needed to recreate the font outline.

But this process requires that all the .ttf files should be converted using TTX before thay can be used in Flash.
So I investigated a bit more and I found a really useful and really well done java project: TypeCast.
What I’ve done next was just to do a porting of the available java code into Actionscript 3 and it works like a charm! It can read a .ttf file and extracts all the font informations, including all the glyph outlines.

See a demonstration of thie Flex application.

Here you can download the source code:
[attachments docid=1026 force_saveas=”1″ logged_users=”0″]

senocular.com TransformTool modification

Recently I used the great senocular Transform Tool for a Flex2 project.
We just needed to made a little modification to the way the scale transformation worked. Something like the Photoshop’s Transform tool, where the registration point only affects rotation, while all the scale controls are independent from the registration point.
For this reason I modified a bit the TransformTool code to allow this feature to be set on/off (I called this scaleWithRegistration)

Hold down SHIFT key while rotating or scaling to constrain transformation
Double click to complete transformation.

[kml_flashembed publishmethod=”static” fversion=”10.0.22″ movie=”http://blog.sephiroth.it/wp-content/uploads/2007/07/test_transformation.swf” width=”400″ height=”300″ targetclass=”flashmovie” bgColor=”#cccccc”]

Get Adobe Flash player

[/kml_flashembed]

This is the code used in the mxml Application file:

< ?xml version="1.0" encoding="utf-8"?>



< ![CDATA[ import com.senocular.display.TransformTool; [Bindable] private var tool:TransformTool; private function init():void { } private function onImageComplete(event:Event):void { var timer:Timer = new Timer(1000,1); timer.addEventListener(TimerEvent.TIMER, function(evt:TimerEvent):void { createTool(null); }); timer.start(); image.addEventListener(MouseEvent.CLICK, createTool); } private function onDoubleClick(event:MouseEvent):void { removeChild(tool); tool = null; } private function createTool(event:MouseEvent):void { if(!tool) { tool = new TransformTool(); tool.addEventListener(MouseEvent.DOUBLE_CLICK, onDoubleClick); tool.target = image; tool.scaleWithRegistration = scale_registration.selected; addChild(tool); } } ]]>



[attachments docid=1018 force_saveas=”1″ logged_users=”0″]

New Firefox search plugins!

Thanks to Ofir Shemesh here are some new Firefox search plugins for Flex developers.

  • FlexCoders archive (search Flexcodes mailing list archived at MailArchive. also hosted at http://mycroft.mozdev.org but it is not updated. they do not archive very often so it is a “so so” source for info)
  • Flexcodes @ Nabble (search Flexcodes mailing list archived at Nabble. not hosted anywhere, it is new. they are archiving every few minutes so it is the best way to search flexcoders and their browsing format is the more convenient)
  • Flex2 – LiveDocs (as it says search at Flex 2 LiveDocs. it is also hosted at http://mycroft.mozdev.org)
  • Flexcomponents @ MailArchive – search Flexcomponents mailing list archived at MailArchive – they do not archive very often so it is a “so so” source for info.
  • Flexcomponents @ Nabble – search Flexcomponents mailing list archived at Nabble – they are archiving every few minutes so it is the best way to search flexcoders and their browsing format is MUCH more convenient

P. S. Click on the search plugin title to install for your Firefox