b4x-de Active Member Licensed User Longtime User Jul 4, 2025 #1 I have a question about the StringUtils function MeasureMultilineTextHeight. Does this function take into account the font size that the user has set individually in the system settings? The individual setting can be queried via the accessibility library with GetUserFontScale(). I have the impression that this is not the case and that the determined text height has to be multiplied by the set font size afterwards. Is it right to do it this way? B4X: Private Sub MeasureMultilineTextHeightUserScaled(xLabel As B4XView) As Double Dim su As StringUtils Dim acc As Accessibility Return su.MeasureMultilineTextHeight(xLabel,xLabel.Text) * acc.GetUserFontScale End Sub
I have a question about the StringUtils function MeasureMultilineTextHeight. Does this function take into account the font size that the user has set individually in the system settings? The individual setting can be queried via the accessibility library with GetUserFontScale(). I have the impression that this is not the case and that the determined text height has to be multiplied by the set font size afterwards. Is it right to do it this way? B4X: Private Sub MeasureMultilineTextHeightUserScaled(xLabel As B4XView) As Double Dim su As StringUtils Dim acc As Accessibility Return su.MeasureMultilineTextHeight(xLabel,xLabel.Text) * acc.GetUserFontScale End Sub
Erel B4X founder Staff member Licensed User Longtime User Jul 6, 2025 #2 I've just made a small test and it does factor the user scale. It happens because the label text size is actually scaled. Upvote 0
I've just made a small test and it does factor the user scale. It happens because the label text size is actually scaled.