wxRuby Documentation Home

# Wx::FontList

A font list is a list containing all fonts which have been created. There
is only one instance of this class: TheFontList. Use this object to search
for a previously created font of the desired type and create it if not already found.
In some windowing systems, the font may be a scarce resource, so it is best to
reuse old resources if possible. When an application finishes, all fonts will be
deleted and their resources freed, eliminating the possibility of `memory leaks’.

## Derived from

List

Object

## See also

Font

## Methods

- FontList.new
- FontList#add_font
- FontList#find_or_create_font
- FontList#remove_font

### FontList.new

### FontList#add_font

add_font(%(arg-type)Font% font)

Used by Widgets to add a font to the list, called in the font constructor.

### FontList#find_or_create_font

Font find_or_create_font(%(arg-type)Integer% point_size, Integer family, Integer style, Integer weight, Boolean underline = false, String facename = nil, FontEncoding encoding = FONTENCODING_DEFAULT)

Finds a font of the given specification, or creates one and adds it to the list. See the Font constructor for
details of the arguments.

### FontList#remove_font

remove_font(%(arg-type)Font% font)

Used by Widgets to remove a font from the list.

[This page automatically generated from the Textile source at 2023-06-09 00:45:27 +0000]