On 12/2/15, 3:56 PM, "Nemi" <nemino...@gmail.com> wrote:

>Alex Harui wrote
>> In the UI, try to avoid low-level Flash APIs including embedded fonts.
>
>Avoid embedding fonts at all? How to use them if they need to be embedded
>for some components?

I think this topic deserves its own thread.  I would definitely like to
learn more about how folks use embedded fonts.

The main reason FlexJS doesn't support embedded fonts is because Adobe
never got around to implementing font embedding  in the Falcon compiler.
Then to increase the difficulty level, to be a good Apache project, we
should implement font embedding via open source code instead of relying on
Adobe-owned jars like the flex-sdk does today.

I haven't tried to implement font embedding in the Falcon code because
font file transcoding isn't my area of expertise at all, but more
importantly, I don't think I see it used much in the HTML/JS/CSS world but
please correct me if I'm wrong.  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.

So, volunteers are welcome to work on font-file transcoding.  There are
Apache project like Batik and PDFBox that might have some code we could
re-use, but I looked and asked a few years ago and they didn't have all of
the pieces.  I think we need a good spline converter, and maybe more
intelligence beyond that.  I really don't know what goes on inside the
Adobe libraries.

And again, if there is some use case for embedded fonts that I've missed,
please speak up.  So if you were to start a new project in Flex with
FlexJS in mind, I would look into using an external font SWF if I needed
embedded fonts, but think ahead to when you have an HTML/JS/CSS version.
I don't think you need to embed the fonts to get rotated text and if you
aren't going to deploy the SWF version at all, you might be able to live
without it completely, so maybe implement your font embedding in a way it
can be easily removed.

Of course, I could be wrong, so please share your thoughts.

Thanks,
-Alex

Reply via email to