• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

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

Engaged ,
May 29, 2014 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!

TOPICS
Development

Views

244

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
community guidelines

correct answers 1 Correct answer

Engaged , May 29, 2014 May 29, 2014

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!

Votes

Translate

Translate
Engaged ,
May 29, 2014 May 29, 2014

Copy link to clipboard

Copied

LATEST

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!

Votes

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
community guidelines