Język

MeasuredText.Builder.SetComputeHyphenation Method

Definition

Overloads

Name Description
SetComputeHyphenation(Boolean)

By passing true to this method, the build method will compute all possible hyphenation pieces as well.

SetComputeHyphenation(Int32)

Sets the mode used to compute hyphenation information when the paragraph is built.

SetComputeHyphenation(Boolean)

By passing true to this method, the build method will compute all possible hyphenation pieces as well.

[Android.Runtime.Register("setComputeHyphenation", "(Z)Landroid/graphics/text/MeasuredText$Builder;", "", ApiSince=29)]
public Android.Graphics.Text.MeasuredText.Builder SetComputeHyphenation(bool computeHyphenation);
[<Android.Runtime.Register("setComputeHyphenation", "(Z)Landroid/graphics/text/MeasuredText$Builder;", "", ApiSince=29)>]
member this.SetComputeHyphenation : bool -> Android.Graphics.Text.MeasuredText.Builder

Parameters

computeHyphenation
Boolean

true if you want to use automatic hyphenations.

Returns

This builder instance.

Attributes

Remarks

This method was deprecated in API level 33. use setComputeHyphenation(int) instead.

Pass true to compute hyphenation information when the paragraph is built. Pass false to skip that computation. The default is false.

On Android 16, the greedy line-breaking path can compute hyphenation when needed without precomputed information. This path is used by Simple and by paragraphs that contain tabs. Without tabs, HighQuality and Balanced use precomputed hyphenation information. For automatic hyphenation with these strategies, enable computation with true or use the integer overload with Normal or Fast. The line breaker's hyphenation frequency must also permit hyphenation.

See the strategy selection and hyphenation implementations in Android 16 LineBreaker, GreedyLineBreaker, and OptimalLineBreaker.

Android reference for android.graphics.text.MeasuredText.Builder.setComputeHyphenation.

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

SetComputeHyphenation(Int32)

Sets the mode used to compute hyphenation information when the paragraph is built.

[Android.Runtime.Register("setComputeHyphenation", "(I)Landroid/graphics/text/MeasuredText$Builder;", "", ApiSince=33)]
public Android.Graphics.Text.MeasuredText.Builder SetComputeHyphenation(int mode);
[<Android.Runtime.Register("setComputeHyphenation", "(I)Landroid/graphics/text/MeasuredText$Builder;", "", ApiSince=33)>]
member this.SetComputeHyphenation : int -> Android.Graphics.Text.MeasuredText.Builder

Parameters

mode
Int32

a hyphenation mode. Value is one of the following: HYPHENATION_MODE_NONE; HYPHENATION_MODE_NORMAL; HYPHENATION_MODE_FAST

Returns

This builder instance.

Attributes

Remarks

Pass the integer value of None to skip hyphenation computation, Normal to compute it, or Fast to use the faster algorithm. Only the fast mode ignores some shaping context, such as kerning around a hyphen. The default is no hyphenation computation.

If this builder was created from an existing MeasuredText, hyphenation computation must remain enabled or disabled as it was for that instance. Otherwise, Build() fails.

See the mode selection and reuse checks in the Android 16 implementation.

Android reference for android.graphics.text.MeasuredText.Builder.setComputeHyphenation.

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