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

Papervision3D component for Flash CS3

John Grden just released an amazing component for Flash CS3 for manage papervision3d on Flash IDE.

– Design-time render and editing in Flash IDE
– 3 Material types supported – BitmapFileMaterial, BitmaAssetMaterial and MovieAssetMaterial
– Creates MovieScene3D and Free or Target camera
– Manages resizing / centering of Papervision3D scene [optional]
– Dynamic masking to constrain the viewable render area to the bounds of the component [optional]
– Full API and access to Scene, Camera, Collada objects to code around
– Automatically loads materials via Collada file [when materials list is not given]
– New Custom Panel for modifying rotation, camera zoom, camera focus, camera Z at design-time

Download component here
See the presentation video

Papervision3D at google code: http://code.google.com/p/papervision3d/

Kuler Flash CS3 Panel

Yesterday I found this really useful extension for Adobe Flash CS3.
This extension adds to your Flash IDE a kuler panel which allows you to navigate through all the most rated, popular and newest kuler themes. There is also a search feature.

When a theme is clicked this extension creates a new layer in your flash document with as many coloured boxes as the clicked theme.

Download the extension here

For those who don’t know what is kuler, read the f.a.q. here:  http://kuler.adobe.com/links/kuler_help.html

Apple Safari for Windows. Terrible!

Probably you know that Apple just released a public beta version of its web browser Safari for Windows.

Why don’t try it out? So, after Internet Explorer, Firefox and Opera I downloaded and installed it immediately just for curiosity, even if looking at the demo I saw they forced the application UI to be like OSX rather than following the Windows standards (like for iTunes).
And this is the first reason I dont like Apple applications for Windows (I’m on pc, not on a mac and I dont want to have a mac UI!).

Ok, I’ve installed it and uninstalled just after 5 minutes. I can understand it’s just a beta, but quite all the pages I tested are weird with lot of things missing, the HTML isn’t rendered as I expected.
I did just a search on google as first attempt but the result page was unreadable at all!

Some minor issues:
why the font smoothing can be changed in the application preferences? On Windows the font smoothing it’s set in the OS preferences, so just use that value.

During these 5 minutes I found many other issues, but I really think this is due to the fact it’s still the first public beta..

Flash Switcher extension updated

Yesterday I updated my previous flash switcher extension due to some changes in the latest release of Firefox 2.0.3 which caused the extension to stop working.
Moreover Adobe continues to change the path of the flash player installation dir.. because of this you should first uninstall your current flash player before using this extension.
The Flash player uninstaller is available here.

I’ve also included a brief help on how-to add more player versions available for this extension. Just open the ‘help’ menu item from the extension’s menu.

What

I’ve tested both on my Windows Vista business and Windows XP and it seems to work correctly, but feel free to report bugs to me..
Actuallt i’ve included these flash player versions:

  • 4.0 r28
  • 6.0 r79
  • 7.0 r63
  • 8.0 r24
  • 9.0 r28
  • 9.0 r45

What’s flash switcher?
Flash switcher is a Firefox extension (the icon will be installed in the right status bar of your browser) which lets you to switch between various flash player versions without using uninstallers/installers.

This new version is available only for Firefox 2.0.3 and above.

Download the Flash switcher extension.
Be sure to uninstall all previous flash switcher extensions from firefox before install this new one