android 全局换字体,Android 更换app 全局系统字体实现

该博客介绍了如何在Android应用中使用Calligraphy库初始化默认字体,并改变字间距。通过设置`fontPath`属性和`android:textScaleX`属性,可以实现字体的更换和字间距的调整。同时,提供了主题样式配置示例,包括`AppTheme`和`DiscountIndicatorsTheme`,以及相应的TextView样式。
摘要由CSDN通过智能技术生成

CalligraphyConfig.initDefault(new

CalligraphyConfig.Builder()

.setDefaultFontPath("fonts/hyxzyj.ttf")

.setFontAttrId(R.attr.fontPath)

.build());

http://blog.csdn.net/mlj1668956679/article/details/38679657​

更换app默认字间距(配合字体库 实现 ,字间距的变化 ,textview 的

android:textScaleX设置)

参考:http://blog.csdn.net/ljz2009y/article/details/22087575​

<

style name="AppTheme"

parent="android:Theme.Holo.Light.DarkActionBar">

<   item

name="android:windowNoTitle">true

<   !--

Customize your theme here. -->

@style/AppTheme.Widget.TextView

<   item

name="android:textColor">@color/standard_text_black

<

/style>

<

style name="AppTheme.Widget.TextView"

parent="android:Widget.Holo.Light.TextView">

<   item

name="fontPath">fonts/hyxzyj.ttf

<   item

name="android:textScaleX">1.08

<

/style>

<

style name="DiscountIndicatorsTheme"

parent="AppTheme">

<   item

name="vpiTabPageIndicatorStyle">@style/DiscountTabPageIndicator<

/item>

<

/style>

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值