PNMTextMaker
from panda3d.core import PNMTextMaker
- class PNMTextMaker
Bases:
FreetypeFont
This object uses the Freetype library to generate text directly into an image. It is different from the TextNode/DynamicTextFont interface, which use the Freetype library to generate text in the scene graph, to be rendered onscreen via the Panda render traversal.
Inheritance diagram
- ACenter = 2
- ALeft = 0
- ARight = 1
- A_center = 2
- A_left = 0
- A_right = 1
- __init__(*args, **kwargs)
- calcWidth()
C++ Interface: calc_width(const PNMTextMaker self, unicode text) calc_width(const PNMTextMaker self, str text)
- calc_width()
C++ Interface: calc_width(const PNMTextMaker self, unicode text) calc_width(const PNMTextMaker self, str text)
- generateInto()
C++ Interface: generate_into(const PNMTextMaker self, unicode text, PNMImage dest_image, int x, int y) generate_into(const PNMTextMaker self, str text, PNMImage dest_image, int x, int y)
- generate_into()
C++ Interface: generate_into(const PNMTextMaker self, unicode text, PNMImage dest_image, int x, int y) generate_into(const PNMTextMaker self, str text, PNMImage dest_image, int x, int y)
- getDistanceFieldRadius()
C++ Interface: get_distance_field_radius(PNMTextMaker self)
- /**
Returns the radius previously set with set_distance_field_radius, or 0
otherwise.
*/
- getFg()
C++ Interface: get_fg(PNMTextMaker self)
- /**
Returns the foreground color of text that will be generated by future calls
to generate_into().
*/
- getGlyph()
C++ Interface: get_glyph(const PNMTextMaker self, int character)
- /**
Returns the glyph for the indicated index, or NULL if it is not defined in
the font.
*/
- getInterior()
C++ Interface: get_interior(PNMTextMaker self)
- /**
Returns the color that will be used to render the interior portions of
hollow fonts.
*/
- get_distance_field_radius()
C++ Interface: get_distance_field_radius(PNMTextMaker self)
- /**
Returns the radius previously set with set_distance_field_radius, or 0
otherwise.
*/
- get_fg()
C++ Interface: get_fg(PNMTextMaker self)
- /**
Returns the foreground color of text that will be generated by future calls
to generate_into().
*/
- get_glyph()
C++ Interface: get_glyph(const PNMTextMaker self, int character)
- /**
Returns the glyph for the indicated index, or NULL if it is not defined in
the font.
*/
- get_interior()
C++ Interface: get_interior(PNMTextMaker self)
- /**
Returns the color that will be used to render the interior portions of
hollow fonts.
*/
- isValid()
C++ Interface: is_valid(PNMTextMaker self)
- /**
Returns true if the PNMTextMaker is valid and ready to generate text, false
otherwise.
*/
- is_valid()
C++ Interface: is_valid(PNMTextMaker self)
- /**
Returns true if the PNMTextMaker is valid and ready to generate text, false
otherwise.
*/
- setDistanceFieldRadius()
C++ Interface: set_distance_field_radius(const PNMTextMaker self, int radius)
- /**
If this is set to something other than 0, Panda will generate a signed
distance field with the given radius.
*/
- setFg()
C++ Interface: set_fg(const PNMTextMaker self, const LVecBase4f fg)
- /**
Sets the foreground color of text that will be generated by future calls to
generate_into(). This is the color that all of the “on” pixels in the font
will show as.
*/
- setInterior()
C++ Interface: set_interior(const PNMTextMaker self, const LVecBase4f interior)
- /**
Sets the color that will be used to render the interior portions of hollow
fonts in future calls to generate_into(). This is respected only if
interior_flag is true.
*/
- setInteriorFlag()
C++ Interface: set_interior_flag(const PNMTextMaker self, bool interior_flag)
- /**
Sets the flag that indicates whether the interior of hollow fonts is
identified as a preprocess as each glyph is loaded. If this flag is true,
you may specify an interior color along with a fg and bg color when you
place text; if the flag is false, the interior color is ignored.
It is generally best to set_native_antialias(0) when using this feature.
Also, this works best when the pixel size is not very small.
*/
- set_distance_field_radius()
C++ Interface: set_distance_field_radius(const PNMTextMaker self, int radius)
- /**
If this is set to something other than 0, Panda will generate a signed
distance field with the given radius.
*/
- set_fg()
C++ Interface: set_fg(const PNMTextMaker self, const LVecBase4f fg)
- /**
Sets the foreground color of text that will be generated by future calls to
generate_into(). This is the color that all of the “on” pixels in the font
will show as.
*/
- set_interior()
C++ Interface: set_interior(const PNMTextMaker self, const LVecBase4f interior)
- /**
Sets the color that will be used to render the interior portions of hollow
fonts in future calls to generate_into(). This is respected only if
interior_flag is true.
*/
- set_interior_flag()
C++ Interface: set_interior_flag(const PNMTextMaker self, bool interior_flag)
- /**
Sets the flag that indicates whether the interior of hollow fonts is
identified as a preprocess as each glyph is loaded. If this flag is true,
you may specify an interior color along with a fg and bg color when you
place text; if the flag is false, the interior color is ignored.
It is generally best to set_native_antialias(0) when using this feature.
Also, this works best when the pixel size is not very small.
*/