Hello
I used swfmill to generate a swf library containing just a few glyphs from a
font. Wanting to use swftools to build the final swf animiation I used
swfextract to build a font library swftools would understand. Defining
textfields containing just one glyph in swftools I found that some of those
glyphs would have some parts chopped of.
Trying to fix this I uses swfmill swf2xml to look at the bounding boxes in
the swfmill output, I changed the values, used swfmill xml2swf and then
swfextract again to finally get a correct looking animation.
Having used several tools, the source of the issue was obvious of course,
but looking at the xml after unsing swfmill swf2xml on a swf file made by
swfmill simple using plain old
/usr/share/fonts/truetype/ttf-bitstream-vera/Vera.ttf I found that for
instance the bottom of the 'o' was significantly lower then the bottom of
the 'e'. Which corresponded with the 'o' being chopped of at the bottom.
Looking at the code in SWFShapeMaker.cpp I found that if a CurveTo is
include in the shape then only the second point is used to find the bounding
box. This does not seem to a problem since in sequences of CurveTo's it
seems that the first point of a CurveTo is almost equal to the second point
in the previous CurveTo. But the first CurveTo in any sequence does have a
first point which is never used to find the bounding box.
I added the line
minmax( cx+(lastx*factorx), cy+(lasty*factory) );
to the end of SWFShapeMaker::CurveToR and found that the problem was gone,
looking at the xml again, the 'e', 'o' and 'u' had the same bottom as they
should (I included only a few glyphs).
I'm guessing that it would be nice to have that extra minmax call included
only in the first CurveTo in a sequence, but I don't know enough about
TrueType files to be sure.
Best Regards
Huub
_________________________________________________________________
Even lekker snel online vermaak? Ga dan naar www.msn.nl http://www.msn.nl
_______________________________________________
swfmill mailing list
[email protected]
http://osflash.org/mailman/listinfo/swfmill_osflash.org