Recent projects appear to set the font to the song body, Microsoft Ya Black, bold, italic and other needs;
Mom found Android system supports three fonts by default: "Sans", "serif", "monospace", in addition to other font files (*.TTF)
The code is as follows:
Get TextView Control Object
TextView TextView = (TextView) Findviewbyid (R.id.custom);
Save the font file in the assets/fonts/directory and create the typeface object
Typeface Typeface = Typeface.createfromasset (Getassets (), "Fonnts/fangsongti.ttf");
Use fonts as Fangsong
Textview.settypeface (TypeFace);
Description: Currently Android mainly for Latin language can use font settings, Chinese temporarily do not support; You must create a fonnts folder under assets, and put the font file (. ttf) you want to use, and provide a relative path to Createfronasset () To create a typeface object. However, Android support for fonts is not very good, some font files may not be supported, but also do not error, just use the default font style during the run. In addition, if not the needs of the project, try not to use, the resources are too large, will greatly increase the size of the app.
Font Library Reference Link: Http://pan.baidu.com/s/1bocW0TT
TextView setting fonts in Android