语言

Paint.GetTextRunAdvances 方法

定义

检索文本的字符前进。

[Android.Runtime.Register("getTextRunAdvances", "([CIIIIZ[FI)F", "GetGetTextRunAdvances_arrayCIIIIZarrayFIHandler", ApiSince=29)]
public virtual float GetTextRunAdvances(char[] chars, int index, int count, int contextIndex, int contextCount, bool isRtl, float[]? advances, int advancesIndex);
[<Android.Runtime.Register("getTextRunAdvances", "([CIIIIZ[FI)F", "GetGetTextRunAdvances_arrayCIIIIZarrayFIHandler", ApiSince=29)>]
abstract member GetTextRunAdvances : char[] * int * int * int * int * bool * single[] * int -> single
override this.GetTextRunAdvances : char[] * int * int * int * int * bool * single[] * int -> single

参数

chars
Char[]

要度量的文本。

index
Int32

要度量的第一个字符的索引

count
Int32

要度量的字符数

contextIndex
Int32

用于调整上下文的第一个字符的索引。 上下文必须涵盖度量目标。

contextCount
Int32

要用于调整上下文的字符数。 上下文必须涵盖度量目标。

isRtl
Boolean

运行是否在 RTL 方向

advances
Single[]

数组要接收预付,必须具有所有提前的余地。 仅当需要总提前时,这可以为 null

advancesIndex
Int32

将对应于字符的前进位置置于起始位置

返回

总提前(以像素为单位)

特性

注解

检索文本的字符前进。

返回字符运行indexcount中字符的总前进宽度,如果advances不是 null,则分配给其中每个字符(java chars) 的提前宽度。

有效代理项对中的尾随代理项被分配为 0。 因此,返回的前进次数始终等于计数,而不是运行所表示的 unicode 码位数。

在结结或组合标记的情况下,将总提前分配给第一个逻辑字符,并将以下字符指定为 0。

这将为重新排序的分类中的字符生成字形的前进总和,作为群集中第一个逻辑字符的宽度,对于群集中所有其他字符的宽度为 0。 实际上,此类群集被视为结膜。

整形边界限制可用于定形分析的开始和结束可用的上下文量。 这些边界通常反映不发生定形的 bidi 级别或字体指标的变化。

Java文档android.graphics.Paint.getTextRunAdvances(char[], int, int, int, int, boolean, float[], int)。

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于