碼上歡樂
首頁
榜單
標簽
關於
搜索
相關內容
簡體
繁體
Flex 宋體、黑體、楷體、仿宋字體樣式
本文轉載自
查看原文
2012-04-11 15:54
4894
Flex
s|Label { font-family: FangSong_GB2312; /*SimSun,SimHei,KaiTi_GB2312,FangSong_GB2312,*/ /*以上四種字體默認使用的是本地設備字體,無法開啟抗鋸齒功能,字體邊緣有毛邊*/ backgroundColor: #000000; color: #FF0000; fontSize: 128px; line-height:128px; letter-spacing:0px; /*fontStyle: italic;*/ /*fontWeight: bold;*/ /*textDecoration: underline;*/ }
測試頁面
<?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" minWidth="955" minHeight="600"> <!--<fx:Style source="ydp.css"/>--> <fx:Script> <![CDATA[ protected function button1_clickHandler(event:MouseEvent):void { // TODO Auto-generated method stub this.lbText.setStyle("fontFamily", "SimSun"); } protected function button2_clickHandler(event:MouseEvent):void { // TODO Auto-generated method stub this.lbText.setStyle("fontFamily", "SimHei"); } protected function button3_clickHandler(event:MouseEvent):void { // TODO Auto-generated method stub this.lbText.setStyle("fontFamily", "FangSong_GB2312"); } protected function button4_clickHandler(event:MouseEvent):void { // TODO Auto-generated method stub this.lbText.setStyle("fontFamily", "KaiTi_GB2312"); } ]]> </fx:Script> <fx:Declarations> <!-- 將非可視元素(例如服務、值對象)放在此處 --> </fx:Declarations> <s:Label id="lbText" x="96" y="67" text="低碳交通 綠色通行" width="512" height="256" backgroundColor="#000000" color="#FF0000" fontSize="128" lineHeight="128" /> <s:Button x="4" y="3" label="宋體" click="button1_clickHandler(event)" /> <s:Button x="82" y="3" label="黑體" click="button2_clickHandler(event)"/> <s:Button x="167" y="3" label="仿宋" click="button3_clickHandler(event)"/> <s:Button x="245" y="3" label="楷體" click="button4_clickHandler(event)"/> </s:Application>
×
免責聲明!
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。
猜您在找
【完美解決】mac word2016 仿宋_GB2312/楷體_GB2312中文字體顯示
css設置中文字體(font-family:"黑體")后樣式失效問題
思源黑體CN 思源宋體CN TTF 及 字段瘦身
jeecg富文本編輯器增加字體(仿宋)
windows 7和windows xp下的黑體字體不一樣
ubuntu14.04中文楷體變默認字體
css字體樣式+文本樣式
CSS樣式規則及字體樣式
Linux 環境下思源黑體字體與 Java 之間的兼容性問題的解決
軟件教程——將sw尺寸字體改變為黑體,並保存零件模板
粵ICP備18138465號
© 2018-2026 CODEPRJ.COM