@@ -8,7 +8,7 @@ public static float measureText(string text, TextStyle style) {
88 char startingChar = text [ 0 ] ;
99 float totalWidth = 0 ;
1010 if ( char . IsHighSurrogate ( startingChar ) || EmojiUtils . isSingleCharEmoji ( startingChar ) ) {
11- float advance = style . fontSize + style . letterSpacing ;
11+ float advance = style . fontSize * EmojiUtils . advanceFactor + style . letterSpacing ;
1212 for ( int i = 0 ; i < text . Length ; i ++ ) {
1313 char ch = text [ i ] ;
1414 if ( char . IsHighSurrogate ( ch ) || EmojiUtils . isSingleCharNonEmptyEmoji ( ch ) ) {
@@ -42,7 +42,7 @@ public static int computeTruncateCount(float offset, string text, int start, int
4242 char startingChar = text [ start ] ;
4343 float currentAdvance = offset ;
4444 if ( char . IsHighSurrogate ( startingChar ) || EmojiUtils . isSingleCharEmoji ( startingChar ) ) {
45- float advance = style . fontSize + style . letterSpacing ;
45+ float advance = style . fontSize * EmojiUtils . advanceFactor + style . letterSpacing ;
4646 for ( int i = 0 ; i < count ; i ++ ) {
4747 char ch = text [ start + i ] ;
4848 if ( char . IsHighSurrogate ( ch ) || EmojiUtils . isSingleCharNonEmptyEmoji ( ch ) ) {
@@ -85,7 +85,7 @@ public static float computeCharWidths(float offset, string text, int start, int
8585 char startingChar = text [ start ] ;
8686 float totalWidths = 0 ;
8787 if ( char . IsHighSurrogate ( startingChar ) || EmojiUtils . isSingleCharEmoji ( startingChar ) ) {
88- float advance = style . fontSize + style . letterSpacing ;
88+ float advance = style . fontSize * EmojiUtils . advanceFactor + style . letterSpacing ;
8989 for ( int i = 0 ; i < count ; i ++ ) {
9090 char ch = text [ start + i ] ;
9191 if ( char . IsHighSurrogate ( ch ) || EmojiUtils . isSingleCharNonEmptyEmoji ( ch ) ) {
@@ -224,16 +224,15 @@ static float _layoutEmoji(string text, int start, int count, TextStyle style, Fo
224224 x += letterSpaceHalfLeft ;
225225 advances [ i ] = letterSpaceHalfLeft ;
226226
227-
227+ float advance = style . fontSize * EmojiUtils . advanceFactor ;
228228 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 ;
231231 var maxY = metrics . descent ;
232232 _updateBounds ( minX , maxX , minY , maxY , ref bounds ) ;
233233
234234 positions [ i ] = x ;
235235
236- float advance = style . fontSize ;
237236 x += advance ;
238237
239238 advances [ i ] += advance ;
0 commit comments