diff --git a/panda/src/text/textFont.I b/panda/src/text/textFont.I index d90b195ba0..452e132a0f 100644 --- a/panda/src/text/textFont.I +++ b/panda/src/text/textFont.I @@ -24,6 +24,17 @@ is_valid() const { return _is_valid; } +//////////////////////////////////////////////////////////////////// +// Function: TextFont::operator bool +// Access: Published +// Description: Returns true if the font is valid and ready to use, +// false otherwise. +//////////////////////////////////////////////////////////////////// +INLINE TextFont:: +operator bool () const { + return is_valid(); +} + //////////////////////////////////////////////////////////////////// // Function: TextFont::get_line_height // Access: Published diff --git a/panda/src/text/textFont.h b/panda/src/text/textFont.h index ae0d560025..4b7acbe4ec 100644 --- a/panda/src/text/textFont.h +++ b/panda/src/text/textFont.h @@ -70,6 +70,7 @@ PUBLISHED: INLINE bool is_valid() const; + INLINE operator bool () const; INLINE float get_line_height() const; INLINE void set_line_height(float line_height);