You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The calculation for padding and truncation of label tokens is inconsistent. For max-width it counts the number of unicode characters while for min-width it counts the number of bytes. This falls apart if the token text contains non-ASCII.
We should always use unicode codepoints for min and max-width
Originally posted by nymver January 4, 2024
So I have a module that displays the artist and title of current playing song. I have specified tokens (minimum and maximum width) (label = %output:-45:45%). If there are no Cyrillic letters in the text, everything is fine, but if there are, for some reason the width of the label is reduced.
Module:
[module/running_string]
type = custom/script
exec = $HOME/.config/polybar/scripts/running_string
tail = true
format = <label>
label = %output:-45:45%
The text was updated successfully, but these errors were encountered:
…3090)
* Changed bit count for label to use UTF8 standard
Fixes#3074
* label: Calculate length only once
The length calculation has to traverse the whole string
---------
Co-authored-by: nklloyd <nicholask.lloyd@gmail.com>
The calculation for padding and truncation of label tokens is inconsistent. For max-width it counts the number of unicode characters while for min-width it counts the number of bytes. This falls apart if the token text contains non-ASCII.
We should always use unicode codepoints for min and max-width
Discussed in #3069
Originally posted by nymver January 4, 2024
So I have a module that displays the artist and title of current playing song. I have specified tokens (minimum and maximum width) (label = %output:-45:45%). If there are no Cyrillic letters in the text, everything is fine, but if there are, for some reason the width of the label is reduced.
Module:
The text was updated successfully, but these errors were encountered: