Skip to main content
sinious
Legend
May 3, 2011
Question

Loading external fonts via [Embed]

  • May 3, 2011
  • 3 replies
  • 631 views

Hi all,

I typically embed the fonts in a library and use it this way but sometimes this gives me issues. I'm using Flash Pro CS5 and I'm trying the Embed method.

I've seen many blogs/posts (here, here, here, here, etc in order of which my problems arose) but none of them are working for me. I'm getting the transcode error issue.

Can anyone shed more light on what the Error: Unable to transcode 'some/path/to/a.ttf' transcoding error is? Im sure the path is right, I've tried embedding with and without various options like mimeType, I can't get it to embed the font, or any font for that matter.

Tips on embedding a font? My code would typically look like this:

[Embed(source="dat/SomeFont.ttf",  fontFamily="SomeFont", mimeType="application/x-font")]
var SomeFontClass:Class;
var SomeFont:Font = SomeFontClass();


Anything sticking out as wrong there?

Thanks!

This topic has been closed for replies.

3 replies

sinious
siniousAuthor
Legend
May 7, 2011

I have read those posts and actually already found the blog listed at the bottom (unfortunately solving their issues for Flex but not Flash).

The one interesting thing (after re-reading it) was making sure to specify the right weight and style and I'm currently not specifying any type. I'll do that and see if it helps, I hope so, and I'll report back. There has to be more people having this issue. At the moment I just resorted to embeddding the font in the library. The whole app is 100% code, just the main class loaded in an empty FLA.... now with 3 embedded fonts hehe. Hoping to make the app 100% code, no library.

Darshan_Rane
Inspiring
May 4, 2011

Check this thread

http://forums.adobe.com/message/2747265#2747265

--

http://www.darshanrane.com

Lee_Burrows
Participating Frequently
May 4, 2011

hi

ive had problems with this in the past - an absolute file path usually fixes it (not ideal i know)

also, i think you'll need var SomeFont:Font = new SomeFontClass() as Font;