ZaaIL adds support for 40+ image format to Flash

Zaalabs yesterday announced the release of an opensource ( under MIT license ) library, written using Alchemy, which will allow swf to load at runtime more than 40 different image formats ( you will have access to the bitmapdata of the loaded file ).

This is indeed a great news ( I’m thinking in particular to the benefits it can have for us at Aviary )!
This actionscript library is a porting of the DevIL library. And in fact reading at the features list of the DevIL library you can see that a lot of image formats are currently supported:
  • Windows Bitmap – .bmp
  • Dr. Halo – .cut
  • Multi-PCX – .dcx
  • Dicom – .dicom, .dcm
  • DirectDraw Surface – .dds
  • OpenEXR – .exr
  • Flexible Image Transport System – .fits, .fit
  • Heavy Metal: FAKK 2 – .ftx
  • Radiance High Dynamic – .hdr
  • Macintosh icon – .icns
  • Windows icon/cursor – .ico, .cur
  • Interchange File Format – .iff
  • Infinity Ward Image – .iwi
  • Graphics Interchange Format – .gif
  • Jpeg – .jpg, .jpe, .jpeg
  • Jpeg 2000 – .jp2
  • Interlaced Bitmap – .lbm
  • Homeworld texture – .lif
  • Half-Life Model – .mdl
  • MPEG-1 Audio Layer 3 – .mp3
  • Palette – .pal
  • Kodak PhotoCD – .pcd
  • ZSoft PCX – .pcx
  • Softimage PIC – .pic
  • Portable Network Graphics – .png
  • Portable Anymap – .pbm, .pgm, .pnm, .pnm
  • Alias | Wavefront – .pix
  • Adobe PhotoShop – .psd
  • PaintShop Pro – .psp
  • Pixar – .pxr
  • Raw data – .raw
  • Homeworld 2 Texture – .rot
  • Silicon Graphics – .sgi, .bw, .rgb, .rgba
  • Creative Assembly Texture – .texture
  • Truevision Targa – .tga
  • Tagged Image File Format – .tif
  • Gamecube Texture – .tpl
  • Unreal Texture – .utx
  • Quake 2 Texture – .wal
  • Valve Texture Format – .vtf
  • HD Photo – .wdp, .hdp
  • X Pixel Map – .xpm
  • Doom graphics

purePDF, a complete actionscript PDF library

PurePDF is a complete library for creating PDF documents using actionscript 3 ( targeted for flash player 10 ).
The project is actually hosted on google code.

This is is a porting I’ve made of the famous java iText library ( version 4.2 ) by Bruno Lowagie into pure actionscript 3.0 (with some little modifications).
iText ( and purePDF ) has tons of features for create and manipulate pdf documents. A quick list of the features actually implemented into purepdf:

  • pdf viewers display options
  • alpha transparency, blend modes
  • layers
  • arabic RTL writing
  • support for pdf text rendering ( example )
  • tables ( nested tables, page split tables, table with images, etc…)
  • slide show ( page transitions )
  • annotations, comments, file annotations
  • patterns, shadings patterns (linear and gradient), spot colors, rgb color and cmyk color
  • linear and radial gradients with alpha ( example or example 2 )
  • forms (user input forms, textfields, combo box, list, checkbox)
  • paragraphs, phrases, chunks for text manipulation, chapters, lists…
  • images (jpeg, png, animated gif, tif, bitmapdata ) and image patterns
  • basic and advanced paths
  • afm, otf, pfm, ttc and ttf fonts (embedded and not embedded)
  • metadata, page header and footers
  • external, internal links
  • barcodes creation ( ean-ucc 13, ucc-12, ean-ucc-8, upc-e, pdf 417, ean supplements) ( example )
  • unicode, cjk fonts and text
  • file attachments
  • javascript ( example )
  • multi column text
  • Embedded movies ( example )
  • Vertical text ( see this example )
  • and many other features…

You can take a look at this PDF document (self generated using actionscript reflection) with the purePDF APIs.

Other actionscript libraries I’ve used for this project are: fzlib, as3corelib, ashashmap, alchemy, as3-commons.

You can both download the library from source code and compile it yourself ( see at the Installation guide ) or download the precompiled swc files from the project’s download section.

Moreover there are actually a lot of examples to explain all the library features and for a quick guide. You can find them listed and updated here. In General refers to the project wiki for all the updated examples/howtos and the project updates.

update: here you can find the updated online api documentation

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″]