|
|
|
|
|
|
List<float> _lineWidths = new List<float>(); |
|
|
|
// float[] _lineBaseLines;
|
|
|
|
GlyphLine[] _glyphLines; |
|
|
|
GlyphPosition[] glyphPositions; |
|
|
|
PaintRecord[] _paintRecords; |
|
|
|
CodeUnitRun[] _codeUnitRuns; |
|
|
|
float[] _lineHeights; |
|
|
|
float[] _textBlobPositions; |
|
|
|
float[] _lineHeights; |
|
|
|
GlyphPosition[] glyphPositions; |
|
|
|
PaintRecord[] _paintRecords; |
|
|
|
CodeUnitRun[] _codeUnitRuns; |
|
|
|
int _paintRecordsCount; |
|
|
|
int _codeUnitRunsCount; |
|
|
|
bool _didExceedMaxLines; |
|
|
|
|
|
|
int ellipsizedLength = this._text.Length + (this._paragraphStyle.ellipsis?.Length ?? 0); |
|
|
|
|
|
|
|
// All text blobs share a single position buffer, which is big enough taking ellipsis into consideration
|
|
|
|
builder.allocPos(ellipsizedLength); |
|
|
|
if (this._textBlobPositions == null || this._textBlobPositions.Length < ellipsizedLength) { |
|
|
|
this._textBlobPositions = new float[ellipsizedLength]; |
|
|
|
} |
|
|
|
builder.setPositions(this._textBlobPositions); |
|
|
|
// this._glyphLines and this._codeUnitRuns will refer to this array for glyph positions
|
|
|
|
if (this.glyphPositions == null || this.glyphPositions.Length < ellipsizedLength) { |
|
|
|
this.glyphPositions = new GlyphPosition[ellipsizedLength]; |
|
|
|
|
|
|
runXOffset += advance; |
|
|
|
|
|
|
|
// Create code unit run
|
|
|
|
CodeUnitRun codeUnitRun = new CodeUnitRun( |
|
|
|
this._codeUnitRuns[this._codeUnitRunsCount++] = new CodeUnitRun( |
|
|
|
this._codeUnitRuns[this._codeUnitRunsCount++] = codeUnitRun; |
|
|
|
|
|
|
|
lineStyleRunIndex++; |
|
|
|
} |
|
|
|