A representation of a single glyph (character) from a font. More...
#include "textGlyph.h"
Public Member Functions | |
TextGlyph (int character, PN_stdfloat advance=0) | |
This constructor makes an empty glyph. More... | |
TextGlyph (int character, const Geom *geom, const RenderState *state, PN_stdfloat advance) | |
TextGlyph (const TextGlyph ©) | |
void | calc_tight_bounds (LPoint3 &min_point, LPoint3 &max_point, bool &found_any, Thread *current_thread) const |
virtual TypeHandle | force_init_type () |
PN_stdfloat | get_advance () const |
int | get_character () const |
bool | get_quad (LVecBase4 &dimensions, LVecBase4 &texcoords) const |
Assuming that this glyph is representable as a textured quad, returns its dimensions and UV range. More... | |
const RenderState * | get_state () const |
virtual TypeHandle | get_type () const |
bool | has_quad () const |
Returns true if this glyph contains the definition for a simple quad, rather than a more complex piece of geometry. More... | |
virtual bool | is_whitespace () const |
Returns true if this glyph represents invisible whitespace, or false if it corresponds to some visible character. More... | |
void | operator= (const TextGlyph ©) |
void | set_geom (GeomVertexData *vdata, GeomPrimitive *prim, const RenderState *state) |
Sets the geom from a pre-built Geom object. More... | |
void | set_quad (const LVecBase4 &dimensions, const LVecBase4 &texcoords, const RenderState *state) |
![]() | |
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... | |
Static Public Member Functions | |
static TypeHandle | get_class_type () |
static void | init_type () |
![]() | |
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 () |
Public Attributes | |
get_advance | |
Returns the distance by which the character pointer should be advanced after placing this character; i.e. More... | |
get_character | |
Returns the Unicode value that corresponds to the character this glyph represents. More... | |
get_state | |
Returns the state in which the glyph should be rendered. More... | |
![]() | |
get_type | |
![]() | |
get_ref_count | |
Returns the current reference count. More... | |
Friends | |
class | GeomTextGlyph |
A representation of a single glyph (character) from a font.
This is a piece of renderable geometry of some kind.
Definition at line 28 of file textGlyph.h.
|
inline |
This constructor makes an empty glyph.
Definition at line 18 of file textGlyph.I.
|
inline |
Assuming that this glyph is representable as a textured quad, returns its dimensions and UV range.
Returns false if it is not representable as a quad, or if it is whitespace.
The order of the components is left, bottom, right, top.
Definition at line 104 of file textGlyph.I.
|
inline |
Returns true if this glyph contains the definition for a simple quad, rather than a more complex piece of geometry.
You may still call get_geom() even if this returns true, which will synthesize a Geom for this quad.
Definition at line 92 of file textGlyph.I.
|
virtual |
Returns true if this glyph represents invisible whitespace, or false if it corresponds to some visible character.
Definition at line 37 of file textGlyph.cxx.
void TextGlyph::set_geom | ( | GeomVertexData * | vdata, |
GeomPrimitive * | prim, | ||
const RenderState * | state | ||
) |
Sets the geom from a pre-built Geom object.
Any quad parameters assigned will be cleared.
Definition at line 119 of file textGlyph.cxx.
References PT().
|
inline |
Returns the distance by which the character pointer should be advanced after placing this character; i.e.
the approximate width the character takes up on the line.
Definition at line 46 of file textGlyph.h.
|
inline |
Returns the Unicode value that corresponds to the character this glyph represents.
Definition at line 44 of file textGlyph.h.
|
inline |
Returns the state in which the glyph should be rendered.
Definition at line 45 of file textGlyph.h.