载入中...
搜索中...
未找到
eve::font::FontData类 参考

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>

类 eve::font::FontData 继承关系图:
eve::Resource

Public 成员函数

 FontData (std::vector< uint8_t > bytes, int pixelSize, std::string uri="")
 从字体字节创建指定像素尺寸的字体面。
 
 ~FontData () override
 Font data.
 
int getSize () const
 字号 / 度量信息。
 
float getAscent () const
 Returns the ascent.
 
float getDescent () const
 Returns the descent.
 
float getLineHeight () const
 Returns the line height.
 
float getBaseline () const
 Returns the baseline.
 
std::string getFamilyName () const
 字体元信息。
 
std::string getStyleName () const
 Returns the style name.
 
int getGlyphCount () const
 Returns the glyph count.
 
bool hasGlyph (int codepoint) const
 字形 / 文本测量。
 
bool hasGlyphs (std::string text) const
 True when glyphs.
 
float getWidth (std::string text) const
 Returns the width.
 
float getKerning (int leftCodepoint, int rightCodepoint) const
 Returns the kerning.
 
void adopt (eve::Resource &replacement) override
 Replace this face with replacement's (cache reload).
 
int getGlyphWidth (int codepoint) const
 单字形度量(像素)。
 
int getGlyphHeight (int codepoint) const
 Returns the glyph height.
 
int getGlyphBearingX (int codepoint) const
 Returns the glyph bearing x.
 
int getGlyphBearingY (int codepoint) const
 Returns the glyph bearing y.
 
int getGlyphAdvance (int codepoint) const
 Returns the glyph advance.
 
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 ()
 Releases Resource resources.
 
 Resource (const Resource &)=delete
 Resources own keep-alive pins, so they are not copyable.
 
Resource & operator= (const Resource &)=delete
 
std::string getUri () const
 Returns the uri.
 
EVENGINE_API_FOUNDATION std::vector< Resource * > getDependencies () const
 Borrowed views of the resources this instance keeps alive.
 
EVENGINE_API_FOUNDATION eve::Result< void > addDependency (Resource &dependency)
 Keeps dependency alive for as long as this instance lives.
 

额外继承的成员函数

- Protected 成员函数 继承自 eve::Resource
 Resource (std::string uri)
 Constructs a Resource.
 
void setUri (std::string value)
 Set the resource URI (the cache key). Used by ResourceManager.
 
- Protected 属性 继承自 eve::Resource
std::string uri
 
std::vector< ResourcePin > dependencies
 Keep-alive pins; see getDependencies()/addDependency().
 

详细描述

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 第 25 行定义.

构造及析构函数说明

◆ FontData()

eve::font::FontData::FontData ( std::vector< uint8_t >  bytes,
int  pixelSize,
std::string  uri = "" 
)

从字体字节创建指定像素尺寸的字体面。

在文件 FontData.cpp 第 64 行定义.

◆ ~FontData()

eve::font::FontData::~FontData ( )
override

Font data.

在文件 FontData.cpp 第 89 行定义.

成员函数说明

◆ adopt()

void eve::font::FontData::adopt ( eve::Resource &  replacement)
overridevirtual

Replace this face with replacement's (cache reload).

实现了 eve::Resource.

在文件 FontData.cpp 第 96 行定义.

◆ getAscent()

float eve::font::FontData::getAscent ( ) const

Returns the ascent.

在文件 FontData.cpp 第 106 行定义.

被这些函数引用 eve::graphics::Font::getAscent() , 以及 getBaseline().

◆ getBaseline()

float eve::font::FontData::getBaseline ( ) const

Returns the baseline.

在文件 FontData.cpp 第 125 行定义.

引用了 getAscent().

被这些函数引用 eve::graphics::Font::getBaseline().

◆ getDescent()

float eve::font::FontData::getDescent ( ) const

Returns the descent.

在文件 FontData.cpp 第 112 行定义.

◆ getFamilyName()

std::string eve::font::FontData::getFamilyName ( ) const

字体元信息。

在文件 FontData.cpp 第 127 行定义.

◆ getGlyphAdvance()

int eve::font::FontData::getGlyphAdvance ( int  codepoint) const

Returns the glyph advance.

在文件 FontData.cpp 第 233 行定义.

被这些函数引用 eve::graphics::Font::Font().

◆ getGlyphBearingX()

int eve::font::FontData::getGlyphBearingX ( int  codepoint) const

Returns the glyph bearing x.

在文件 FontData.cpp 第 231 行定义.

被这些函数引用 eve::graphics::Font::Font().

◆ getGlyphBearingY()

int eve::font::FontData::getGlyphBearingY ( int  codepoint) const

Returns the glyph bearing y.

在文件 FontData.cpp 第 232 行定义.

被这些函数引用 eve::graphics::Font::Font().

◆ getGlyphCount()

int eve::font::FontData::getGlyphCount ( ) const

Returns the glyph count.

在文件 FontData.cpp 第 139 行定义.

◆ getGlyphHeight()

int eve::font::FontData::getGlyphHeight ( int  codepoint) const

Returns the glyph height.

在文件 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

Returns the kerning.

在文件 FontData.cpp 第 167 行定义.

引用了 left , 以及 right.

被这些函数引用 getWidth().

◆ getLineHeight()

float eve::font::FontData::getLineHeight ( ) const

Returns the line height.

在文件 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

Returns the style name.

在文件 FontData.cpp 第 133 行定义.

◆ getWidth()

float eve::font::FontData::getWidth ( std::string  text) const

Returns the width.

在文件 FontData.cpp 第 212 行定义.

引用了 code, getKerning(), text , 以及 width.

被这些函数引用 eve::graphics::Font::getWidth().

◆ hasGlyph()

bool eve::font::FontData::hasGlyph ( int  codepoint) const

字形 / 文本测量。

在文件 FontData.cpp 第 151 行定义.

被这些函数引用 eve::graphics::Font::Font() , 以及 hasGlyphs().

◆ hasGlyphs()

bool eve::font::FontData::hasGlyphs ( std::string  text) const

True when glyphs.

在文件 FontData.cpp 第 155 行定义.

引用了 hasGlyph() , 以及 text.

◆ 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 行定义.

引用了 a, h, index, w, x , 以及 y.

被这些函数引用 eve::graphics::Font::Font().


该类的文档由以下文件生成: