7

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.

user
  • 5,370
  • 8
  • 47
  • 75
  • Is `'Denmark'` just a random string you tried, or is it the name of an actual font, installed on your system? Also, your title and question are about the **styles** but your example and answer are about the actual **fonts**. – Jongware May 11 '16 at 12:22
  • 1
    @RadLexus I tried several font names from [here](http://wavian.com/font-list.html). Feel free to word the question+answer properly, i m not very experienced with fonts. – user May 11 '16 at 12:25
  • Is there a way to use a monospace font for the whole kivy App? I.e., to just specify "monospace" and it will choose the right font depending on the OS? – Martin Jul 15 '21 at 10:09
  • @Martin unfortunately I haven't used Kivy for a while. You could [contact](https://kivy.org/doc/stable/contact.html#discord) the devs though. – user Jul 15 '21 at 10:54

3 Answers3

5

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.

user
  • 5,370
  • 8
  • 47
  • 75
1

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

Jonathan
  • 6,741
  • 7
  • 52
  • 69
  • 1
    If you do this, please remember to check that you have the necessary rights and permissions to distribute the font files. – kthy May 09 '19 at 07:55
  • And if you decide to actually get this font_name reference to work in Windows, don't fall for the shortcut "c:\Windows\Fonts". The actual path to reference is something like, "C:\\Users\\Asmongold\\AppData\\Local\\Microsoft\\Windows\\Fonts\\Barriecito-Regular.ttf" – LargeDachshund Jul 14 '19 at 22:06
0

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)