1

为什么当我应用旋转选项卡时,选项卡的文本会消失?有什么方法可以将标签保持在其相对位置,使其与标签一起旋转?

代码:

<tabs name="dentes" height="200"  width="300" x="${this.width}" y="${this.height}" rotation="90">
    <tabpane name="coroa" text="Coroa" bgcolor="blue" width="100%" height="100%"> 
        <text>Nome:</text>
    </tabpane>
    <tabpane name="raiz" text="Raiz" bgcolor="red" width="100%" height="100%"> 
        <text>Nome:</text>
    </tabpane>
    <tabpane name="canal" text="Canal" bgcolor="green" width="100%" height="100%"> 
        <text>Nome:</text>
    </tabpane>
</tabs>
4

1 回答 1

1

这是使用客户端字体时 Flash/SWF 运行时的技术限制。它也在文档中提到:

OpenLaszlo 开发人员指南,第 21 章,文本视图:特别是,您应该了解编译为 SWF 的应用程序中客户端字体和嵌入字体之间的区别。(编译为 DHTML 的应用程序不能使用嵌入字体)。因为它们的行为方式并不总是相同(例如,由于 Flash Player 的限制,客户端字体无法旋转或更改不透明度)

使用<font>标签将 TTF 字体嵌入到您的应用程序中。如果您为文本选择该字体,则旋转将按预期工作,例如:

<canvas width="100%" height="250">

    <!-- ATTENTION: Please download the KentucyFriedChickendFont.ttf file using
         this URL and put it in the same folder as this LZX file.
         http://svn.openlaszlo.org/openlaszlo/trunk/test/resources/ttf/KentuckyFriedChickenFont.ttf
    -->

    <font name="ChickenNoCFF" src="KentuckyFriedChickenFont.ttf" embedascff="false" />
    <font name="ChickenCFF" src="KentuckyFriedChickenFont.ttf" embedascff="true" />

    <inputtext x="100" 
               rotation="10"
               font="ChickenNoCFF" fontsize="32" 
               hasdirectionallayout="false"
               resize="true">
    Embedded font (no CFF)
    </inputtext>

    <!-- Text elements using @hasdirectionallayout="true" need to set
         @embedascff="true" for the SWF10+ runtimes -->
    <inputtext x="100" y="100"
               rotation="10" 
               font="ChickenCFF" fontsize="32" 
               hasdirectionallayout="true">
    Embedded font (embedded as CFF)
    </inputtext>

</canvas>

您必须将 TTF 字体嵌入到您的应用程序中,然后您可以自由旋转任何标准文本组件。

如果hasdirectionallayout在 SWF 应用程序中使用文本组件的属性,则embedascff="true"在嵌入自定义字体时必须使用该属性。

这是此示例 SWF10 应用程序的屏幕截图,在 5.0(主干)上测试。

在此处输入图像描述

于 2012-11-08T23:33:56.763 回答