ryankurte / rust-streamdeck

libusb based driver for Elgato StreamDeck devices
Mozilla Public License 2.0
57 stars 24 forks source link

Add set_button_text() to create text buttons #9

Closed markmandel closed 4 years ago

markmandel commented 4 years ago

Adds the functionality to be able to dynamically generate button images and apply them based on text with a given font.

This includes text and background colouring, text scaling and positioning and support for line height over line breaks.

Adds dependencies on: imageproc = "0.20.0" rusttype = "0.8.3"

markmandel commented 4 years ago

image

Picture of it running white text on a grey background, with a \n linebreak with 1.1 line height.

(And it's sitting next to my hangouts button :smile: )

ryankurte commented 4 years ago

oh hey this looks super neat, thanks for the pr! i left a couple of comments / questions / ideas.

(one day i'll get to adding a radius option to everything to clean up the corners for non-transparent images/backgrounds 😅)