go-streamdeck icon indicating copy to clipboard operation
go-streamdeck copied to clipboard

Fixed font-size estimation

Open derickr opened this issue 2 years ago • 2 comments

In one of the commits that added support for the mini, and further commits, a new 'btnSize' parameter was introduced.

This however was not reflected in the algorithm that determines the size.

Without this fix, the text was always too wide (90px is more than the 72px my stream deck has), and also no longer virtually centred.

This commit should address both these issues.

I've only tested this with the v2.

derickr avatar Sep 17 '23 14:09 derickr

At least on mine (I have the XL), this makes the words a bit too wide, I think. Especially where there are borders, more of the edge letters get swallowed. The original setup intentionally had a little bit more breathing space around the edges, can we put something similar into this calculation?

lornajane avatar Oct 12 '23 19:10 lornajane

I've just added a commit that creates two new functions, that allow you to set a margin to whatever you want. I like my text (in some cases) to use up the whole space.

Right now, for the existing functions I added a default margin of 6.

I think it would be better if the default was 0, but then that means that where text buttons are currently used, you'd have to replace NewTextButton with NewTextButtonWithMargins(…, 6) and NewTextButtonWithColours (really, Colours? :-) ) with NewTextButtonWithColoursAndMargin(…, 6). That is a BC break of course, but I don't know how much you care.

I don't really know whether 6 is the right default either. For me, it was totally fine with textual scene names for OBS, where the decorator is configured to be 4 — at least I my case, I think you've removed it in your streamdeck-tricks implementation.

derickr avatar Oct 17 '23 10:10 derickr