A StaticTextFont is loaded up from a model that was previously generated via egg-mkfont, and contains all of its glyphs already generated and available for use. More...
#include "staticTextFont.h"
Public Member Functions | |
StaticTextFont (PandaNode *font_def, CoordinateSystem cs=CS_default) | |
The constructor expects the root node to a model generated via egg-mkfont, which consists of a set of models, one per each character in the font. More... | |
virtual TypeHandle | force_init_type () |
virtual bool | get_glyph (int character, CPT(TextGlyph) &glyph) |
virtual TypeHandle | get_type () const |
virtual | PT (TextFont) make_copy() const |
virtual void | write (std::ostream &out, int indent_level) const |
![]() | |
TextFont (const TextFont ©) | |
CPT (TextGlyph) get_glyph(int character) | |
TextGlyph * | get_invalid_glyph () |
Returns a special glyph that can be used as a placeholder for any character not in the font. More... | |
virtual PN_stdfloat | get_kerning (int first, int second) const |
Returns the amount by which to offset the second glyph when it directly follows the first glyph. More... | |
PN_stdfloat | get_line_height () const |
PN_stdfloat | get_space_advance () const |
PN_stdfloat | get_total_poly_margin () const |
Returns the total margin between the edge of the glyph and the edge of the cards. More... | |
bool | is_valid () const |
operator bool () const | |
Returns true if the font is valid and ready to use, false otherwise. More... | |
void | set_line_height (PN_stdfloat line_height) |
void | set_space_advance (PN_stdfloat space_advance) |
![]() | |
TypedReferenceCount (const TypedReferenceCount ©) | |
void | operator= (const TypedReferenceCount ©) |
![]() | |
TypedObject (const TypedObject ©)=default | |
TypedObject * | as_typed_object () |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
const TypedObject * | as_typed_object () const |
Returns the object, upcast (if necessary) to a TypedObject pointer. More... | |
int | get_best_parent_from_Set (const std::set< int > &) const |
int | get_type_index () const |
Returns the internal index number associated with this object's TypeHandle, a unique number for each different type. More... | |
bool | is_exact_type (TypeHandle handle) const |
Returns true if the current object is the indicated type exactly. More... | |
bool | is_of_type (TypeHandle handle) const |
Returns true if the current object is or derives from the indicated type. More... | |
TypedObject & | operator= (const TypedObject ©)=default |
![]() | |
int | get_ref_count () const |
WeakReferenceList * | get_weak_list () const |
Returns the WeakReferenceList associated with this ReferenceCount object. More... | |
bool | has_weak_list () const |
Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More... | |
void | local_object () |
This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More... | |
void | ref () const |
Explicitly increments the reference count. More... | |
bool | ref_if_nonzero () const |
Atomically increases the reference count of this object if it is not zero. More... | |
bool | test_ref_count_integrity () const |
Does some easy checks to make sure that the reference count isn't completely bogus. More... | |
bool | test_ref_count_nonzero () const |
Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More... | |
virtual bool | unref () const |
Explicitly decrements the reference count. More... | |
WeakReferenceList * | weak_ref () |
Adds the indicated PointerToVoid as a weak reference to this object. More... | |
void | weak_unref () |
Removes the indicated PointerToVoid as a weak reference to this object. More... | |
![]() | |
Namable (const std::string &initial_name="") | |
void | clear_name () |
Resets the Namable's name to empty. More... | |
const std::string & | get_name () const |
bool | has_name () const |
Returns true if the Namable has a nonempty name set, false if the name is empty. More... | |
void | output (std::ostream &out) const |
Outputs the Namable. More... | |
void | set_name (const std::string &name) |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
static RenderMode | string_render_mode (const std::string &string) |
Returns the RenderMode value associated with the given string representation, or RM_invalid if the string does not match any known RenderMode value. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
This function is declared non-inline to work around a compiler bug in g++ 2.96. More... | |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
static TypeHandle | get_class_type () |
static void | init_type () |
Additional Inherited Members | |
![]() | |
enum | RenderMode { RM_texture, RM_wireframe, RM_polygon, RM_extruded, RM_solid, RM_distance_field, RM_invalid } |
![]() | |
get_line_height | |
Returns the number of units high each line of text is. More... | |
get_space_advance | |
Returns the number of units wide a space is. More... | |
is_valid | |
Returns true if the font is valid and ready to use, false otherwise. More... | |
set_line_height | |
Changes the number of units high each line of text is. More... | |
set_space_advance | |
Changes the number of units wide a space is. More... | |
![]() | |
get_type | |
![]() | |
get_ref_count | |
Returns the current reference count. More... | |
![]() | |
get_name | |
set_name | |
A StaticTextFont is loaded up from a model that was previously generated via egg-mkfont, and contains all of its glyphs already generated and available for use.
It doesn't require linking with any external libraries like FreeType.
Definition at line 38 of file staticTextFont.h.
StaticTextFont::StaticTextFont | ( | PandaNode * | font_def, |
CoordinateSystem | cs = CS_default |
||
) |
The constructor expects the root node to a model generated via egg-mkfont, which consists of a set of models, one per each character in the font.
If a CoordinateSystem value is specified, it informs the font of the coordinate system in which this model was generated. "up" in this coordinate system will be the direction of the top of the letters.
Definition at line 39 of file staticTextFont.cxx.
Referenced by PT().