MitchBu Well-Known Member Licensed User Longtime User Dec 27, 2020 #1 Is there any way to measure the width of a given string for a given font and size ? I found the SizeToFit routines, but there does not seem to be the equivalent of the B4A canvas routine.
Is there any way to measure the width of a given string for a given font and size ? I found the SizeToFit routines, but there does not seem to be the equivalent of the B4A canvas routine.
Star-Dust Expert Licensed User Longtime User Dec 27, 2020 #2 use B4XCanvas.MeasureText to measure height and width in cross platform B4X: Dim Rec As B4XRect = Can.MeasureText(txt,xui.CreateDefaultFont(dt)) log(Rec.Width) log(Rev.Height) Last edited: Dec 27, 2020 Upvote 0
use B4XCanvas.MeasureText to measure height and width in cross platform B4X: Dim Rec As B4XRect = Can.MeasureText(txt,xui.CreateDefaultFont(dt)) log(Rec.Width) log(Rev.Height)