Partager via


Paint.TextRunFlagLeftEdge Field

Definition

A text run flag that indicates the run is located the visually most left segment of the line.

[Android.Runtime.Register("TEXT_RUN_FLAG_LEFT_EDGE", ApiSince=35)]
public const int TextRunFlagLeftEdge = 8192;
[<Android.Runtime.Register("TEXT_RUN_FLAG_LEFT_EDGE", ApiSince=35)>]
val mutable TextRunFlagLeftEdge : int

Field Value

Value = 8192
Attributes

Remarks

A text run flag that indicates the run is located the visually most left segment of the line.

This flag is used for telling the underlying text layout engine that the text is located at the most left of the line. This flag is used for controlling the amount letter spacing added. If the text is in the middle of the line, the text layout engine assigns additional letter spacing to the both side of each letter. On the other hand, the letter spacing should not be added to the visually most left and right of the line. By setting this flag, text layout engine calculates the layout as it is located at the most visually left of the line and doesn't add letter spacing to the left of this run.

Note that the caller must resolve BiDi runs and reorder them visually and set this flag only if the target run is located visually most left position. This left does not always mean the beginning of the text.

If the run covers entire line, caller should set #TEXT_RUN_FLAG_RIGHT_EDGE as well.

Note that this flag is only effective for run based APIs. For example, this flag works for Canvas#drawTextRun(CharSequence, int, int, int, int, float, float, boolean, Paint) and Paint#getRunCharacterAdvance(char[], int, int, int, int, boolean, int, float[], int). However, this doesn't work for Canvas#drawText(CharSequence, int, int, float, float, Paint) or Paint#measureText(CharSequence, int, int). The non-run based APIs works as both #TEXT_RUN_FLAG_LEFT_EDGE and #TEXT_RUN_FLAG_RIGHT_EDGE are specified.

Java documentation for android.graphics.Paint.TEXT_RUN_FLAG_LEFT_EDGE.

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