Udostępnij za pośrednictwem


Paint.TextLocales Property

Definition

Get the text locale list. -or- Set the text locale list.

public virtual Android.OS.LocaleList TextLocales { [Android.Runtime.Register("getTextLocales", "()Landroid/os/LocaleList;", "GetGetTextLocalesHandler", ApiSince=24)] get; [Android.Runtime.Register("setTextLocales", "(Landroid/os/LocaleList;)V", "GetSetTextLocales_Landroid_os_LocaleList_Handler", ApiSince=24)] set; }
[<get: Android.Runtime.Register("getTextLocales", "()Landroid/os/LocaleList;", "GetGetTextLocalesHandler", ApiSince=24)>]
[<set: Android.Runtime.Register("setTextLocales", "(Landroid/os/LocaleList;)V", "GetSetTextLocales_Landroid_os_LocaleList_Handler", ApiSince=24)>]
member this.TextLocales : Android.OS.LocaleList with get, set

Property Value

the paint's LocaleList used for drawing text, never null or empty.

Attributes

Remarks

Property getter documentation:

Get the text locale list.

Java documentation for android.graphics.Paint.getTextLocales().

Property setter documentation:

Set the text locale list.

The text locale list affects how the text is drawn for some languages.

For example, if the locale list contains Locale#CHINESE or Locale#CHINA, then the text renderer will prefer to draw text using a Chinese font. Likewise, if the locale list contains Locale#JAPANESE or Locale#JAPAN, then the text renderer will prefer to draw text using a Japanese font. If the locale list contains both, the order those locales appear in the list is considered for deciding the font.

This distinction is important because Chinese and Japanese text both use many of the same Unicode code points but their appearance is subtly different for each language.

By default, the text locale list is initialized to a one-member list just containing the system locales. This assumes that the text to be rendered will most likely be in the user's preferred language.

If the actual language or languages of the text is/are known, then they can be provided to the text renderer using this method. The text renderer may attempt to guess the language script based on the contents of the text to be drawn independent of the text locale here. Specifying the text locales just helps it do a better job in certain ambiguous cases.

Java documentation for android.graphics.Paint.setTextLocales(android.os.LocaleList).

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