B4A Code Snippet [B4X] [XUI] Accurate Text Measurement and Drawing - Erel    Dec 12, 2022   (54 reactions) .60 includes a new method named B4XCanvas.MeasureText. This method accurately measures single line strings.
It returns a B4XRect object with the width and height of the measured string. The Top field... Wish B4X XUI Add MeasureTextWidth and MeasureTextHeight to B4XCanvas - klaus    Apr 13, 2018 Hi Erel,
The title says the wish.
Currently, there are three different routines in the class with different results.
Example:
MeasureTextHeight("Mg") and MeasureTextHeight("M"... B4J Code Snippet Measure Multiline Text Height - Erel    Jun 11, 2020   (9 reactions) Measuring the length of multiline text is simple in B4A with StringUtils.MeasureMultilineTextHeight... javafx.scene.text.TextBoundsType; public static double MeasureMultilineTextHeight(Font f, String text... be set: https://www.b4x.com/android/forum/threads/measure-text.45750/#post-311358 Another option is to call a non-public API with the following code: Sub MeasureMultilineTextHeight (Font As Font, Width As Double, Text As String) As Double Dim jo As JavaObject = Me Return jo.RunMethod... B4A Class SizeToFit routines (MeasureStringWidth, MeasureStringHeight, MeasureMultilineStringHeight) - Misterbates    Oct 17, 2017   (22 reactions)   tags: label, , Label Size module with accompanying test/demo.
Requires: StringUtils library (MeasureMultilineTextHeight... that the text fills the label
* MeasureExpectedSize - Returns Width/Height/FontSize (type... B4A Code Snippet [B4X] MeasureMultilineTextHeight - Alexander Stolte    May 11, 2023   (16 reactions) /android/forum/threads/measure-multiline-text-height.84331/#content Private Sub MeasureMultilineTextHeight(xLabel As B4XView) As Double #If B4J 'https://www.b4x.com/android/forum/threads/measure-multiline-text-height.84331/#content Dim jo As JavaObject = Me Return jo.RunMethod("MeasureMultilineTextHeight", Array(xLabel.Font, xLabel.Text, xLabel.Width)) #Else if B4A Dim su As StringUtils Return su.MeasureMultilineTextHeight(xLabel,xLabel.Text) #Else... B4A Question b4xCanvas MeasureText (Multiline) - fbritop    Jan 26, 2021 Is it posible to calculate the height of a label and text, but with multiple lines? The way that b4i SizeToFit works I think.
Thanks
FBP... B4J Code Snippet Measure Text - stevel05    Oct 19, 2014   (10 reactions) .Height & " " & TM.Width)
End Sub
Sub MeasureText(Text As String,TFont As Font...
Dependencies: JavaObject
Tags: B4j Measure Text Strings... B4A Question MeasureMultilineTextHeight measures too small with certain characters. - RB Smissaert    Sep 17, 2020 MeasureMultilineTextHeight works perfectly fine with with nearly anything I throw at it. Only exception is when the text for example contains char 9632. It then gives slightly too small values. This is not quite predictable, for example it can be fine if the last line in the view as little text. Is this a known problem? Any solutions for this? RBS... B4A Question MeasureStringHeight - Sergey_New    Mar 2, 2024 To set the label height I use this code
Dim cn As Canvas
cn.Initialize(Activity)
lbl.Height=cn.MeasureStringHeight("T", Typeface.DEFAULT,14)
To display correctly, the height of the label... B4A Question StringUtils.MeasureMultilineTextHeight - string read from long HEBREW text file - a n g l o (first post)    Jun 11, 2025   (1 reaction)
here's an example containg 2 text files.
both files start with 11111 and end with 99999.
i use StringUtils.MeasureMultilineTextHeight to determine the height needed to display all the text.
reading the file in English - i can scroll and see both 11111 and 99999 (string length is 9923). works... can't be scrolled at (string length is 6923).
am i missing something, or this method is not... Page: 1   2   3   4   5   6   |