Skip to main content
Participant
May 25, 2010
Question

TCYElement dissapeared.

  • May 25, 2010
  • 2 replies
  • 1155 views

Hi, All.

This problem is on the release build of Adobe Flash Builder 4.

Introduction

Now I'm trying to make e-Book Reader which can handle with Japanese vertical text layout.

Of course, TCY(Tate-Chu-Yoko) Layout is needed.

Please see the snapshot below.

Generally say, the TextFlow object which applyed "rl" on BlockProgression shows Japanese vertical Layout properly.

Multi byte Japanese characters are "standing up" same as horizontal layout.

And Single Byte characters (I wonder if this name is proper. ASCII? Like "a", "0", "é" ,etc...) are rotated +90 degree, in other words, "layed down".

So, in ordinary Japanese vertical text layout, independent single character or  independent 2 characters will be TCYed as shown above.

Rest (I mean consecutive 3 or more Single Byte Characters) are "layed down".

Now, the introduction ends.

Problem: TCYElement which contains text are dissapeared on "NORMALIZATION".

On the release build of Flash Builder 4, some Multi Byte characters are not "standing up properly".

These are, for example, "◇", "□", "☆", "①".

For the precaution, "☆" is the character which has code "A1F9" on UTF-8.

To solve this problem, I implemented the function "Auto TCY", which scratches xml to be import and wrap these Not-StandingUp-Characters with <tcy> tag.

It works well as I'd thought, and as a result, I got proper XML.

But all of them(TCY tags) were removed after being passed to TextConverter.ImportToFlow method.

Checked the API Reference, I've found It told that.

TCY blocks which contain no text will be removed from the text flow  during the normalization process.

http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flashx/textLayout/elements/TCYElement.html

Now, the problem is TCYElements are removed despite they have a character.

Anyone has idea?

This topic has been closed for replies.

2 replies

Participating Frequently
May 27, 2010

ROTATE_270 is indeed what you want, rather than TCY (at least for things like  "◇", "□", "☆", "①".)

ROTATE_AUTO (the default) is resolved, in vertical text, to either ROTATE_0 or ROTATE_270. The decision is based on the Unicode property East Asian Width of the characters: wide characters are rotated, other are not. The property value for ① is "ambiguous", so it is not rotated. I don't think we want to rotate all ambigous characters, this would pick up things like U+00A1 ¡ INVERTED EXCLAMATION MARK, which ought to be treated just like U+0021 ! EXCLAMATION MARK. But we can certainly rotate some like ①. Input on which should be rotated are welcome.

Thanks,

Eric.

FumikitoAuthor
Participant
May 28, 2010

Hi, Eric.

The function to apply TextRotation.ROTATE_270 hasn't implemented yet, but I can understand the logic and how it works.

Thank you for that.

And what you wrote about TCY's decision was also very useful.
Indeed, I and other developper who treats Japanse will have to get the list of ambiguous characters to be "raised up".

By the way, I feel InDesign for Japanese works well on vertical layout especsially on this matter.
I guess it has "the list", but I don't know how to use it...

If I would have "the list", I will share it somewhere.

Thanks.

Adobe Employee
May 25, 2010

Can you post some sample markup that shows the problem? Another way to solve the problem would beto set the rotation of the character to ROTATE_270. This will give you a single character standing up, which is a little different than tcy, which gives you a range, but might help with your immmediate problem. But if you can send the markup, that would be very helpful -- if this is a bug, we would like to fix it.

Thanks!

- robin

FumikitoAuthor
Participant
May 28, 2010

Hi, robin.
Thanks for you reply.

But I found this problem is not because of TCY, but because of nesting SubParagraphGroupElement inside of FlowLeafElement.

First, the part of markup After "Auto TCY"ed was like this.

<flow:p fontSize="14">
    <flow:span styleName="font3366cc">
      <flow:tcy>★</flow:tcy>
      不快な態度をチェック
    </flow:span>
  </flow:p>
  <flow:p styleName="color3366cc">
    <flow:tcy>□</flow:tcy>
     話すときに口を手で覆う
</flow:p>


If you haven't installed Japanese font, it wouldn't be displayed properly.
Anyway, The Entire XML is valid.
After applyed to "TextConverter.importToFlow()" method, <flow:tcy>★</flow:tcy> dissapeared, but <flow:tcy>□</flow:tcy> didn't.
After stripping span tags from this markup, "★" was displayed.

New markup is like below.

<flow:p fontSize="14" styleName="font3366cc">
   <flow:tcy>★</flow:tcy>
   不快な態度をチェック
</flow:p>
<flow:p styleName="color3366cc">
   <flow:tcy>□</flow:tcy>
   話すときに口を手で覆う
</flow:p>

So I think this isn't BUG.


Markup is the matter.

Now, I realized the importance of markup structure.

Thanks a lot.