70 std::string m_sTexturePath;
72 int m_iDrawExtraPixelsLeft{ 0 }, m_iDrawExtraPixelsRight{ 0 },
73 m_iAddToAllWidths{ 0 }, m_iLineSpacing{ -1 }, m_iTop{ -1 },
74 m_iBaseline{ -1 }, m_iDefaultWidth{ -1 }, m_iAdvanceExtraPixels{ 1 };
75 float m_fScaleAllWidthsBy{ 1 };
76 std::string m_sTextureHints;
78 std::map<wchar_t, int> CharToGlyphNo;
80 std::map<int, int> m_mapGlyphWidths;
85 , m_sTextureHints(
"default")
99 std::string
MapRange(
const std::string& sMapping,
115 int m_iLineSpacing{ 0 };
116 float m_fVshift{ 0 };
117 int GetCenter()
const {
return m_iHeight / 2; }
120 int m_iDrawExtraPixelsLeft{ 0 }, m_iDrawExtraPixelsRight{ 0 };
125 std::string m_sTexturePath;
130 std::map<wchar_t, int> m_iCharToGlyphNo;
133 void SetExtraPixels(
int iDrawExtraPixelsLeft,
int DrawExtraPixelsRight);
134 void SetTextureCoords(
const std::vector<int>& aiWidths,
135 int iAdvanceExtraPixels);
141 int m_iRefCount{ 1 };
147 const glyph& GetGlyph(
wchar_t c)
const;
149 int GetLineWidthInSourcePixels(
const std::wstring& szLine)
const;
150 int GetLineHeightInSourcePixels(
const std::wstring& szLine)
const;
151 int GetGlyphsThatFit(
const std::wstring& line,
int* width)
const;
153 bool FontCompleteForString(
const std::wstring& str)
const;
166 void Load(
const std::string& sFontOrTextureFilePath,
167 const std::string& sChars);
174 int GetHeight()
const {
return m_pDefault->m_iHeight; }
175 int GetCenter()
const {
return m_pDefault->GetCenter(); }
176 int GetLineSpacing()
const {
return m_pDefault->m_iLineSpacing; }
178 void SetDefaultGlyph(
FontPage* pPage);
180 bool IsRightToLeft()
const {
return m_bRightToLeft; };
181 const RageColor& GetDefaultStrokeColor()
const
183 return m_DefaultStrokeColor;
189 std::vector<FontPage*> m_apPages;
199 std::map<wchar_t, glyph*> m_iCharToGlyph;
201 glyph* m_iCharToGlyphCache[128];
208 bool m_bRightToLeft{
false };
213 std::string m_sChars;
217 const std::string& sTexturePath,
218 const std::string& PageName,
219 const std::string& sChars);
220 static void GetFontPaths(
const std::string& sFontOrTextureFilePath,
221 std::vector<std::string>& sTexturePaths);
222 std::string GetPageNameFromFileName(
const std::string& sFilename);
std::vector< glyph > m_aGlyphs
All glyphs in this list will point to m_pTexture.
Definition Font.h:128
Definition RageTexture.h:14
The settings used for the FontPage.
Definition Font.h:69
std::string MapRange(const std::string &sMapping, int iMapOffset, int iGlyphOffset, int iCount)
Map a range from a character std::map to glyphs.
Definition Font.cpp:744
FontPageSettings()
The initial settings for the FontPage.
Definition Font.h:83
The textures used by the font.
Definition Font.h:15
RageTexture * m_pTextureMain
The primary texture drawn underneath Main.
Definition Font.h:17
RageTexture * m_pTextureStroke
an optional texture drawn underneath Main.
Definition Font.h:21
FontPageTextures()
Set up the initial textures.
Definition Font.h:24