2011-05-04 111 views
1

如何爲粗體和普通字體安裝多種字體,我正在嘗試更改默認字體。Flex 4更改默認字體

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

    @font-face { 
     font-family: localVerdana; 
     src: url("assets/verdana.ttf"); 
     src: url("assets/verdanab.ttf"); 
    } 

    s|Label { 
     font-family: localVerdana; 
    } 

    s|TextInput { 
     font-family: localVerdana; 
    } 

    s|TextArea { 
     font-family: localVerdana; 
    } 

</fx:Style> 

回答

2

你需要有一個@字體面對面聲明每種款式,重量字體的使用

@font-face 
{ 
    src:     url("assets/verdana.ttf"); 
    font-family:   localVerdana; 
    font-style:    normal; 
    font-weight:   normal; 
    embed-as-cff:   true; 
    advanced-anti-aliasing: true; 

} 

@font-face 
{ 
    src:     url("assets/verdanab.ttf"); 
    font-family:   localVerdana; 
    font-style:    normal; 
    font-weight:   bold; 
    embed-as-cff:   true; 
    advanced-anti-aliasing: true; 

}