Reference Manual: (offline | online) Quickstart: (offline | online)

# renpy.register_sfont

Function: renpy.register_sfont( | name=None, size=None, bold=False, italics=False, underline=False, filename=None, spacewidth=10, default_kern=0, kerns={}, charset=u'!"#$%&\'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~')

This registers an SFont with the given details. Please note that size, bold, italic, and underline are all advisory (used for matching), and do not change the appearance of the font.

name - The name of the font being registered

size - The size of the font being registered

bold - The boldness of the font being registered

italics - The italicness of the font being registered

underline - The underline of the font being registered

filename - The file containing the sfont image

spacewidth - The width of a space character

default_kern - The default kern spacing between characters

kerns - A map from two-character strings to the kern that should be used between those characters

charset - The character set of the font. A string containing characters in the order in which they are found in the image.

## Example

    init:
        $ renpy.register_sfont("skyfont", 22, filename="skyfont.png", default_kern=-1)
        $ esf = Character('Eileen', color=(200, 255, 200, 255),
                          what_font="skyfont", what_size=22,
                          what_drop_shadow=(1, 1))

    esf "For even more control, Ren'Py supports SFonts."

Reference Manual: (offline | online) Quickstart: (offline | online)