Freigeben über


Configuration.FontScale Property

Definition

Current user preference for the scaling factor for fonts, relative to the base density scaling.

[Android.Runtime.Register("fontScale")]
public float FontScale { get; set; }
[<Android.Runtime.Register("fontScale")>]
member this.FontScale : single with get, set

Property Value

Attributes

Remarks

Current user preference for the scaling factor for fonts, relative to the base density scaling.

Note: Please do not use this to hardcode font size equations. The equation for font scaling is now non-linear; this coefficient is no longer used as a direct multiplier to determine font size. It exists for informational purposes only.

Please use android.util.TypedValue#applyDimension(int, float, DisplayMetrics) or android.util.TypedValue#deriveDimension(int, float, DisplayMetrics) to convert between scaled font size dimensions and pixels.

Java documentation for android.content.res.Configuration.fontScale.

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to