# p.g.Fonts : class documentation

Part of planes.gui View In Hierarchy

    A font manager.

    Attributes:

    Fonts.font_names
        A list of font names that should be available. Use Fonts.by_name()
        to load and return a pygame.font.Font instance. This will raise an
        exception if the font is not available.

    Fonts.font_sizes
        A list of font sizes that should be available. Use Fonts.by_size()
        to load and return a pygame.font.Font instance. This will raise an
        exception if the font is not available.

    Fonts.fonts_by_name
        A dict mapping names of loaded fonts to pygame.font.Font instances.
        Using Fonts.by_name() instead of this dict is recommended, as it
        will load missing fonts.

    Fonts.fonts_by_size
        A dict mapping pixel sizes of loaded fonts to pygame.font.Font
        instances. Using Fonts.by_size() instead of this dict is recommended,
        as it will load missing fonts.

    Fonts.big_font
        A default pygame.font.Font instance, large pointsize. Always
        available.

    Fonts.small_font
        A default pygame.font.Font instance, small pointsize. Always
        available.

    Fonts.bold_font
        A default pygame.font.Font instance, bold face. Always available.

Method | __init__ | `Initialise.`
Method | by_name | `Return a pygame.font.Font instance identified by font_name.`
Method | by_size | `Return a pygame.font.Font instance identified by size.`

def __init__(self):

    Initialise.

def by_name(self, font_name, scale=1):

    Return a pygame.font.Font instance identified by font_name.

    scale is a scale factor >= 1. If omitted, the default size will
    be used.

    Fonts.font_names has a list of font names that should be available.

    This method will raise a KeyError if the font can not be found.

def by_size(self, size):

    Return a pygame.font.Font instance identified by size.

    Fonts.font_sizes has a list of font sizes that should be available.

    This method will raise a KeyError if the font can not be found.