日韩av黄I国产麻豆传媒I国产91av视频在线观看I日韩一区二区三区在线看I美女国产在线I麻豆视频国产在线观看I成人黄色短片

歡迎訪問 生活随笔!

生活随笔

當(dāng)前位置: 首頁 >

android+字体稍微加粗,的Android设置的Roboto字体,加粗,斜体,普通,...(有点像自定义字体家族)...

發(fā)布時(shí)間:2023/12/10 38 豆豆
生活随笔 收集整理的這篇文章主要介紹了 android+字体稍微加粗,的Android设置的Roboto字体,加粗,斜体,普通,...(有点像自定义字体家族)... 小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

我知道豪設(shè)置自定義字體編程Android應(yīng)用程序內(nèi)。 有沒有什么方法來加載自定義字體(資產(chǎn))的字體和Android框架將使用基于大膽,斜體等適當(dāng)?shù)奈募?#xff1f;的Android設(shè)置的Roboto字體,加粗,斜體,普通,...(有點(diǎn)像自定義字體家族)

比如現(xiàn)在我想的Roboto字體設(shè)置為某個(gè)TextView

Typeface typeface = Typeface.createFromAsset(getAssets(), "fonts/Roboto/Roboto-Regular.ttf");

textView.setTypeface(typeface);

它工作正常。但因?yàn)槲以O(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)目錄中只有一個(gè)“字體系列”

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)容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。