Chris,

I wrote in swftools-common list with two things: first of it is about
AS3 classes update in resulted SWF, second about undocumented -n switch
in font2swf. So, you suggest me with second thing but not with first.

I'm not C++ developer and don't know how to setup system to even compile
swftools from sources, so I cannot patch it. I ask help from someone of
swftools developers/owners, to discuss about desired changes. Changes
what I offer allow to create usable, loadable SWF fonts in batch way
from command-line. It is what I needed now for our project.

Best,
-- 
Andrew Answer
http://answe.ru
http://andrew.answer.name
CEO of Yourself
Learn and grow.

Original message:
===========================================================================
Hello all,

I check font2swf tool and find what some code must be added to create
powerful font creation utility. Currently, in resulting swf I see

package
{
    import flash.text.*;

    dynamic public class Arial extends Font
    {

        public function Arial()
        {
            return;
        }// end function

    }
}

(checked with Sothink SWF Decompiler). But, to register font
successfully in external Flash app, you need this code:

package
{
    import mx.core.*;

    public class RSFont0__font extends FontAsset
    {

        public function RSFont0__font()
        {
            return;
        }// end function

    }
}

package
{
    import flash.text.*;

    public class RSFont0 extends Font
    {
        private var _fontName:String = "ArialRegular";
        private var _fontStyle:String = "regular";
        private var _fontType:String = "embedded";
        private static var _font:Class = RSFont0__font;

        public function RSFont0()
        {
            return;
        }// end function

        override public function get fontName() : String
        {
            return this._fontName;
        }// end function

        override public function get fontStyle() : String
        {
            return this._fontStyle;
        }// end function

        override public function get fontType() : String
        {
            return this._fontType;
        }// end function

        public static function get font() : Class
        {
            return _font;
        }// end function

    }
}

package
{
    import FontRegister.*;
    import flash.display.*;
    import flash.text.*;

    public class FontRegister extends Sprite
    {
        private var _fonts:Array;

        public function FontRegister()
        {
            this._fonts = [new RSFont0()];
            this.registerFont(RSFont0.font);
            return;
        }// end function

        public function get fonts() : Array
        {
            return this._fonts;
        }// end function

        protected function registerFont(param1:Class) : void
        {
            Font.registerFont(param1);
            return;
        }// end function

    }
}

package mx.core
{
    import flash.text.*;

    public class FontAsset extends Font implements IFlexAsset
    {
        static const VERSION:String = "4.0.0.14159";

        public function FontAsset()
        {
            return;
        }// end function

    }
}

package mx.core
{

    public interface IFlexAsset
    {

        public function IFlexAsset();

    }
}

This is classes in SWF generated by
http://code.google.com/p/flash-runtime-font-publisher/

Also, I check sources and found what you have undocumented switch "-n
fontname" where fontname="Arial" in previous example. Please document
this feature, this is very useful thing for preparing fonts, because
italic, bold and other font styles have default "Arial" name too - but
with this key I can set fontname to "ArialItalic", "ArialBold" and so
on.
===========================================================================

В Втр, 21/06/2011 в 15:06 +0000, Chris пишет:
> On Tue, 21 Jun 2011 14:41:17 +0700
> Andrew Answer <[email protected]> wrote:
> 
> > Done here,
> 
> Pat on back. ;o)
>  
> > http://wiki.swftools.org/index.php/Undocumented_-n_switch
> > 
> > what about other things?
> 
> As in..?
> 
> This list is checked by Matthoas and others.  Suggestions, improvement 
> patches, etc,
> etc, are usually tested checked and implemented in the git repo.
>  
> Regards,
> 
> 
> 
> Chris
>  -- 
> <[email protected]>



Reply via email to