Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Kivy - underline not working in label

Tags:

python

label

kivy

I know this question has been asked before (Underline text in a Label in Kivy?) and it is quite an old question but I was really wondering if there is a way to underline text in label's in Kivy? The only suggested solution I've found online is using a python script extended_markup.py. But this does not work and is riddled with problems due to updates in Kivy. I've tried messing around myself but underline even seems to be removed from markup in the kivy source code...even though the documentation talks about underline! Any help would be appreciated.

like image 320
Hazey Avatar asked May 27 '26 16:05

Hazey


1 Answers

This functionality has been added in the development version of Kivy 1.9.2-dev. The instructions to update to the development version vary by platform: https://kivy.org/docs/installation/installation.html

You can set underline on a Label widget to underline the text:

Label:
    text: 'underline this!'
    underline: True

You can also use markup:

Label:
    text: 'underline [u]this![/u]'
    markup: True

However, underline is not supported by all text providers. In particular, the SDL2 text provider does support it while the pygame and PIL providers do not.

like image 127
kitti Avatar answered May 30 '26 04:05

kitti