I. Frameworks/base/CORE/Java/Android/content/RES/configuration. Java:
The public void settodefaults () method is modified,
If you want to change the font to a mega font by default, change it to 1.15f.
Public void settodefaults (){
Fontscale = 1.15f; // normal value is 1
MCC = MNC = 0;
Ii. Packages \ apps \ Settings \ res \ values \ arrays. xml:
<String-array name = "entryvalues_font_size" translatable = "false">
<Item> 0.85 </item>
<Item> 1.15 </item>
<Item> 1.20 </item>
<Item> 1.30 </item>
</String-array>
Note: After you modify the default font, change the settings to the corresponding one.
Later, we thought we could use the property to control the default font size, which made it much easier to modify.
I. Frameworks/base/CORE/Java/Android/content/RES/configuration. Java:
Import Android. OS. Build;
Public void settodefaults (){
String scale = build. default_fontscale;
If (scale. Assign signorecase (build. Unknown) = false)
{
Fontscale = float. valueof (build. default_fontscale). floatvalue ();
}
Else
{
Fontscale = 1.0f;
}
Ii. Frameworks \ base \ core \ Java \ Android \ OS \ build. Java
/** A property to set fontscale */
Public static final string default_fontscale = getstring ("Ro. Property. fontscale ");
3: You can set the default font size through system attributes.
Note: Make Update-API must be executed before compilation.