38 explicit PNMTextMaker(
const char *font_data,
int data_length,
int face_index);
51 INLINE
void set_align(Alignment align_type);
52 INLINE Alignment get_align()
const;
55 INLINE
bool get_interior_flag()
const;
57 INLINE
void set_fg(
const LColor &fg);
58 INLINE
const LColor &
get_fg()
const;
70 INLINE
int calc_width(
const std::string &text);
82 typedef pmap<int, PNMTextGlyph *> Glyphs;
89 int _distance_field_radius;
The name of a file, such as a texture file or an Egg file.
The name of this class derives from the fact that we originally implemented it as a layer on top of t...
A single glyph in a PNMTextMaker.
PNMTextMaker(const Filename &font_filename, int face_index)
The constructor expects the name of some font file that FreeType can read, along with face_index,...
int get_distance_field_radius() const
Returns the radius previously set with set_distance_field_radius, or 0 otherwise.
int generate_into(const std::string &text, PNMImage &dest_image, int x, int y)
Generates a single line of text into the indicated image at the indicated position; the return value ...
PNMTextGlyph * get_glyph(int character)
Returns the glyph for the indicated index, or NULL if it is not defined in the font.
int calc_width(const std::string &text)
Returns the width in pixels of the indicated line of text.
void set_fg(const LColor &fg)
Sets the foreground color of text that will be generated by future calls to generate_into().
void set_interior(const LColor &interior)
Sets the color that will be used to render the interior portions of hollow fonts in future calls to g...
void set_distance_field_radius(int radius)
If this is set to something other than 0, Panda will generate a signed distance field with the given ...
const LColor & get_fg() const
Returns the foreground color of text that will be generated by future calls to generate_into().
void set_interior_flag(bool interior_flag)
Sets the flag that indicates whether the interior of hollow fonts is identified as a preprocess as ea...
bool is_valid() const
Returns true if the PNMTextMaker is valid and ready to generate text, false otherwise.
const LColor & get_interior() const
Returns the color that will be used to render the interior portions of hollow fonts.
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.