[swfmill] font name format

INADA Naoki inada-n at klab.org
Thu May 22 22:51:21 PDT 2008


Hi all.

The SWF File Format Specification v9 (We can read without any restrictions now!)
says font name in DefineFont2/DefineFont3/DefineFontInfo is not null terminated.

--- SWF File Format Specifiction v9 page 191 ---
Note that font name strings in the DefineFontInfo tag are not null-terminated;
instead their length is specified by the FontNameLen field.
---

But spec is wrong and FontName should be null terminated according to this
topic. < http://www.adobeforums.com/webx?13@@.59b53b2d/3 >

Attached patch add null terminator to output of SWFWriter::putPString().

But SWFWriter::putPString() is only used in DefineFont2/3 tag. DefineFontInfo/2 tag
use ''data'' type to store FontName.
Following comment is in swfmill/src/codegen/source.xml.

        <!--
                doesnt work for strange encodings (nibbles.swf)
                <string mode="pascal" name="name" prop="true"/>
        -->
        <byte name="nameLength"/>
        <data name="nameData" size="nameLength"/>

I think it can replace nameLength and nameData into PString type. But I don't know
what is the nibbles.swf and whether attached patch can or can't fix the problem.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: fontname.patch
Url: http://osflash.org/pipermail/swfmill_osflash.org/attachments/20080523/98a54d5f/attachment.pl 


More information about the swfmill mailing list