This page is out of date

You've reached a page on the Ren'Py wiki. Due to massive spam, the wiki hasn't been updated in over 5 years, and much of the information here is very out of date. We've kept it because some of it is of historic interest, but all the information relevant to modern versions of Ren'Py has been moved elsewhere.

Some places to look are:

Please do not create new links to this page.


renpy.register_sfont

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.

The default character set for a SFont is:

! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? 
@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ 
` a b c d e f g h i j k l m n o p q r s t u v w x y z { | } ~

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."