B4A Question b4xCanvas MeasureText (Multiline) - fbritop    
Jan 26, 2021Is it posible to calculate the height of a label and text, but with multiple lines? The way that b4i...
link: https://www.b4x.com/android/forum/threads/sizetofit-routines-measurestringwidth-measurestringheight-...
link:
Have you tried StringUtils.MeasureMultilineTextHeight?
Drawing Multiline Text | B4X Programming For...
link:
this is what you want.
107000
Attached a demo. (tested on B4A and B4J)
The rest is up to your ima...
Bug? MeasureText does not handle Tab correctly - MrKim    
Feb 5, 2023.MeasureText(TAB, Fnt).Width)
Your code MeasureText HERE and below returns 32.87109375. (And why didn... subtract the width of 1 of the bracketing characters I get the same result as MeasureText :
Log(cvs1.MeasureText($"!${TAB}!"$, Fnt).Width)
Log(cvs1.MeasureText($"!"$, Fnt).Width)
Log(cvs1.MeasureText($"!${TAB}!"$, Fnt).Width - cvs1.MeasureText($"!"$...
link: This is not a bug.
1. The measurement comes from the JavaFX API.
2. The measurement of invisible text is unspecified. This is not a measurement of the character width....
B4A Code Snippet [B4X] [XUI] Accurate Text Measurement and Drawing - Erel    
Dec 12, 2022   
(55 reactions).60 includes a new method named B4XCanvas.MeasureText. This method accurately measures single line....MeasureText(Text, Fnt)
Dim BaseLine As Int = CenterY - r.Height / 2 - r.Top
cvs1.DrawText(Text, CenterX..., CenterY As Int)
Dim r As B4XRect = cvs1.MeasureText(Text, Fnt)
Dim BaseLine As Double = CenterY...
link: /method's name "B4XCanvas.MeasureText".
Here a canvas is used to measure a text...
B4A Question B4XCanvas MeasureText & Padding - Erel (first post)    
Oct 10, 2019   
(1 reaction)The code in this example shows how to accurately draw text: https://www.b4x.com/android/forum/threads/b4x-xui-accurate-text-measurement-and-drawing.92810/
You can draw the text instead of using label...
link: I´m using the MeasureText from B4XCanvas. As it gives you the correct height, the problem goes...
B4A Question B4XCanvas.MeasureText for CharSequence - Toky Olivier (first post)    
Jun 16, 2019Almost. It should be in Globals as it holds an activity context.
OK, thank you. I'll do like you...
link: I should declare the B4XCanvas object in the Process Global section, initialize it in the Activity_C...
link: Thank you Erel. What do you mean: Create the canvas once with a 1x1 mutable bitmap please?
I should...
link: Note that your code is inefficient. Create the canvas once with a 1x1 mutable bitmap and reuse it.
C...
B4A Code Snippet FontAwesome To Bitmap - Erel    
Jun 2, 2020   
(21 reactions)   
tags: UI.MeasureText(Text, fnt)
Dim BaseLine As Int = cvs1.TargetRect.CenterY - r.Height / 2 - r.Top
cvs1...
link: .MeasureText(Text, fnt)
Dim BaseLine As Int = cvs1.TargetRect.CenterY - r.Height / 2 - r.Top...
B4A Code Snippet [B4X] B4XDialog with adjustable button widths - Erel    
Nov 4, 2025   
(22 reactions) r As B4XRect = Canvas1.MeasureText(btn.Text, btn.Font)
Dim width As Float = r.Width...
B4J Code Snippet Measure Text - stevel05    
Oct 19, 2014   
(10 reactions)SubName: MeasureText
Description: I came across this while searching the internet. As it seems...) 'Load the layout file.
MainForm.Show
Dim TM As TextMetric = MeasureText("Test",fx...
link: SubName: MeasureText
Description: I was itching to use NativeObject for something useful and tried...
link: into the original will do it.
Public Sub MeasureText(Text As String,TFont As Font) As Double()
Dim T...
link: ) 'Load the layout file.
MainForm.Show
Dim TM As TextMetric = MeasureText("Test",fx...
Spanish B4X - Uso de custom fonts icons (SliderMenu) - TILogistic    
Jun 30, 2021   
(28 reactions))
Dim cvs1 As B4XCanvas
cvs1.Initialize(p)
Dim r As B4XRect = cvs1.MeasureText(FontText...
B4A Code Snippet [B4X] B4XTable - Resize columns based on content - Erel    
Apr 1, 2020   
(8 reactions)   
tags: xuiTable, b4xtable(MaxWidth, cvs.MeasureText(txt, lbl.Font).Width + 10dip)
End If
Next
If...
Page: 1  
2  
3  
4  
5  
6  
7