diff --git a/include/SFML/Graphics/Text.hpp b/include/SFML/Graphics/Text.hpp index e70bdec4..4ed92e0f 100644 --- a/include/SFML/Graphics/Text.hpp +++ b/include/SFML/Graphics/Text.hpp @@ -283,16 +283,15 @@ public: //////////////////////////////////////////////////////////// /// \brief Get the text's font /// - /// If the text has no font attached, a null pointer is returned. - /// The returned pointer is const, which means that you + /// The returned reference is const, which means that you /// cannot modify the font when you get it from this function. /// - /// \return Pointer to the text's font + /// \return Reference to the text's font /// /// \see setFont /// //////////////////////////////////////////////////////////// - const Font* getFont() const; + const Font& getFont() const; //////////////////////////////////////////////////////////// /// \brief Get the character size diff --git a/src/SFML/Graphics/Text.cpp b/src/SFML/Graphics/Text.cpp index aedebddb..79c55c5b 100644 --- a/src/SFML/Graphics/Text.cpp +++ b/src/SFML/Graphics/Text.cpp @@ -241,9 +241,9 @@ const String& Text::getString() const //////////////////////////////////////////////////////////// -const Font* Text::getFont() const +const Font& Text::getFont() const { - return m_font; + return *m_font; }