@@ -10,7 +10,7 @@ type ClickableSpan = new (owner: Span) => android.text.style.ClickableSpan;
1010export function adjustMinMaxFontScale ( value , view ) {
1111 // Only for iOS
1212}
13- function formattedStringToNativeString ( formattedString , parent ?, parentView = formattedString . parent , density ?, scaleLineHeight ?) {
13+ function formattedStringToNativeString ( formattedString , parent ?, parentView = formattedString . parent , density ?, scaleLineHeight ?) {
1414 let maxFontSize = formattedString ?. fontSize || parentView ?. fontSize || 0 ;
1515 formattedString . spans . forEach ( ( s ) => {
1616 if ( s . fontSize ) {
@@ -22,7 +22,7 @@ function formattedStringToNativeString(formattedString, parent?, parentView = fo
2222 parent = formattedString ;
2323 }
2424 formattedString . spans . forEach ( ( s , index ) => {
25- const spanDetails = typeof s === 'string' ? s : spanToNativeString ( s , parent , parentView , maxFontSize , index , density ) ;
25+ const spanDetails = typeof s === 'string' ? s : spanToNativeString ( s , parent , parentView , maxFontSize , index , density , scaleLineHeight ) ;
2626 if ( spanDetails ) {
2727 options . push ( spanDetails ) ;
2828 }
@@ -69,7 +69,8 @@ function spanToNativeString(span, parent: any, parentView: any, maxFontSize?, in
6969 // console.log('text FONT_SIZE_FACTOR', FONT_SIZE_FACTOR, Screen.mainScreen.scale)
7070 verticalTextAlignment = span . verticalAlignment || parent ?. verticalAlignment ;
7171 }
72- if ( density === 1 ) {
72+ // this is only needed when used with Text/Label components. Not canvas
73+ if ( scaleLineHeight ) {
7374 lineHeightFactor = com . nativescript . text . Font . getFontSizeFactor ( Utils . android . getApplicationContext ( ) ) ;
7475 }
7576 let backgroundColor = span . backgroundColor || parent ?. backgroundColor ;
0 commit comments