Skip to content

GUI.Font

Adam Furman edited this page Jul 9, 2016 · 1 revision

Font class

The Font class preloads a given font in a size range, making it faster to use in applications. Python OS preloads two such fonts, the regular state.font used in apps and the UI, and state.typingFont used when entering text. You can initialize your own font in your app if you need it.

GUI.Font ( path="res/RobotoCondensed-Regular.ttf", minSize=10, maxSize=30 )

Accessible via state.getFont() and state.getTypingFont().

Object Variables

  • str path The path to the font file. This can be None to use the default Pygame font.
  • dict sizes A dict in which the keys are integers from minSize to maxSize (inclusively) and the values are pygame.font.Font objects loaded from path in that size.

Methods

  • get ( size=14 ) Get the preloaded font for a given size. If it is not loaded, it will be on demand.

Home

Getting Started

Documentation

Threads and Tasks

Applications and Notifications

The State Class and Variable

The GUI, Events, Resources, and Dialogs

The following classes are all under the GUI class, e.g. Font is actually accessed as GUI.Font.

  • Font class
  • Icons class
  • ColorPalette class
  • LongClickEvent class
  • IntermediateUpdateEvent class
  • EventQueue class
  • FunctionBar class
  • Keyboard class
  • Overlay class
  • Dialog class
    • OKDialog dialog
    • ErrorDialog dialog
    • WarningDialog dialog
    • YNDialog dialog
    • OKCancelDialog dialog
    • AskDialog dialog
    • CustomContentDialog dialog
  • NotificationMenu overlay
    • RecentAppSwitcher overlay
    • Selector overlay

GUI Components and Containers

  • Component class

The following classes are all Components, they inherit from that class.

  • Container component
  • AppContainer container
  • Button container
  • KeyboardButton container
  • TextEntryField container
  • PagedContainer container
    • GriddedPagedContainer container
    • ListedPagedContainer container
  • ButtonRow container
  • ScrollableContainer container
    • ListScrollableContainer container
    • TextScrollableContainer container
    • MultiLineTextEntryField container
  • Text component
  • MultiLineText component
  • ExpandingMultiLineText component
  • Image component
  • Slider component
  • Checkbox component
  • Switch component
  • Canvas component
  • ScrollIndicator component
Clone this wiki locally