android+字体稍微加粗,的Android设置的Roboto字体,加粗,斜体,普通,...(有点像自定义字体家族)...
我知道豪設(shè)置自定義字體編程Android應(yīng)用程序內(nèi)。 有沒有什么方法來加載自定義字體(資產(chǎn))的字體和Android框架將使用基于大膽,斜體等適當(dāng)?shù)奈募?#xff1f;的Android設(shè)置的Roboto字體,加粗,斜體,普通,...(有點像自定義字體家族)
比如現(xiàn)在我想的Roboto字體設(shè)置為某個TextView
Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/Roboto/Roboto-Regular.ttf");
textView.setTypeface(typeface);
它工作正常。但因為我設(shè)置TextView中的XML布局大膽,文本不加粗
android:id="@+id/my_id"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="20dp"
android:layout_marginRight="20dp"
android:layout_marginTop="50dp"
android:textStyle="bold"
android:gravity="center"
android:text="@string/my_text"
android:textColor="@color/my_foreground"
android:textSize="24dp" />
如何從資產(chǎn)加載字體正確,這將工作?
textView.setTypeface(typeface, Typeface.BOLD);
在我的資產(chǎn)目錄中只有一個“字體系列”
Roboto-Black.ttf
Roboto-BlackItalic.ttf
Roboto-Bold.ttf
Roboto-BoldCondensed.ttf
Roboto-BoldCondensedItalic.ttf
Roboto-BoldItalic.ttf
Roboto-Condensed.ttf
Roboto-CondensedItalic.ttf
Roboto-Italic.ttf
Roboto-Light.ttf
Roboto-LightItalic.ttf
Roboto-Medium.ttf
Roboto-MediumItalic.ttf
Roboto-Regular.ttf
Roboto-Thin.ttf
Roboto-ThinItalic.ttf
如何加載所有排字體/家庭里面的字體?
2012-03-02
zmeda
總結(jié)
以上是生活随笔為你收集整理的android+字体稍微加粗,的Android设置的Roboto字体,加粗,斜体,普通,...(有点像自定义字体家族)...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: eureka配置_F版本SpringCl
- 下一篇: Makefile工程管理语法与使用技巧