Chuck It – Thomas Pujolle's blog

All the useful stuff I come across to everyday.

[Work] www.yesdayes.com

Finally!

After so many modification in the code over the months, the flash website of the French digital agency Yesdayes is now live!
I’ve used the kick-ass framework Pixlib to build it.
The physic engine is the good old FOAM, and there is some sort of PHP wrapper based on CodeIgniter.

posted by admin in AS3,Work and have No Comments

Back From Max 2011 // Skive Blog Post

Hello there!

I’ve just written something I couldn’t publish here, so here it is, on the skive blog, the company I work for.

http://blog.skive.co.uk/index.php/2011/11/04/back-from-back-from-adobe-max-2011/

Enjoy!

posted by admin in Aerys,AS3,Cross Device Communication,Flash Stage 3D,Minko and have No Comments

Flash CS5 And BitmapFont

I’ve been so struggling with that I had to create a blog only to show the solution!

What is the situation?

In Flash CS3 and CS4, we were able to export some fonts as BitmapFont, meaning that they were without any anti-aliasing and pixel perfect in all situation, even with an odd x or y such as 44.23 or something like that. If you don’t know what I am talking about, let someone you love show you what you missed.

If you read that, you must know that this wonderful option is gone in CS5! What a shame to see some blurred pixel fonts on your website …

I have a solution, it will work if like me you use an external swf to handle all the fonts, in other words, in you are a good and clean man. Create a FLA.

For a casual font

Go in your library, right click then “New Font …”. Select your font and your character range. Don’t forget to tick the “Export to ActionScript button” box.

For a bitmap font (hold your breathe)

Create an new text field on the stage. Specify Bitmap Text for the anti-aliasing. In the textfield write all the character you are going to use for this font: lower case, upper case, numerals and punctuation … etc.

You should end up with something like that for all your fonts:

FlashCS5 BitmapFont

Nearly done! You have your beeaaatiful SWF dedicated to fonts. It’s now time to download the wonderful FontLoader class. The article is in Russian, so here the actual class: FontLoader.

Just create a new instance of the FontLoader (it works like a casual URLLoader), load the swf holding your fonts, wait for the loading to complete and then create your TextField specifying the font name in the textformat, without forgetting to set the “embedFonts” property to true on the TextField itself. Like with CS3 and CS4, the actual bitmap font name will be something like “Arial_8pt_st” indicating you have a bitmap version of the Arial font, to be used with a 8px size.

If you have no idea of what you font names are, just list them using:

  1. var _a:Array = Font.enumerateFonts();
  2. var _font:Font;
  3.  
  4. for each(_font in _a){
  5.     trace("_font.fontName : "+_font.fontName);
  6.     trace("_font.fontType : "+_font.fontType);
  7.     trace("_font.fontStyle : "+_font.fontStyle);
  8. }

That’s it. Enjoy!

posted by admin in AS3,BitmapFont,Font and have No Comments