Highlighted

[Embed(source='font.ttf')] suddenly failing in AIR 13.0

Engaged ,
May 29, 2014

Copy link to clipboard

Copied

Hi all,

I have an app for iOS and Android that we've been testing for about 6 months with no problem.  It uses Embed code to define 5 different fonts used throughout the app, like this:

[Embed(source='fonts/Feijoa_Medium.ttf', fontFamily="_Feijoa", fontWeight=FontWeight.NORMAL, advancedAntiAliasing="true", embedAsCFF="false")]

  public static const FeijoaClass : Class;

// Sometime later

Font.registerFont( FeijoaClass );

This has been working perfectly in AIR 3.9

I recently upgraded the AIR version to 13.0 (Edit: also happens in 14.0) and first received this error message:

Build failed: Warning. The constant 'FeijoaClass' was not initialised

On a whim, I changed the variable to private static var like this:

[Embed(source='fonts/Feijoa_Medium.ttf', fontFamily="_Feijoa", fontWeight=FontWeight.NORMAL, advancedAntiAliasing="true", embedAsCFF="false")]

  private static var FeijoaClass : Class;

The project now compiles, but I get the following run-time error on the Font.registerFont call:

[Fault] exception, information=TypeError: Error #2007: Parameter font must be non-null.

And sure enough, all my embedded classes are null.

The path to the font is correct.  However, another weird thing is that if I deliberately change the path to the font to be incorrect, I do not receive any sort of error (I'm sure i used to in AIR 3.9 if the path was incorrect).

Any ideas?  Scratching my head at this one!

Ok, this turned out to be a problem with my IDE.

I use FlashDevelop and had recently updated to 4.6.2

I reinstalled an older version (4.5.2) and embeds are working again!

TOPICS
Development

Views

181

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more

[Embed(source='font.ttf')] suddenly failing in AIR 13.0

Engaged ,
May 29, 2014

Copy link to clipboard

Copied

Hi all,

I have an app for iOS and Android that we've been testing for about 6 months with no problem.  It uses Embed code to define 5 different fonts used throughout the app, like this:

[Embed(source='fonts/Feijoa_Medium.ttf', fontFamily="_Feijoa", fontWeight=FontWeight.NORMAL, advancedAntiAliasing="true", embedAsCFF="false")]

  public static const FeijoaClass : Class;

// Sometime later

Font.registerFont( FeijoaClass );

This has been working perfectly in AIR 3.9

I recently upgraded the AIR version to 13.0 (Edit: also happens in 14.0) and first received this error message:

Build failed: Warning. The constant 'FeijoaClass' was not initialised

On a whim, I changed the variable to private static var like this:

[Embed(source='fonts/Feijoa_Medium.ttf', fontFamily="_Feijoa", fontWeight=FontWeight.NORMAL, advancedAntiAliasing="true", embedAsCFF="false")]

  private static var FeijoaClass : Class;

The project now compiles, but I get the following run-time error on the Font.registerFont call:

[Fault] exception, information=TypeError: Error #2007: Parameter font must be non-null.

And sure enough, all my embedded classes are null.

The path to the font is correct.  However, another weird thing is that if I deliberately change the path to the font to be incorrect, I do not receive any sort of error (I'm sure i used to in AIR 3.9 if the path was incorrect).

Any ideas?  Scratching my head at this one!

Ok, this turned out to be a problem with my IDE.

I use FlashDevelop and had recently updated to 4.6.2

I reinstalled an older version (4.5.2) and embeds are working again!

TOPICS
Development

Views

182

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
May 29, 2014 0
Engaged ,
May 29, 2014

Copy link to clipboard

Copied

Ok, this turned out to be a problem with my IDE.

I use FlashDevelop and had recently updated to 4.6.2

I reinstalled an older version (4.5.2) and embeds are working again!

Likes

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
Reply
Loading...
May 29, 2014 0