Hi Fang,
what you first need is some understanding of the flash format itself.
There is documentations on this from the macromedia website. They tend
to move and hide it from time to time so the last link I have on this
does not work anymore. Search for the Macromedia File Format SWF SDK,
if they still name it like that.
You should also be able to build the flash filter yourself and debug
it.
A good problem to start with is in Writer::Impl_writeText().
I recently added the following if case:
if( bRTL || (nScriptType != ScriptType::LATIN) )
{
...
}
This is used to export right to left and non latin text to flash. This
was needed because the latin way to have one glyph per character is
not enough here. A character is for example the 'A' at the beginning
of this sentence, a glyph is the graphical representation of that
character in its current context. Now for latin an A is always rendered
the same, so always has the same glyph. For everything else there may
be characters that are rendered different, for example if they are at
the beginning of a word, in the middle or in the end.
This is all very complicated stuff and already implemented in vcl so
my solution was to ask vcl for a polygon representation of a text run.
This is done in the line
mpVDev->GetTextOutline( aPolyPoygon, rText, 0, 0, (USHORT)nLen, TRUE,
nWidth, pDXArray );
then the next line
aPolyPoygon.Translate( rPos );
translates that polypolygon to the position the text run is supposed to be
rendered and then
Impl_writePolyPolygon( aPolyPoygon, sal_True, aTextColor, aTextColor );
exports that polypolygon to the flash file.
A polygon by the way is a connected set of lines or curves that form a
geometry. A polypolygon is just a set of one or more polygons.
The problem with my fix here is that each text run is exported as one
polypolygon. For latin we export each glyph only once and the text just
references that glyph. This is an optimization as there are only a
handful of different glyphs so their geometry must only be stored once.
In the non latin or right to left case, each glyph is exported each time
it is used, resulting in many duplicated glyphs inside the generated
flash file.
The solution would be to build up a cache for exported polygons so they
also get reused.
Regards,
Christian
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]