My kivy app crushes when label or text input has letter 'w' in the text field

121 Views Asked by At

Anytime I have letter 'w'(lower case) in the text field of a TextInput or Label, the whole application crushes with "virtual keyboard not allowed, single mode, not docked" error. Surprisingly, all keys work including 'W'(upper case). below is my code. please note the returnedWidget is built on a BoxLayout widget.

<returnedWidget>:
    orientation: 'vertical'
    TextInput: 
        id: my_input
        font_size: 150
        size_hint_y: None
        height:200
        text: 'w'
    FloatLayout:
        Scatter:
            Label:
                text: 'w'
                font_size: 150

I don't know how to get around this.

1

There are 1 best solutions below

2
MST On BEST ANSWER

It seems to be font_size related bug. With font_size: 150 or 160 it crashes. But for example with 140, 170, 180 it works fine.

I submitted following issue: https://github.com/kivy/kivy/issues/8108

Based on this the workaround is to add on top of your python script:

import os
os.environ['KIVY_TEXT'] = 'pil'

The second working workaround is to manually update library:

venv\share\sdl2\bin\SDL2_ttf.dll

from 2.0.18 to latest one 2.20.1: https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.20.1/SDL2_ttf-2.20.1-win32-x64.zip

https://github.com/libsdl-org/SDL_ttf/releases

I hope Kivy will upgrade it's dependent library SDL_ttf soon.