Font handling class.
This class stores a font for use by sge.Sprite.draw_text() and sge.Room.project_text().
Note that bold and italic rendering could be ugly. It is better to choose a bold or italic font rather than enabling bold or italic rendering, if possible.
The height of the font in pixels.
Whether or not underlined rendering is enabled.
Whether or not bold rendering is enabled.
Note
Using this option can be ugly. It is better to choose a bold font rather than enabling bold rendering, if possible.
Whether or not italic rendering is enabled.
Note
Using this option can be ugly. It is better to choose an italic font rather than enabling italic rendering, if possible.
The name of the font as specified when it was created. (Read-only)
The unique identifier of the font. (Read-only)
Constructor method.
Arguments:
name – The name of the font. Can be one of the following:
If none of the above methods return a valid font, the SGE will choose the font.
ID – The value to set id to. If set to None, name will be used, modified by the SGE if it is already the unique identifier of another font.
All other arguments set the respective initial attributes of the font. See the documentation for sge.Font for more information.
Note
It is generally not a good practice to rely on system fonts. A font which you have on your system is probably not on everyone’s system. For example, most Windows systems have a font called Times New Roman, but this font is not normally found on Debian systems. On the other hand, Debian has the Liberation fonts installed by default, but these fonts are uncommon on Windows systems. Rather than relying on system fonts, choose a font which is under a free license (such as the GNU General Public License or the SIL Open Font License) and distribute it with your game; this will ensure that everyone sees text rendered the same way you do.
Return the size of a certain string of text when rendered.
See the documentation for sge.Sprite.draw_text() for information about the arguments.