swftools-common
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Swftools-common] pdf2swf: text flips with "-T 9" argument


From: Justin . Liebeskind
Subject: [Swftools-common] pdf2swf: text flips with "-T 9" argument
Date: Tue, 30 Mar 2010 08:45:47 -0400


Hello Swftools,

I am not sure if this is the right place to ask about bugs, but I could not find any other.
Please direct me to the correct place if there is one...

Anyways, I have an issue with pdf2swf where text gets flipped in the outputted SWF.
This happens in all SWF viewers and it happens with almost all of my generated SWF files.
It is reproducible by simply shrinking the viewing window -- at a certain point, the text will suddenly flip.

Upon further investigation, it seemed to be related to using the "-T 9" argument of pdf2swf.
Without this argument, the problem goes away.
However, I need to use this argument...

I diffed two swfdumps - one using "-T 9" and one not using it.
The issue seems to be with the CSMTextSettings property.
See page 208 of the SWF Spec:
www.adobe.com/devnet/swf/pdf/swf_file_format_spec_v9.pdf

The GridFit field is being set to 1 by pdf2swf, but this is only supported with left-aligned dynamic text.
pdf2swf seems to violate this spec.
If I manually fix the SWF to have this field set to 0, then my problem goes away.

After grabbing the source for swftools, it looks like there are two places where this problem occurs:
swftools-0.9.0/lib/devices/swf.c, line 768
and
swftools-0.9.0/src/swf.c, line 1359

Example:
 if(stack[0].swf->fileVersion >= 8) {
        tag = swf_InsertTag(tag, ST_CSMTEXTSETTINGS);
        swf_SetU16(tag, id);
        //swf_SetU8(tag, /*grid*/(1<<3)|/*flashtype*/0x40);  //old
        swf_SetU8(tag, /*grid*/(0)|/*flashtype*/0x40);  //new. grid fitting only supported for left-aligned dynamic text.
        swf_SetU32(tag, 0);//thickness
        swf_SetU32(tag, 0);//sharpness
        swf_SetU8(tag, 0);//reserved
    }


This is my first time looking at the source code, so I am afraid that I will screw it up if I try to fix this issue myself.
A developer more familiar with the code base would probably know more about what is going on with this setting.

Please help!

Thank you,
-Justin Liebeskind
address@hidden
reply via email to

[Prev in Thread] Current Thread [Next in Thread]