question: private void calculateUsingTextSize ( final float textSize ) { if ( msText == null ) return ; final float availableWidth ; final float newTextSize ; boolean updateDrawText = false ; if ( isClose ( textSize , mfCollapsedTextSize ) ) { availableWidth = mCollapsedBounds . width ( ) ; newTextSize = mfCollapsedTextSize ; mScale = 1f ; } else { availableWidth = mExpandedBounds . width ( ) ; newTextSize = mfExpandedTextSize ; if ( isClose ( textSize , mfExpandedTextSize ) ) { mScale = 1f ; } else { mScale = textSize / mfExpandedTextSize ; } } if ( availableWidth > 0 ) { updateDrawText = ( mCurrentTextSize != newTextSize ) || mBoundsChanged || updateDrawText ; mCurrentTextSize = newTextSize ; mBoundsChanged = false ; } if ( mTextToDraw == null || updateDrawText ) { mTextPaint . setTextSize ( mCurrentTextSize ) ; final CharSequence title = TextUtils . ellipsize ( msText , mTextPaint , availableWidth , TextUtils . TruncateAt . END ) ; if ( ! TextUtils . equals ( title , mTextToDraw ) ) { mTextToDraw = title ; } } }
target:  The font size is scaled to Collapsed / Expanded Text Size if its anywhere close to these values. Else, the canvas is scaled in draw with the factor calculated here. Adapted from CollapsingTextHelper, AOSP.