![]() |
DDNet documentation
|
Public Types | |
| enum | { FONT_TEXTURE_FILL = 0 , FONT_TEXTURE_OUTLINE , NUM_FONT_TEXTURES } |
Public Member Functions | |
| CGlyphMap (IGraphics *pGraphics) | |
| ~CGlyphMap () | |
| FT_Face | DefaultFace () const |
| FT_Face | IconFace () const |
| void | AddFace (FT_Face Face) |
| bool | SetDefaultFaceByName (const char *pFamilyName) |
| bool | SetIconFaceByName (const char *pFamilyName) |
| bool | AddFallbackFaceByName (const char *pFamilyName) |
| bool | SetVariantFaceByName (const char *pFamilyName) |
| void | SetFontPreset (EFontPreset FontPreset) |
| void | Clear () |
| const SGlyph * | GetGlyph (int Chr, int FontSize) |
| vec2 | Kerning (const SGlyph *pLeft, const SGlyph *pRight) const |
| void | UploadEntityLayerText (const CImageInfo &TextImage, int TexSubWidth, int TexSubHeight, const char *pText, int Length, float x, float y, int FontSize) |
| size_t | TextureDimension () const |
| IGraphics::CTextureHandle | Texture (size_t TextureIndex) const |
Private Member Functions | |
| IGraphics * | Graphics () |
| FT_Face | GetFaceByName (const char *pFamilyName) |
| bool | IncreaseGlyphMapSize () |
| void | UploadTextures () |
| void | UnloadTextures () |
| FT_UInt | GetCharGlyph (int Chr, FT_Face *pFace, bool AllowReplacementCharacter) |
| void | Grow (const unsigned char *pIn, unsigned char *pOut, int w, int h, int OutlineCount) const |
| int | AdjustOutlineThicknessToFontSize (int OutlineThickness, int FontSize) const |
| void | UploadGlyph (int TextureIndex, int PosX, int PosY, size_t Width, size_t Height, uint8_t *pData) |
| bool | FitGlyph (size_t Width, size_t Height, int &PosX, int &PosY) |
| bool | RenderGlyph (SGlyph &Glyph) |
Private Attributes | |
| IGraphics * | m_pGraphics |
| IGraphics::CTextureHandle | m_aTextures [NUM_FONT_TEXTURES] |
| size_t | m_TextureDimension = INITIAL_ATLAS_DIMENSION |
| uint8_t * | m_apTextureData [NUM_FONT_TEXTURES] |
| CAtlas | m_TextureAtlas |
| std::unordered_map< std::tuple< FT_Face, int, int >, SGlyph, SGlyphKeyHash, SGlyphKeyEquals > | m_Glyphs |
| FT_Face | m_DefaultFace = nullptr |
| FT_Face | m_IconFace = nullptr |
| FT_Face | m_VariantFace = nullptr |
| FT_Face | m_SelectedFace = nullptr |
| std::vector< FT_Face > | m_vFallbackFaces |
| std::vector< FT_Face > | m_vFtFaces |
Static Private Attributes | |
| static constexpr int | INITIAL_ATLAS_DIMENSION = 1024 |
| static constexpr int | MAXIMUM_ATLAS_DIMENSION = 16 * 1024 |
| static constexpr int | MIN_FONT_SIZE = 6 |
| static constexpr int | MAX_FONT_SIZE = 128 |
| static constexpr int | REPLACEMENT_CHARACTER = 0x25a1 |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inlineprivate |
|
inline |
|
inlineprivate |
|
inlineprivate |
|
staticconstexprprivate |
The initial dimension of the atlas textures. Results in 1 MB of memory being used per texture.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
staticconstexprprivate |
The maximum supported font size.
|
staticconstexprprivate |
The maximum dimension of the atlas textures. Results in 256 MB of memory being used per texture.
|
staticconstexprprivate |
The minimum supported font size.
|
staticconstexprprivate |
White square to indicate missing glyph.