Reputation: 5696
Which fonts are available (included) in kivy?
Using font_name: 'Arial'
seems to be working but 'Denmark'
raises an exception saying the font file is not found.
Upvotes: 8
Views: 24260
Reputation: 15
As per my understanding, you can use any font that exists in your OS directory.
For windows, you can find the default installed fonts list here: https://learn.microsoft.com/en-us/typography/fonts/windows_10_font_list
Also note that you have to write the name of the .tff file, not the font name. Doing the latter resulted in an error for me.
Eg for Comic Sans MS font, write font_name: Comic
, as the .tff file for Comic Sans by default is Comic.tff (as per the link posted above)
Upvotes: 0
Reputation: 7098
It may also depend on the users system you are running on. I noticed if you use the kv language to specify a font:
BoxLayout:
Label:
font_name: 'AbyssinicaSIL-R'
It will then open and render a file named AbyssinicaSIL-R.ttf
in the working directory (os.path.abspath('.')
), so in Windows you can copy the fonts from the font directory to this local path (be sure to package on distribution), and for Linux the path to copy fonts from is /usr/share/fonts
Upvotes: 1
Reputation: 5696
For the default font: regular, bold, italic, bold-italic. Also dejavu sans regular and roboto mono regular are included by default.
Arial
is usable (despite not being provided by default) because kivy uses system fonts as well.
Upvotes: 5