Skip to content

Any way to check width of text #96

Description

@Krobys

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 doesn't 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

I have created this library and manually put each symbol and its size, but i don't think it is a proper solution
https://pastebin.com/hz93gUbT

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions