Android Question TextToBitmap - ignore font scale to print in ESC/POS printer

mmanso

Active Member
Licensed User
Longtime User
Hi there,

I'm using TextToBitmap to product content to print on a ESC/POS printer.

My problem is that since TextToBitmap uses a Label to generate the contents, in different android devices with different screen resolutions, the result will be different (but the printing paper is the same :) ).

Is there any way of discard the scale factor when applying sizes to the Text being used on the TextToBitmap function? That way the content printed would have allways the same size.

Thanks in advance.
 

mmanso

Active Member
Licensed User
Longtime User
Guess this will do the trick:

B4X:
Sub FontSizeNotScaled (size As Int) As Int
    Return size / GetDeviceLayoutValues.Scale
End Sub

Using this function on my font sizes will make them to have the same size on paper.
 
Upvote 0
Top