Closed kuckuckmann closed 1 year ago
There is no way do dynamically change the font size in nextion.
The only option would be to change the font to a smaller one if the text is longer than X chars. The only downside is that not all of the chars have the same width. So there might be cases where this is changing the font too early or too late.
Well, isn't it the best case to take a wide character and create the width in depency of the amount of digits from 1 digit to 4 digits. So taking care that 4 digits with the maximum width possible can be displayed well?
for cardgrid2 we would need to change the font to a smaller one if the text is longer than 2 chars
I've implemented a way to force the panel to change the font on the icons.
XXX¬0
XXX¬3
XXX¬4
in case the 2nd last char is an ¬
it will pull the number after it and set it as font and then remove the last 2 chars from the string
Implemented in v4.2.1.2 (ioBroker) - Use with pageItem-parameter: fontSize: (0-4) and
FlashNextion http://nspanel.pky.eu/lui.tft
https://forum.iobroker.net/topic/58170/sonoff-nspanel-mit-lovelace-ui/3528?_=1692957744727
FEATURE DESCRIPTION
With the opportunity of 8 items at CardGrid2 the relation between field width and text-size is unproportunal. A minimal text-digit of 4 should be displayable in relation to the field width. Maybe it's possible to let the text be resized in relation to its digits? In my specific example I am talking about temperatures with 1 decimal (for example 24.5).
ADDITIONAL CONTEXT
Add any other context about the problem here.
PANEL / FIRMWARE VERION
Please add the Panel/Firmware Version you are using (EU, US-L or US-P) EU-Panel, Tasmota 12.1, TFT 52