2016-07-06 34 views

回答

1

您必须使用TTF文件IL您的Android项目,以及CSS转换为XML字符串的ressource。 我做了虚拟主机中心字形(有点像字体真棒,但更多的图标)。

https://github.com/neoteknic/whhg-to-android

我可以重用我皈依脚本的制作与这些图标的回购。

编辑: 这是给你: https://github.com/neoteknic/weather-icons-to-android

要使用它(我喜欢负荷只有一次的字样,并使其全局可用):

public class YourAppName extends Application { 
    public static Typeface weatherIcons; 

    @Override 
    public void onCreate(){ 
YourAppName.weatherIcons= Typeface.createFromAsset(getApplicationContext().getResources().getAssets(), "fonts/weathericons-regular-webfont.ttf"); 
     super.onCreate(); 
    } 
} 

然后,当你想使用它:

TextView myicon=(TextView) findViewById(R.id.myicon); 
myicon.setTypeface(YourAppName.weatherIcons); 
myicon.setText(R.string.wi_day_snow_wind);