I'm trying to get Japanese characters in my app. From the documentation and other sources I found that Label(text=u'我是中文', font_name='fonts/ARIALUNI.TTF') should work (arialuni font should be able to handle Japanese/Chinese characters). However I'm wondering how do I specify this in the Kivy language in the .kv file? This is what I tried:
from kivy.app import App
from kivy.uix.boxlayout import BoxLayout
if __name__ == '__main__':
text: u'速 dsf'
Make sure your kv file is using utf-8 character encoding, and it should work fine. Most decent text editors will allow you to select the encoding.
Do not use
u'', as the file is already unicode (attempting to use
u'' will result in decode errors).
I had issues with the arialuni font (didn't show kanji, but it did show the kana, and the top half was cut off of all characters, including Western letters). So I used a different font instead (TakaoPMincho - easy to install in Ubuntu).
<TestWidget>: Label: text: '速 dsf あい' font_name: 'TakaoPMincho.ttf' font_size: sp(48)