2011-09-27 9 views

回答

1
在android系統

只有四個fonttype面

TypeFace

Typeface.DEFAULT 
Typeface.MONOSPACE 
Typeface.SANS_SERIF 
Typeface.SERIF 

字體型

Typeface.NORMAL 
Typeface.BOLD 
Typeface.BOLD_ITALIC 
Typeface.ITALIC 

你可以用這樣的

textView.setTypeface(Typeface.DEFAULT, Typeface.BOLD); 

和其他方式,你可以下載任何.TTF文件,並把它放在資源文件夾並像這樣使用

Typeface type=Typeface.createFromAsset(context.getAssets(), 
     "DroidSansMono.ttf"); 
textView.setTypeface(type, null); 
0

你在佈局xml中試過這個屬性嗎?

android:height="10dp" //Use as many pixel as you want here 
+0

我想保存舊的高度,使字體更加薄。可能嗎? – drifter

0

,如果你願意,你可以使用其他字體,以及:

android:typeface="monospace" 

或增加文本的大小:

android:textSize="15sp" 
0

您可以使用fontFamily中做到這一點:

的XML:

android:fontFamily="sans-serif-light" 

編程

textView.setTypeface(Typeface.create("sans-serif-light", Typeface.NORMAL));