0

我有一个固定宽度的火花标签,如下所示:

<s:Label text="the quick brown fox jumped over thelazydogsPackmyboxwithfive dozen liquor jugs." width="400"/>

大的单词簇(thelazydogsPackmyboxwithfive)超出了宽度,因此在单词“over”之后换行。这是期望的行为。

但是,当我使用嵌入式字体时,这不再发生。换行在“thelazydogsPackmyboxwithfive”的“o”和“x”之间。如何防止单词中间出现中断并仍然使用我的嵌入字体?

4

1 回答 1

0

以下内容对我来说很好,并且这个词是否正确,因为thelazydogsPackmyboxwithfive当它不适合它时它会向下移动一行。

<?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
               xmlns:s="library://ns.adobe.com/flex/spark"
               xmlns:mx="library://ns.adobe.com/flex/mx" >

    <fx:Declarations>
        <!-- Place non-visual elements (e.g., services, value objects) here -->

    </fx:Declarations>

    <fx:Style>
        @namespace s "library://ns.adobe.com/flex/spark";
        @namespace mx "library://ns.adobe.com/flex/mx";

        @font-face{
            src:url("Knights Quest.ttf");
            fontFamily: MyF;
            embedAsCFF: true;
        }
        .myFont
        {
            fontFamily: MyF;
            fontSize:20px;
        }

    </fx:Style>


    <s:BorderContainer id="box" width="400" height="200">

    </s:BorderContainer>

    <s:Label text="the quick brown fox jumped over thelazydogsPackmyboxwithfive dozen liquor jugs." width="400" styleName="myFont" />

</s:Application>

这是它的外观:

在此处输入图像描述

于 2013-05-13T21:57:20.557 回答