Paint.HasGlyph(String) Method

Definition

Determine whether the typeface set on the paint has a glyph supporting the string.

[Android.Runtime.Register("hasGlyph", "(Ljava/lang/String;)Z", "GetHasGlyph_Ljava_lang_String_Handler", ApiSince=23)]
public virtual bool HasGlyph (string? string);
[<Android.Runtime.Register("hasGlyph", "(Ljava/lang/String;)Z", "GetHasGlyph_Ljava_lang_String_Handler", ApiSince=23)>]
abstract member HasGlyph : string -> bool
override this.HasGlyph : string -> bool

Parameters

string
String

the string to test whether there is glyph support

Returns

true if the typeface has a glyph for the string

Attributes

Remarks

Determine whether the typeface set on the paint has a glyph supporting the string. The simplest case is when the string contains a single character, in which this method determines whether the font has the character. In the case of multiple characters, the method returns true if there is a single glyph representing the ligature. For example, if the input is a pair of regional indicator symbols, determine whether there is an emoji flag for the pair.

Finally, if the string contains a variation selector, the method only returns true if the fonts contains a glyph specific to that variation.

Checking is done on the entire fallback chain, not just the immediate font referenced.

Java documentation for android.graphics.Paint.hasGlyph(java.lang.String).

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