PixelLightAPI
.
|
00001 /*********************************************************\ 00002 * File: FontGlyph.h * 00003 * 00004 * Copyright (C) 2002-2012 The PixelLight Team (http://www.pixellight.org/) 00005 * 00006 * This file is part of PixelLight. 00007 * 00008 * PixelLight is free software: you can redistribute it and/or modify 00009 * it under the terms of the GNU Lesser General Public License as published by 00010 * the Free Software Foundation, either version 3 of the License, or 00011 * (at your option) any later version. 00012 * 00013 * PixelLight is distributed in the hope that it will be useful, 00014 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00015 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00016 * GNU Lesser General Public License for more details. 00017 * 00018 * You should have received a copy of the GNU Lesser General Public License 00019 * along with PixelLight. If not, see <http://www.gnu.org/licenses/>. 00020 \*********************************************************/ 00021 00022 00023 #ifndef __PLRENDERER_FONTGLYPH_H__ 00024 #define __PLRENDERER_FONTGLYPH_H__ 00025 #pragma once 00026 00027 00028 //[-------------------------------------------------------] 00029 //[ Includes ] 00030 //[-------------------------------------------------------] 00031 #include <PLMath/Vector2.h> 00032 #include <PLMath/Vector2i.h> 00033 #include "PLRenderer/PLRenderer.h" 00034 00035 00036 //[-------------------------------------------------------] 00037 //[ Namespace ] 00038 //[-------------------------------------------------------] 00039 namespace PLRenderer { 00040 00041 00042 //[-------------------------------------------------------] 00043 //[ Classes ] 00044 //[-------------------------------------------------------] 00045 /** 00046 * @brief 00047 * Abstract renderer font glyph 00048 */ 00049 class FontGlyph { 00050 00051 00052 //[-------------------------------------------------------] 00053 //[ Public functions ] 00054 //[-------------------------------------------------------] 00055 public: 00056 /** 00057 * @brief 00058 * Destructor 00059 */ 00060 PLRENDERER_API virtual ~FontGlyph(); 00061 00062 /** 00063 * @brief 00064 * Returns the size (in pixel) of the glyph 00065 * 00066 * @return 00067 * The size (in pixel) of the glyph 00068 */ 00069 inline const PLMath::Vector2i &GetSize() const; 00070 00071 /** 00072 * @brief 00073 * Returns the distance (in pixel) from the current pen position to the glyph bitmap 00074 * 00075 * @return 00076 * The distance (in pixel) from the current pen position to the glyph bitmap 00077 */ 00078 inline const PLMath::Vector2 &GetCorner() const; 00079 00080 /** 00081 * @brief 00082 * Returns the object space pen advance 00083 * 00084 * @return 00085 * The object space pen advance 00086 */ 00087 inline const PLMath::Vector2 &GetPenAdvance() const; 00088 00089 00090 //[-------------------------------------------------------] 00091 //[ Protected functions ] 00092 //[-------------------------------------------------------] 00093 protected: 00094 /** 00095 * @brief 00096 * Default constructor 00097 */ 00098 PLRENDERER_API FontGlyph(); 00099 00100 00101 //[-------------------------------------------------------] 00102 //[ Protected data ] 00103 //[-------------------------------------------------------] 00104 protected: 00105 PLMath::Vector2i m_nSize; /**< Size (in pixel) of the glyph */ 00106 PLMath::Vector2 m_vCorner; /**< Distance (in pixel) from the current pen position to the glyph bitmap */ 00107 PLMath::Vector2 m_vPenAdvance; /**< Object space pen advance */ 00108 00109 00110 //[-------------------------------------------------------] 00111 //[ Private functions ] 00112 //[-------------------------------------------------------] 00113 private: 00114 /** 00115 * @brief 00116 * Copy constructor 00117 * 00118 * @param[in] cSource 00119 * Source to copy from 00120 */ 00121 FontGlyph(const FontGlyph &cSource); 00122 00123 /** 00124 * @brief 00125 * Copy operator 00126 * 00127 * @param[in] cSource 00128 * Source to copy from 00129 * 00130 * @return 00131 * Reference to this instance 00132 */ 00133 FontGlyph &operator =(const FontGlyph &cSource); 00134 00135 00136 }; 00137 00138 00139 //[-------------------------------------------------------] 00140 //[ Namespace ] 00141 //[-------------------------------------------------------] 00142 } // PLRenderer 00143 00144 00145 //[-------------------------------------------------------] 00146 //[ Implementation ] 00147 //[-------------------------------------------------------] 00148 #include "PLRenderer/Renderer/FontGlyph.inl" 00149 00150 00151 #endif // __PLRENDERER_FONTGLYPH_H__
|