我有一个固定宽度的火花标签,如下所示:
<s:Label text="the quick brown fox jumped over thelazydogsPackmyboxwithfive dozen liquor jugs." width="400"/>
大词汇(thelazydogsPackmyboxwithfive)超出了宽度,因此在“over”之后的行断开。这是期望的行为。
但是,当我使用嵌入字体时,不再发生这种情况。该线在“thelazydogsPackmyboxwithfive”的“o”和“x”之间断开。如何在单词中间保持中断并仍然使用我的嵌入字体?
答案 0 :(得分: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>
以下是它的外观: