Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2026-06-02 08:58:13

0001 ////////////////////////////////////////////////////////////
0002 //
0003 // SFML - Simple and Fast Multimedia Library
0004 // Copyright (C) 2007-2023 Laurent Gomila (laurent@sfml-dev.org)
0005 //
0006 // This software is provided 'as-is', without any express or implied warranty.
0007 // In no event will the authors be held liable for any damages arising from the use of this software.
0008 //
0009 // Permission is granted to anyone to use this software for any purpose,
0010 // including commercial applications, and to alter it and redistribute it freely,
0011 // subject to the following restrictions:
0012 //
0013 // 1. The origin of this software must not be misrepresented;
0014 //    you must not claim that you wrote the original software.
0015 //    If you use this software in a product, an acknowledgment
0016 //    in the product documentation would be appreciated but is not required.
0017 //
0018 // 2. Altered source versions must be plainly marked as such,
0019 //    and must not be misrepresented as being the original software.
0020 //
0021 // 3. This notice may not be removed or altered from any source distribution.
0022 //
0023 ////////////////////////////////////////////////////////////
0024 
0025 #ifndef SFML_GLYPH_HPP
0026 #define SFML_GLYPH_HPP
0027 
0028 ////////////////////////////////////////////////////////////
0029 // Headers
0030 ////////////////////////////////////////////////////////////
0031 #include <SFML/Graphics/Export.hpp>
0032 #include <SFML/Graphics/Rect.hpp>
0033 
0034 
0035 namespace sf
0036 {
0037 ////////////////////////////////////////////////////////////
0038 /// \brief Structure describing a glyph
0039 ///
0040 ////////////////////////////////////////////////////////////
0041 class SFML_GRAPHICS_API Glyph
0042 {
0043 public:
0044 
0045     ////////////////////////////////////////////////////////////
0046     /// \brief Default constructor
0047     ///
0048     ////////////////////////////////////////////////////////////
0049     Glyph() : advance(0), lsbDelta(0), rsbDelta(0) {}
0050 
0051     ////////////////////////////////////////////////////////////
0052     // Member data
0053     ////////////////////////////////////////////////////////////
0054     float     advance;     //!< Offset to move horizontally to the next character
0055     int       lsbDelta;    //!< Left offset after forced autohint. Internally used by getKerning()
0056     int       rsbDelta;    //!< Right offset after forced autohint. Internally used by getKerning()
0057     FloatRect bounds;      //!< Bounding rectangle of the glyph, in coordinates relative to the baseline
0058     IntRect   textureRect; //!< Texture coordinates of the glyph inside the font's texture
0059 };
0060 
0061 } // namespace sf
0062 
0063 
0064 #endif // SFML_GLYPH_HPP
0065 
0066 
0067 ////////////////////////////////////////////////////////////
0068 /// \class sf::Glyph
0069 /// \ingroup graphics
0070 ///
0071 /// A glyph is the visual representation of a character.
0072 ///
0073 /// The sf::Glyph structure provides the information needed
0074 /// to handle the glyph:
0075 /// \li its coordinates in the font's texture
0076 /// \li its bounding rectangle
0077 /// \li the offset to apply to get the starting position of the next glyph
0078 ///
0079 /// \see sf::Font
0080 ///
0081 ////////////////////////////////////////////////////////////