CPU-side decoded font face (FreeType FT_Face + owned font bytes). Does not upload to GPU — rasterize glyphs to ImageData for graphics::Texture. 更多...
#include <FontData.h>
Public 成员函数 | |
| FontData (std::vector< uint8_t > bytes, int pixelSize, std::string uri="") | |
| 从字体字节创建指定像素尺寸的字体面。 | |
| ~FontData () override | |
| int | getSize () const |
| 字号 / 度量信息。 | |
| float | getAscent () const |
| float | getDescent () const |
| float | getLineHeight () const |
| float | getBaseline () const |
| std::string | getFamilyName () const |
| 字体元信息。 | |
| std::string | getStyleName () const |
| int | getGlyphCount () const |
| bool | hasGlyph (int codepoint) const |
| 字形 / 文本测量。 | |
| bool | hasGlyphs (std::string text) const |
| float | getWidth (std::string text) const |
| float | getKerning (int leftCodepoint, int rightCodepoint) const |
| void | adopt (eve::Resource &replacement) override |
Replace this face with replacement's (cache reload). | |
| int | getGlyphWidth (int codepoint) const |
| 单字形度量(像素)。 | |
| int | getGlyphHeight (int codepoint) const |
| int | getGlyphBearingX (int codepoint) const |
| int | getGlyphBearingY (int codepoint) const |
| int | getGlyphAdvance (int codepoint) const |
| image::ImageData * | newGlyphImageData (int codepoint) |
| Rasterize one glyph to RGBA8 ImageData (RGB white, A from FreeType gray). Returns a 0x0 ImageData if the codepoint is missing / empty. | |
Public 成员函数 继承自 eve::Resource | |
| virtual | ~Resource () |
| std::string | getUri () const |
| std::vector< eve::ref< Resource > > | getDependencies () const |
| virtual void | addDependency (eve::ref< Resource > resource) |
Public 成员函数 继承自 eve::Object | |
| Object () | |
| void | setUpdate (Object *update) |
| Update the current object with a replacement. You don't need to care about the reference to the old object since it will be automatically updated in the ref smart pointer. | |
额外继承的成员函数 | |
Protected 成员函数 继承自 eve::Resource | |
| Resource (std::string uri) | |
| void | setUri (std::string value) |
| Set the resource URI (the cache key). Used by ResourceManager. | |
Protected 成员函数 继承自 eve::Object | |
| virtual | ~Object () |
| bool | isDirty () const |
| Object * | getUpdate () const |
| void | ref () |
| void | unref () |
Protected 属性 继承自 eve::Resource | |
| std::string | uri |
| std::vector< eve::ref< Resource > > | dependencies |
Protected 属性 继承自 eve::Object | |
| Object * | update |
| unsigned | ref_count = 0 |
详细描述
CPU-side decoded font face (FreeType FT_Face + owned font bytes). Does not upload to GPU — rasterize glyphs to ImageData for graphics::Texture.
在文件 FontData.h 第 23 行定义.
构造及析构函数说明
◆ FontData()
| eve::font::FontData::FontData | ( | std::vector< uint8_t > | bytes, |
| int | pixelSize, | ||
| std::string | uri = "" |
||
| ) |
从字体字节创建指定像素尺寸的字体面。
在文件 FontData.cpp 第 64 行定义.
◆ ~FontData()
|
override |
在文件 FontData.cpp 第 89 行定义.
成员函数说明
◆ adopt()
|
overridevirtual |
◆ getAscent()
| float eve::font::FontData::getAscent | ( | ) | const |
在文件 FontData.cpp 第 106 行定义.
被这些函数引用 eve::graphics::Font::getAscent() , 以及 getBaseline().
◆ getBaseline()
| float eve::font::FontData::getBaseline | ( | ) | const |
◆ getDescent()
| float eve::font::FontData::getDescent | ( | ) | const |
在文件 FontData.cpp 第 112 行定义.
◆ getFamilyName()
| std::string eve::font::FontData::getFamilyName | ( | ) | const |
字体元信息。
在文件 FontData.cpp 第 127 行定义.
◆ getGlyphAdvance()
| int eve::font::FontData::getGlyphAdvance | ( | int | codepoint | ) | const |
在文件 FontData.cpp 第 233 行定义.
被这些函数引用 eve::graphics::Font::Font().
◆ getGlyphBearingX()
| int eve::font::FontData::getGlyphBearingX | ( | int | codepoint | ) | const |
在文件 FontData.cpp 第 231 行定义.
被这些函数引用 eve::graphics::Font::Font().
◆ getGlyphBearingY()
| int eve::font::FontData::getGlyphBearingY | ( | int | codepoint | ) | const |
在文件 FontData.cpp 第 232 行定义.
被这些函数引用 eve::graphics::Font::Font().
◆ getGlyphCount()
| int eve::font::FontData::getGlyphCount | ( | ) | const |
在文件 FontData.cpp 第 139 行定义.
◆ getGlyphHeight()
| int eve::font::FontData::getGlyphHeight | ( | int | codepoint | ) | const |
在文件 FontData.cpp 第 230 行定义.
◆ getGlyphWidth()
| int eve::font::FontData::getGlyphWidth | ( | int | codepoint | ) | const |
单字形度量(像素)。
在文件 FontData.cpp 第 229 行定义.
◆ getKerning()
| float eve::font::FontData::getKerning | ( | int | leftCodepoint, |
| int | rightCodepoint | ||
| ) | const |
在文件 FontData.cpp 第 167 行定义.
被这些函数引用 getWidth().
◆ getLineHeight()
| float eve::font::FontData::getLineHeight | ( | ) | const |
在文件 FontData.cpp 第 119 行定义.
被这些函数引用 eve::graphics::Font::getHeight().
◆ getSize()
| int eve::font::FontData::getSize | ( | ) | const |
字号 / 度量信息。
在文件 FontData.cpp 第 104 行定义.
◆ getStyleName()
| std::string eve::font::FontData::getStyleName | ( | ) | const |
在文件 FontData.cpp 第 133 行定义.
◆ getWidth()
| float eve::font::FontData::getWidth | ( | std::string | text | ) | const |
◆ hasGlyph()
| bool eve::font::FontData::hasGlyph | ( | int | codepoint | ) | const |
◆ hasGlyphs()
| bool eve::font::FontData::hasGlyphs | ( | std::string | text | ) | const |
在文件 FontData.cpp 第 155 行定义.
引用了 hasGlyph().
◆ newGlyphImageData()
| image::ImageData * eve::font::FontData::newGlyphImageData | ( | int | codepoint | ) |
Rasterize one glyph to RGBA8 ImageData (RGB white, A from FreeType gray). Returns a 0x0 ImageData if the codepoint is missing / empty.
在文件 FontData.cpp 第 235 行定义.
被这些函数引用 eve::graphics::Font::Font().
该类的文档由以下文件生成:
- src/modules/font/FontData.h
- src/modules/font/FontData.cpp
Public 成员函数 继承自