Flex中如何给DateField使用嵌入字体的例子

By Minidxer | January 6, 2009

其实关于字体的例子前面已经介绍了不少了,接下来的例子演示了Flex中如何给DateField使用嵌入字体。

让我们先来看一下Demo可以右键View Source或点击这里察看源代码):


下面是完整代码(或点击这里察看):

Download: main.mxml
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml"
  3.         layout="vertical"
  4.         verticalAlign="top"
  5.         backgroundColor="white">
  6.  
  7.     <mx:Style>
  8.         @font-face {
  9.             src: local("Comic Sans MS");
  10.             fontFamily: "ComicEmbedded";
  11.             fontWeight: normal;
  12.             unicode-range: U+0030-U+0039, /* 0-9 */
  13.                 U+002F-U+002F; /* slash (/) */
  14.         }
  15.  
  16.         @font-face {
  17.             src: local("Comic Sans MS");
  18.             fontFamily: "ComicEmbedded";
  19.             fontWeight: bold;
  20.             unicode-range:
  21.                 U+0030-U+0039, /* 0-9 */
  22.                 U+0041-U+0051, /* Uppercase A-Z */
  23.                 U+0052-U+007A; /* Lowercase a-z */
  24.         }
  25.     </mx:Style>
  26.  
  27.     <mx:DateField id="dateField"
  28.             fontFamily="ComicEmbedded"
  29.             color="red" />
  30.  
  31. </mx:Application>
代码:Peter deHaan 翻译/整理/编译:中文Flex例子

Topics: Font | No Comments » | Tags: , ,

Search Posts