Is it possible to refer to a web font from a SWF, and have text in that Flash movie render in the style of that web font?
For example let’s say I have:
<html>
<head>
<link rel="stylesheet" type="text/css" href="impact_label.css">
</head>
<body>
<!-- The SWF object -->
</body>
</html>
And in that stylesheet I have:
/* Generated by Font Squirrel */
@font-face {
font-family: 'ImpactLabel';
src: url('Impact_Label-webfont.eot');
src: url('Impact_Label-webfont.eot?#iefix') format('embedded-opentype'),
url('Impact_Label-webfont.woff') format('woff'),
url('Impact_Label-webfont.ttf') format('truetype'),
url('Impact_Label-webfont.svg#ImpactLabelRegular') format('svg');
font-weight: normal;
font-style: normal;
}
Pretend the SWF consists of one text element. Can I link out to the stylesheet, or for that matter any of the font files it consists of, and set the font-family of a text element in my movie to that of the external font?
No, fonts need to be in a special format for Flash.
If you want to load a font dynamically, you must embed it in a swf, e.g.
Impact_Label-webfont.swf. You can find complete instructions for that on this blog.