text: [API] reduce size of Glyph.Runes to uint16

This shrinks text.Glyph from 72B to 58B.

  LabelStatic/1000runes-RTL-arabic-32   63.62µ ± 0%   62.05µ ± 0%  -2.47% (p=0.002 n=6)

Signed-off-by: Egon Elbre <egonelbre@gmail.com>
This commit is contained in:
Egon Elbre
2023-10-23 21:40:10 +03:00
committed by Chris Waldon
parent 62edabe137
commit df8a8789a3
3 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -138,7 +138,7 @@ func (it *textIterator) processGlyph(g text.Glyph, ok bool) (_ text.Glyph, visib
if it.maxLines > 0 {
if g.Flags&text.FlagTruncator != 0 && g.Flags&text.FlagClusterBreak != 0 {
// A glyph carrying both of these flags provides the count of truncated runes.
it.truncated = g.Runes
it.truncated = int(g.Runes)
}
if g.Flags&text.FlagLineBreak != 0 {
it.linesSeen++