code is an addiction
I wrote a post a while back about loading fonts at runtime. Nothing there has really changed, but I did want to clarify one thing on here. I just discovered that when embedding fonts with the lastest Flex 4 SDK, I got an error with the following
[Embed(systemFont='OCR A Std',
fontName="OCR",
mimeType="application/x-font",
unicodeRange="U+0041-U+005A")]
The error read:
Error: exception during transcoding: Cannot embed local font 'nameOfFont' as CFF. The CSS @font-face 'local()' syntax is not supported. Please specify a path directly to a font file using the 'url()' syntax. For [Embed] syntax the 'systemFont' attribute is not supported. Please specify a path directly to a font file using the 'source' attribute.
I found that adding the following solved this problem.
[Embed(systemFont='OCR A Std',
fontName="OCR",
embedAsCFF='false',
mimeType="application/x-font",
unicodeRange="U+0041-U+005A")]
Just to clarify : embedding a font is not done at runtime, it's done at compile time.
Right you are, Seb! Which is why we compile the font first at compile time and then load it at runtime. Check out Loading Fonts at Runtime for more about that.
Thank you for this fix. I ran into the exact same error trying to compile a font in Flash CS5; this solved it.
Copyright © - Ben Walker 2010 - All rights reserved
Proudly powered by my very own code