flex builder载入字体
flex builder 设置非系统默认字体:
存在问题:text不能设置bold,否则不起作用。
方法一:(css)
<mx:Style>
@font-face
{
font-family: myFont;
src: local("HGMaruGothicMPRO");//加载字体,HGMaruGothicMPRO为字体名字
}
</mx:Style>
<mx:Label text="文本内容" height="18" id="lable1" fontSize="12" fontFamily="myFont" />
方法二:(script)
<mx:Script>
<![CDATA[
[Embed(mimeType='application/x-font', source='HGRSMP.TTF', fontName='myFont')]//调用字体如
HGRSMP.TTF。可将字体放在同一目录下
private var myFont:Class;
]]>
</mx:Script>
<mx:Label text="文本内容" height="18" id="lable1" fontSize="12" fontFamily="myFont" />,
相关文档:
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Zoom effect. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Style />
<mx:Script>
& ......
使用到的as3gif,请到Google去下载
<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="horizontal" xmlns:file="file.*" xmlns:commont="commont.*">
<mx:TitleWindow title="abc" id="ADwindow" width="400" height="283" >
< ......
<?xml version="1.0" encoding="utf-8"?>
<!-- Simple example to demonstrate the Zoom effect. -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml
">
<mx:Style source="style/style.css"/>
<mx:Scri ......
最近看了一下Flex嵌入字体的方法,把最后使用的方法记录下来,以备后用。
首先加入如下样式,
<mx:Style>
@font-face {
src:url("assets/jdzy.ttf");
fontFamily: myFont;
advancedAntiAliasing: true;
}
.myShowFont {
fontFamily: myFont;
}
</mx:Style>
再将需 ......