Strange vertical text

In Flash editor you can create text which is positioned vertically.
It has some strange format of SWF file upon compilation.

Vertical text in Flash CS6

Let’s start with static horizontal text. We place static text on the stage.
This text is compiled as follows:

SWF structure for static horizontal text
Static horizontal text parameters

The SWF structure has:

  1. Font inside DefineFont3(1) tag along with DefineFontAlignZones/DefineFontname tags
  2. Single DefineText(2) tag with attached CSMTextSettings, which has the fontId 1 set
  3. The PlaceObject2 tag which places the text (characterId = 2) on the stage

The vertical text

Now let’s proceed to the vertical text.

The vertical text has special handling of letterspacing inside its DefineEdit text.

Vertical text letter spacing

But what’s more important and very strange is the overall structure of SWF file.

SWF structure with single static vertical text

In this case, SWF looks like this:

  1. It has DefineFont3(1) with DefineFontAlignZones and DefineFontName
  2. DefineText(2) with attached CSMTextSettings, which has the fontId 1 set
    Now for the weird part:
  3. Second DefineText(3) without fontId set with attached CSMTextSettings
  4. DefineSprite(4) which has three PlaceObjects2 inside.
    • PlaceObject2 with font (1) as placed character
    • PlaceObject2 with the text (2) as placed character
    • PlaceObject2 with the second text (3) as placed character
  5. PlaceObject2 which places the DefineSprite(4) on the stage.
Second empty DefineText
PlaceObject2 with the font placed
PlaceObject2 with second text

This is very different from the horizontal text. I still wonder why there is the font on stage and the second text, because if I tried to delete those unnecessary placeobjects with FFDec, the SWF was still displayed fine.

If anybody knows why its there, then let me know in comments, it is still a mystery to me.

P.S. It works this way even in latest Adobe Animate





Leave a Reply

Your email address will not be published. Required fields are marked *