32class EXPCL_PANDA_TEXT TextFont :
public TypedReferenceCount,
public Namable {
35 TextFont(
const TextFont ©);
62 virtual PT(TextFont) make_copy()
const=0;
65 INLINE
operator bool ()
const;
75 INLINE CPT(
TextGlyph) get_glyph(
int character);
77 virtual PN_stdfloat
get_kerning(
int first,
int second)
const;
79 virtual void write(std::ostream &out,
int indent_level)
const;
84 virtual bool get_glyph(
int character, CPT(
TextGlyph) &glyph)=0;
90 void make_invalid_glyph();
94 PN_stdfloat _line_height;
95 PN_stdfloat _space_advance;
96 PN_stdfloat _total_poly_margin;
103 static void init_type() {
104 TypedReferenceCount::init_type();
106 TypedReferenceCount::get_class_type());
108 virtual TypeHandle get_type()
const {
109 return get_class_type();
111 virtual TypeHandle force_init_type() {init_type();
return get_class_type();}
114 static TypeHandle _type_handle;
117EXPCL_PANDA_TEXT std::ostream &operator << (std::ostream &out, TextFont::RenderMode rm);
118EXPCL_PANDA_TEXT std::istream &operator >> (std::istream &in, TextFont::RenderMode &rm);
PN_stdfloat get_total_poly_margin() const
Returns the total margin between the edge of the glyph and the edge of the cards.
TextGlyph * get_invalid_glyph()
Returns a special glyph that can be used as a placeholder for any character not in the font.
get_line_height
Returns the number of units high each line of text is.
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.
set_space_advance
Changes the number of units wide a space is.
get_space_advance
Returns the number of units wide a space is.
set_line_height
Changes the number of units high each line of text is.
static RenderMode string_render_mode(const std::string &string)
Returns the RenderMode value associated with the given string representation, or RM_invalid if the st...
is_valid
Returns true if the font is valid and ready to use, false otherwise.
A representation of a single glyph (character) from a font.
TypeHandle is the identifier used to differentiate C++ class types.
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.
void register_type(TypeHandle &type_handle, const std::string &name)
This inline function is just a convenient way to call TypeRegistry::register_type(),...
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.