OpenMods / OpenPeripheral

https://openmods.info
MIT License
67 stars 25 forks source link

Any way to check width of text #280

Open Krobys opened 1 year ago

Krobys commented 1 year ago

I need to somehow calculate the width of the text that is drawn on the glasses through openperipheral_bridge. i tried UNICODE API OpenOS unicode.char(value: number, ...): string but it returns the text for the terminal and it is not suitable for glasses, because on glasses, for example, 'L' and 'I' have a width of 1, although in fact they are different 1 and 2. I also studied the documentation and the objects on the glasses have a method getWidth but Text object dont have this function.

Сan you tell me how to still find out what width the text that is drawn on the screen or which will be drawn, maybe I'm missing something