@@ -8,7 +8,7 @@ public static float measureText(string text, TextStyle style) {
8
8
char startingChar = text [ 0 ] ;
9
9
float totalWidth = 0 ;
10
10
if ( char . IsHighSurrogate ( startingChar ) || EmojiUtils . isSingleCharEmoji ( startingChar ) ) {
11
- float advance = style . fontSize + style . letterSpacing ;
11
+ float advance = style . fontSize * EmojiUtils . advanceFactor + style . letterSpacing ;
12
12
for ( int i = 0 ; i < text . Length ; i ++ ) {
13
13
char ch = text [ i ] ;
14
14
if ( char . IsHighSurrogate ( ch ) || EmojiUtils . isSingleCharNonEmptyEmoji ( ch ) ) {
@@ -42,7 +42,7 @@ public static int computeTruncateCount(float offset, string text, int start, int
42
42
char startingChar = text [ start ] ;
43
43
float currentAdvance = offset ;
44
44
if ( char . IsHighSurrogate ( startingChar ) || EmojiUtils . isSingleCharEmoji ( startingChar ) ) {
45
- float advance = style . fontSize + style . letterSpacing ;
45
+ float advance = style . fontSize * EmojiUtils . advanceFactor + style . letterSpacing ;
46
46
for ( int i = 0 ; i < count ; i ++ ) {
47
47
char ch = text [ start + i ] ;
48
48
if ( char . IsHighSurrogate ( ch ) || EmojiUtils . isSingleCharNonEmptyEmoji ( ch ) ) {
@@ -85,7 +85,7 @@ public static float computeCharWidths(float offset, string text, int start, int
85
85
char startingChar = text [ start ] ;
86
86
float totalWidths = 0 ;
87
87
if ( char . IsHighSurrogate ( startingChar ) || EmojiUtils . isSingleCharEmoji ( startingChar ) ) {
88
- float advance = style . fontSize + style . letterSpacing ;
88
+ float advance = style . fontSize * EmojiUtils . advanceFactor + style . letterSpacing ;
89
89
for ( int i = 0 ; i < count ; i ++ ) {
90
90
char ch = text [ start + i ] ;
91
91
if ( char . IsHighSurrogate ( ch ) || EmojiUtils . isSingleCharNonEmptyEmoji ( ch ) ) {
@@ -224,16 +224,15 @@ static float _layoutEmoji(string text, int start, int count, TextStyle style, Fo
224
224
x += letterSpaceHalfLeft ;
225
225
advances [ i ] = letterSpaceHalfLeft ;
226
226
227
-
227
+ float advance = style . fontSize * EmojiUtils . advanceFactor ;
228
228
var minX = x ;
229
- var maxX = metrics . descent - metrics . ascent + x ;
230
- var minY = metrics . ascent ;
229
+ var maxX = advance + x ;
230
+ var minY = - style . fontSize * EmojiUtils . sizeFactor ;
231
231
var maxY = metrics . descent ;
232
232
_updateBounds ( minX , maxX , minY , maxY , ref bounds ) ;
233
233
234
234
positions [ i ] = x ;
235
235
236
- float advance = style . fontSize ;
237
236
x += advance ;
238
237
239
238
advances [ i ] += advance ;
0 commit comments