mirror of https://github.com/kivy/kivy.git
text: force shorten to return unicode string
This commit is contained in:
parent
37c2a39928
commit
ed4218047c
|
@ -208,11 +208,11 @@ class LabelBase(object):
|
||||||
|
|
||||||
if segment - margin > 5:
|
if segment - margin > 5:
|
||||||
segment -= margin
|
segment -= margin
|
||||||
return '{0}...{1}'.format(text[:segment].strip(),
|
return u'{0}...{1}'.format(text[:segment].strip(),
|
||||||
text[-segment:].strip())
|
text[-segment:].strip())
|
||||||
else:
|
else:
|
||||||
segment = max_letters - 3 # length of '...'
|
segment = max_letters - 3 # length of '...'
|
||||||
return '{0}...'.format(text[:segment].strip())
|
return u'{0}...'.format(text[:segment].strip())
|
||||||
|
|
||||||
def render(self, real=False):
|
def render(self, real=False):
|
||||||
'''Return a tuple(width, height) to create the image
|
'''Return a tuple(width, height) to create the image
|
||||||
|
|
Loading…
Reference in New Issue