Adobe announces AIR 1.0 Download How to install the necessary components and build a very basic map using google maps in flex
Jun 13

I’ve come across this error a number of times: 

exception during transcoding: Unexpected exception encountered while reading font file ‘/C:/Documents and Settings/markl/My Documents/Flex Builder 3/DexterNorthCode/src/assets/DejaVuSans-Bold.ttf’
It can be very frustrating as there is not much information to be gleaned from the error messages and the whole font area is very murky and complicated.

There are a number for reasons that this error will occur

  • If you reference the wrong file
  • If you specify the fontStyle or fontWeight wrong
  • or most frustratingly if the font manager can’t interpret the font correctly.

After grappling with this problem for I while and after much reading I realised that there are 3 different “font managers” that transcode fonts in AS3. These are:

  • flash.fonts.JREFontManager
  • flash.fonts.AFEFontManager
  • flash.fonts.BatikFontManager

The different font managers have different capabilities and should be automatically selected to choose the best one. However, this is not always the case.

You can force the compiler to use a specific manager by appending the following to the compiler arguments.

Project->Properties->Flex Compiler->Additional compiler arguments:

 

-managers=flash.fonts.AFEFontManager

This forces the use of the AFEFontManager which seems to have the best support for fonts and is the one being most actively developed.

 

 

written by Flex \\ tags:

Leave a Reply