30class EXPCL_PANDA_TEXT FontPool {
36 INLINE
static bool has_font(
const std::string &filename);
37 INLINE
static bool verify_font(
const std::string &filename);
40 INLINE
static void release_font(
const std::string &filename);
46 static void write(std::ostream &out);
51 bool ns_has_font(
const std::string &str);
52 TextFont *ns_load_font(
const std::string &str);
53 void ns_add_font(
const std::string &str,
TextFont *font);
54 void ns_release_font(
const std::string &str);
55 void ns_release_all_fonts();
56 int ns_garbage_collect();
57 void ns_list_contents(std::ostream &out)
const;
59 static void lookup_filename(
const std::string &str, std::string &index_str,
60 Filename &filename,
int &face_index);
62 static FontPool *get_ptr();
63 static FontPool *_global_ptr;
66 typedef pmap<std::string, PT(
TextFont) > Fonts;
The name of a file, such as a texture file or an Egg file.
static void list_contents(std::ostream &out)
Lists the contents of the font pool to the indicated output stream.
static bool has_font(const std::string &filename)
Returns true if the font has ever been loaded, false otherwise.
static void write(std::ostream &out)
Lists the contents of the font pool to the indicated output stream.
static TextFont * load_font(const std::string &filename)
Loads the given filename up into a font, if it has not already been loaded, and returns the new font.
static int garbage_collect()
Releases only those fonts in the pool that have a reference count of exactly 1; i....
static void add_font(const std::string &filename, TextFont *font)
Adds the indicated already-loaded font to the pool.
static void release_font(const std::string &filename)
Removes the indicated font from the pool, indicating it will never be loaded again; the font may then...
static bool verify_font(const std::string &filename)
Loads the given filename up into a font, if it has not already been loaded, and returns true to indic...
static void release_all_fonts()
Releases all fonts in the pool and restores the pool to the empty state.
This is a standard, non-reentrant mutex, similar to the Mutex class.
An encapsulation of a font; i.e.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.