Eddie Adams | 1 Oct 2008 16:47
Picon

Font embedding into Flash IDE

I have just completed every thread about font embedding and didnt find a working solution. I am trying to embed fonts by using the following xml file:

?xml version="1.0" encoding="iso-8859-1" ?>
<movie width="320" height="240" framerate="12">
  <frame>
    <library>
      <font id="EstaBold" import="EstaBold.ttf"/>
    </library>
  </frame>
</movie>

(swfmill simple "font.xml" "font.swf")

The fonts are imported into the font.swf file, for sure. None of the related threads shows a working explanation of how to embed the fonts into a swf created by the Flash IDE.

Many of the threads are outdated, what is today's solution?

Greetings,
Eddie
_______________________________________________
swfmill mailing list
swfmill@...
http://osflash.org/mailman/listinfo/swfmill_osflash.org
Walton, Lynn | 2 Oct 2008 15:35
Picon
Favicon

Re: Font embedding into Flash IDE

Eddie, 

I'm not entirely sure if I understand your question correctly but I'll
tell you what we do and perhaps it will help. 

Instead of just making a swf that is nothing more than the font, we take
our original swf made with the Flash IDE that has been designed such
that it
does not have the font embedded, but still refers to the font in the 
text fields. 

So we'd create a file (mov.xml) that looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<movie version="8" width="728" height="90" framerate="24">
  <background color="#FFFFFF"/>
  <frame>
    <library>
      <clip id="image01" import="some.png" />
      <font name="font1"  import="georgia.ttf" />
    </library>
    <clip id="template" import="original.swf" />
    <place id="template" depth="0" />
  </frame>
</movie>

Where in this example we are also embedding and image named some.png
that will have the id image01. The swf created in flash, in this case,
original.swf would have it's text fields reference a font named "font1".

We'd then run:

swfmill simple mov.xml final.swf

Actually in our case .. we'd really do this:

swfmill simple mov.xml temp.swf
swfmill swf2xml temp.xml
// ... in here we execute some code on the xml to customize things
swfmill swf2xml temp.xml  final.swf

Hope this helps. I don't really know much more than that, being a novice
myself at swfmill and flash. (I'm a back-end programmer)

Lynn

------------------------------------------------------------------------
---
Date: Wed, 1 Oct 2008 16:47:05 +0200
From: "Eddie Adams" <adams.eddie@...>
Subject: [swfmill] Font embedding into Flash IDE
To: swfmill@...

I have just completed every thread about font embedding and didnt find a
working solution. I am trying to embed fonts by using the following xml
file:

?xml version="1.0" encoding="iso-8859-1" ?>
<movie width="320" height="240" framerate="12">
  <frame>
    <library>
      <font id="EstaBold" import="EstaBold.ttf"/>
    </library>
  </frame>
</movie>

(swfmill simple "font.xml" "font.swf")

The fonts are imported into the font.swf file, for sure. None of the
related
threads shows a working explanation of how to embed the fonts into a swf
created by the Flash IDE.

Many of the threads are outdated, what is today's solution?

Greetings,
Eddie

This message and any attachments are intended only for the use of the addressee and may contain information
that is privileged and confidential. If the reader of the message is not the intended recipient or an
authorized representative of the intended recipient, you are hereby notified that any dissemination of
this communication is strictly prohibited. If you have received this communication in error, please
notify us immediately by e-mail and delete the message and any attachments from your system.
David Rorex | 2 Oct 2008 20:22
Picon
Gravatar

Re: Extract static text from a SWF using swfmill?

Hi,

I realize this is a bit late, taken me two weeks to reply :)

Anyway, thanks for writing this up for me, but it didn't work all that well. First I had to run swf2xml first, and then run it on the xml, running it directly on the swf doesn't work. And while it does find a lot of text, for my particular data it seems to miss a lot. I ended up finding 'swfstrings' which is part of the 'swftools' package, and that works pretty decently (though the output tends to be full of ??? marks, but not a problem for my particular application).

Thanks,
David

2008/9/16 Daniel Turing <mail-FksVOTNqHlZ5+dc36SJeWg@public.gmane.org>
Hey David,

On Tue, 2008-09-16 at 13:11 -0700, David Rorex wrote:
> <DefineText>...<TextRecord>...<glyphs>...<TextEntry glyph=1"
> advance="21">...etc.
>
> Is there any easy way I can actually extract this text?

the bad news it's doable but not *that* easy.

the good news is it proved to be an interesting little challenge to fill
my hacky evening, so now easy it is. at least if the SWF is very simple-
i'm unsure what happens if it uses more than one font, unicode/jis, or
something other than DefineText2, DefineFont2 and TextRecord6s. Although
at least for other TextRecord versions extending should be trivial;
dynamic text should be even easier. Unicode might already work :)

the trick is to use swfmill's XSLT feature and lookup the glyph's <at> map..
usage:
# swfmill xslt extract.xsl <your movie.swf> [output.txt]

hope this helps.

-dan


_______________________________________________
swfmill mailing list
swfmill-AOfRjkeVuXpAfugRpC6u6w@public.gmane.org
http://osflash.org/mailman/listinfo/swfmill_osflash.org


_______________________________________________
swfmill mailing list
swfmill@...
http://osflash.org/mailman/listinfo/swfmill_osflash.org
Alan Lynn | 5 Oct 2008 23:33
Picon
Gravatar

Gif support

I've looked all over the internet and haven't found the answer to this question, or even anyone else asking it:

Can swfmill import gif images? If not, why can't it?
_______________________________________________
swfmill mailing list
swfmill@...
http://osflash.org/mailman/listinfo/swfmill_osflash.org
Daniel Turing | 6 Oct 2008 14:51
Gravatar

Re: Gif support

Hi Alan,

On Sun, 2008-10-05 at 16:33 -0500, Alan Lynn wrote:
> Can swfmill import gif images? If not, why can't it?

It can't, to keep the number of dependency libraries down (when we start
with GIF, where are we going to end?). The workaround/solution is to
convert your gif to png before. There are many tools for that job.

-dan
Daniel Turing | 6 Oct 2008 14:53
Gravatar

Re: Welcome to the "swfmill" mailing list

Hi,

On Fri, 2008-09-19 at 15:55 +0200, MrPrise wrote:

> I'm trying to import a bitmap only font into my flash. 

SWF has no provision for bitmap fonts, so this wont work; ever. Sorry.

There should probably be an error message when you try though... I'm filing a bug for that.

-dan

> 
Daniel Turing | 6 Oct 2008 14:53
Gravatar

Re: added wav file support

On Tue, 2008-09-30 at 11:54 +0200, Robin Palotai wrote:
> I added WAVE (.wav) file import to swfmill.

Thanks a lot, Robin! I'll see to integrate that.

-dan
Daniel Turing | 6 Oct 2008 14:55
Gravatar

Re: Extract static text from a SWF using swfmill?

Hey,

On Thu, 2008-10-02 at 11:22 -0700, David Rorex wrote:
> And while it does find a lot of text, for
> my particular data it seems to miss a lot.

Yep, as i said- it doesnt capture Dynamic text or so (that is so simple
to do that it wasnt interesting enough ;P )

-dan
Alan Lynn | 7 Oct 2008 00:15
Picon
Gravatar

Re: Gif support

> when we start with GIF, where are we going to end?

Personally I don't think gif support is a slippery slope at all. Gifs are a common image format for games, one of the main uses of flash.

Converting static gifs to png is fine, but the png format doesn't support animation. For animated gifs I would have to convert each frame individually then build a movieclip in swfmill, correct? That's work better suited for a computer program.

Can you suggest a program for converting an animated gif to png frames? I could probably write a program to generate the swfmill xml myself.

Regardless, I still think this belongs in swfmill. It seems like a common enough problem that it should be supported. Though, maybe I'm wrong seeing as I didn't find anyone else asking about gif support.
_______________________________________________
swfmill mailing list
swfmill@...
http://osflash.org/mailman/listinfo/swfmill_osflash.org
Daniel Turing | 7 Oct 2008 11:06
Gravatar

Re: Gif support

On Mon, 2008-10-06 at 17:15 -0500, Alan Lynn wrote:
> 
> Converting static gifs to png is fine, but the png format doesn't
> support
> animation. For animated gifs I would have to convert each frame
> individually
> then build a movieclip in swfmill, correct? That's work better suited
> for a
> computer program.

SWF doesn't have a concept of animated images. You'd have to separately
represent the individual frames and place them in the timeline..

> Can you suggest a program for converting an animated gif to png
> frames? I
> could probably write a program to generate the swfmill xml myself

ImageMagick can do that, like this:
 convert animated.gif animated.png

produces animated-0.png, animated-1.png, etc, one for each frame.

hth,
-dan

Gmane