2013-01-10 26 views
0

我使用PhoneGap在Android中實現了一個應用程序。所以UI是用jQuery Mobile實現的。 我使用CSS font-face爲應用程序文本提供自定義字體。PhoneGap應用程序無法加載CSS font-face

@font-face { 
    font-family: "MyFont"; 
    src: url("../fonts/MyFont.ttf") format("truetype"), 
    src: url("../fonts/MyFont.otf") format("opentype"); 
} 
body { 
    font-family: MyFont; 
} 

但是,當我在Android上安裝應用程序時,文本顯示爲默認字體。

我該如何解決Android中的這個問題?

回答

0

這是一個正確的語法,在Android手機的工作原理:

@font-face { 
    font-family: 'yanone'; 
    src: url('fonts/yanone/YanoneKaffeesatz-Regular-webfont.eot?') format('eot'), 
     url('fonts/yanone/YanoneKaffeesatz-Regular-webfont.woff') format('woff'), 
     url('fonts/yanone/YanoneKaffeesatz-Regular-webfont.ttf') format('truetype'), 
     url('fonts/yanone/YanoneKaffeesatz-Regular-webfont.svg#webfont') format('svg'); 
    font-weight: normal; 
    font-style: normal; 
} 

你也應該小心你的自定義字體相對路徑。

+0

Thx,但無法正常工作,我的手機是Xperia Neo L – AML

+0

不適用於me.Mine is microamax mini tab – gnganpath