String - Pixel Width (block)

A new block that inputs a string & outputs the width of a string in pixels.
Doesn’t need to be actual pixel length, just the length of the character(s), with characters displayed twice as long (using discord’s default font) having a value twice as big.

This would be very useful for when you need to know how long a string will display as on discord, specifically because there’s not really any remotely easy existing way of making this in inventor.

There’s already a block for getting the length of a string, you could multiply that by a fixed value for monospace fonts or reference a lookup table for fonts where width varies by letter.

This just doesn’t seem widely useful enough to justify putting all that into Inventor and taking on the burden of keeping it up to date as Discord changes their UI.

1 Like