Android Question BCTextEngine with Monospace letters. They don't have the same width!

vecino

Well-Known Member
Licensed User
Longtime User
Hi, I am trying to use a BCTextEngine to store text that I will then save as an image and finally print on bluetooth ticket printer.
I need the width to be always 48 columns.
For this I am using the type "Monospace", however I have a surprise, and that is that not all characters are monospace.
Considering that the maximum width is 48 columns, how can I get all the rows to have the same width?
I am attaching some screenshots so that you can understand the problem:

aa1.png


B4X:
Private Sub Button1_Click   
    TextEngine.Initialize(Activity)
    BBC.TextEngine = TextEngine
    BBC.Text = _
$"
123456789*123456789*123456789*123456789*12345678
Hola, mundo ÑÑÑñññññññññññññññññññññññññññññññññ
ÁÉÍÓÚ €€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€€
111111111111111111111111111111111111111111111111
222222222222222222222222222222222222222222222222
333333333333333333333333333333333333333333333333
444444444444444444444444444444444444444444444444
555555555555555555555555555555555555555555555555
666666666666666666666666666666666666666666666666
777777777777777777777777777777777777777777777777
888888888888888888888888888888888888888888888888
999999999999999999999999999999999999999999999999
000000000000000000000000000000000000000000000000
123456789*123456789*123456789*123456789*12345678
________________________________________________
------------------------------------------------
123456789*123456789*123456789*123456789*12345678
================================================
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
çÇñÑáéíóúçÇñÑáéíóúçÇñÑáéíóúçÇñÑáéíóúçÇñÑáéíóúçÇñ
================================================
123456789*123456789*123456789*123456789*12345678
"$
    
End Sub

The result is not correct, all the rows should have the same width, because they have 48 characters each:

aa2.jpg
 

vecino

Well-Known Member
Licensed User
Longtime User
Yes, I'm finding that it's more complicated than I had thought.
Thank you very much, friends.
 
Upvote 0
Top