|
|
|
|
|
|
} |
|
|
|
|
|
|
|
public void layout(ParagraphConstraints constraints) { |
|
|
|
if ((!this._needsLayout && this._width == constraints.width) || |
|
|
|
this._text == null || this._text.isEmpty()) { |
|
|
|
if (!this._needsLayout && this._width == constraints.width) { |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
int textCount = textEnd - textStart; |
|
|
|
// Keep track of the pointer to _glyphPositions in the start of this run
|
|
|
|
int glyphPositionStyleRunStart = pGlyphPositions; |
|
|
|
Font font = FontManager.instance.getOrCreate( |
|
|
|
style.fontFamily, |
|
|
|
style.fontWeight, |
|
|
|
style.fontStyle).font; |
|
|
|
|
|
|
|
// Ellipsize the text if ellipsis string is set, and this is the last lineStyleRun of
|
|
|
|
// the current line, and this is the last line or max line is not set
|
|
|
|
|
|
|
font.RequestCharactersInTextureSafe(ellipsis, style.UnityFontSize, style.UnityFontStyle); |
|
|
|
float ellipsisWidth = Layout.measureText(ellipsis, style); |
|
|
|
|
|
|
|
// Find the minimum number of characters to truncate, so that the truncated text
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
// Create paint record
|
|
|
|
var font = FontManager.instance.getOrCreate(style.fontFamily, |
|
|
|
style.fontWeight, style.fontStyle).font; |
|
|
|
var metrics = FontMetrics.fromFont(font, style.UnityFontSize); |
|
|
|
PaintRecord paintRecord = new PaintRecord(style, runXOffset, 0, builder.make(), |
|
|
|
metrics, advance); |
|
|
|