Kodi Community Forum

Full Version: <wrapmultiline> logic?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
i'm using this code to wrap long labels onto two lines:
Code:
<control type="label">
    <posx>448</posx>
    <posy>80</posy>
    <width>490</width>
    <height>88</height>
    <label>$INFO[ListItem.Label]</label>
    <font>font-44c</font>
    <aligny>top</aligny>
    <wrapmultiline>true</wrapmultiline>
</control>

the height value is set correctly for allowing exactly two lines.

while this works fine in most cases, there are a few exceptions....

'Pirates of the Caribbean: The Curse of the Black Pearl'
is correctly wrapped onto two lines:

Image


but 'Pirates of the Caribbean: Dead Man's Chest'
gets incorrectly wrapped onto three lines:

Image


by examining the exceptions, it looks like xbmc thinks,
hey...if there's only one more word to go at the end of the second line,
i'm gonna use three lines anyway....

...and if there's two or more words left, i'll stick with two lines.



should i create a ticket for this, or learn to live with it?
What benefit does wrapmultiline have over a textbox? As I always use a textbox in these situations...
textboxes have one disadvantage imo.
if the skin offers multiple fontsets, you can make your textbox perfectly sized for the default font,
but if you switch to the alternate font, you most likely end up with your textbox looking like this:

Image
Try reducing the 88 until it doesn't do 3 lines. What number do you get?
jmarshall Wrote:Try reducing the 88 until it doesn't do 3 lines. What number do you get?
That's what I did in the past. Wink

Does the line spacing affect this?
Could do, yeah. The other thing might be that the font height of 44 may not actually mean much in pixels at 720p - it may be more or less than that.
jmarshall Wrote:Try reducing the 88 until it doesn't do 3 lines. What number do you get?

61.
at this point it won't do 3 lines anymore,
but it'll drop back to 1 line for all of them.

setting height to 62 results in the issue as stated above.

this is coded at 1080i...if it matters.
though trying it in 720p, different skin, different font produces the same issue.
A potential fix has been posted in #11016.

Cheers,
Jonathan