On 8/25/16, 11:27 PM, "OK" <p...@olafkrueger.net> wrote:

>>so FlexJS can load a font via @fontface
>
>Until now I've just used fonts without thinking about where it comes from
>;-)
>So while trying to understand how it works I found this from an previous
>post [1]:
>
>"What we do support in FlexJS is CSS
>@font-face for external font files. In the SWF version that will let you
>rotate text and get better rendering, but the font has to be loaded so it
>doesn't show up right away.  And you have to use the regular Flex SDK to
>generate the font SWF to be loaded."
>
>What does "you have to use the regular Flex SDK to generate the font SWF"
>mean?
>
>Coud we load the font doing it this way?:
>
>@font-face {
>  font-family: 'FontAwesome';
>  src: url('path/to/the/local/font.otf');
>  font-weight: normal;
>  font-style: normal;
>}

The CSS above will work in the browser.  The main FlexJS libraries also
produce a runnable SWF as well since the SWF can be used to catch runtime
errors the compilers and browsers won't catch right away.  And if you can
deploy the SWF into production, you can probably save on testing in the
various browsers.  However, Flash cannot load a otf file and use it.  It
needs to be converted into SWF tags.  The MXMLC compiler knows how to do
that.  Falcon doesn't.  So for now, you use MXMLC to generate a SWF
containing the converted otf file, place it next to the font.otf file, and
FlexJS will load the font.swf file and use it.

HTH,
-Alex

Reply via email to