Is there any way I can wrap or ellipsize text in a rectangle? I am having overwriting problems with long title songs...
I have not been able to figure out a simple way to do this. I have been able to figure out several complicated ways to do this. This is my current Item Display string:
$ifequal($mod(%list_index%,2),0,
$drawrect(,,,,brushcolor-237-237-229 pencolor-null),
)
$drawrect(,,4,,brushcolor-204-204-191 pencolor-null)
$drawrect($sub(%_width%,4),,4,,brushcolor-204-204-191 pencolor-null)
$if(%_selected%,$drawrect(,,,,brushcolor-204-204-191 pencolor-null))
$if(%isplaying%,$drawrect(,,,,brushcolor-155-208-201 pencolor-null)
$font(AvantGarde LT Medium,7,,50-50-45)
,$font(AvantGarde LT Medium,7,,160-160-144)
)
$padding(6,0)
$alignabs(4,,14,%_height%,right,middle)$num(%tracknumber%,1)
$font(AvantGarde LT Medium,7,,0-0-0)
$alignabs(28,,%_width%,%_height%,left,middle)
$if($greater($calcwidth($if($meta(Album Artist),%artist% - )%title%),$sub(%_width%,60))
,
$cut($if($meta(Album Artist),%artist% - )%title%,90)…
,
$if($meta(Album Artist),%artist% - )%title%
)
$if(%isplaying%,
$font(AvantGarde LT Medium,7,,50-50-45),
$font(AvantGarde LT Medium,7,,160-160-144)
)
$padding(4,0)$align(right,middle)%length%
60 is the left and right marigins added together.
90 is the approximate maximum number of characters of the non-fixed-width font Avant-Garde at my usual window size of around 526 width. Phew.
Those numbers will change depending on your config and font. Experiment.
Also of note, the $if($meta(Album Artist),%artist% - ) is particular to my tagging convention. I use Vorbis Comment standards, but they're not exactly pretty when it comes to classical music albums with multiple composers. Setting the Album Artist comment for albums with multiple composers is my little work around. You probably should just have %title%. So you'll want something like this, but with those two numbers changed for your particular font, window size, and marigins.
$if($greater($calcwidth(%title%),$sub(%_width%,60))
,
$cut(%title%,90)…
,
%title%
)
See the results: