Page 1 of 1

Determining the width of text drawn with CMD_TEXT

Posted: Sun Apr 06, 2025 4:07 am
by kiabrin
Good morning!

I wonder if there is any way to find actual text string width in pixels when it is drawn with CMD_TEXT and ROM font?
I want to draw color highlighted multiline text on my screen, so I need to know where to start next portion of text after some text is drawn.

Re: Determining the width of text drawn with CMD_TEXT

Posted: Mon Apr 07, 2025 10:36 am
by Ray
While the eve offers no function to quickly get the size of a string, you can download the rom font header from the unit and calculate this your self, in AN_033 - BT81X programming guide see sections:

5.4.1 (Legacy Font Metrics Block) and
5.4.2 (Example to find the width of character)

do note that section 5.4.3 that directly follows and has a handy looking code sample, is NOT applicable to the rom fonts as they use the legacy font metrics block.