载入中...
搜索中...
未找到
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 eve::Object

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::ImageDatanewGlyphImageData (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
 
ObjectgetUpdate () const
 
void ref ()
 
void unref ()
 
- Protected 属性 继承自 eve::Resource
std::string uri
 
std::vector< eve::ref< Resource > > dependencies
 
- Protected 属性 继承自 eve::Object
Objectupdate
 
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.h23 行定义.

构造及析构函数说明

◆ FontData()

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

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

在文件 FontData.cpp64 行定义.

◆ ~FontData()

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

在文件 FontData.cpp89 行定义.

成员函数说明

◆ adopt()

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

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

实现了 eve::Resource.

在文件 FontData.cpp96 行定义.

◆ getAscent()

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

在文件 FontData.cpp106 行定义.

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

◆ getBaseline()

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

在文件 FontData.cpp125 行定义.

引用了 getAscent().

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

◆ getDescent()

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

在文件 FontData.cpp112 行定义.

◆ getFamilyName()

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

字体元信息。

在文件 FontData.cpp127 行定义.

◆ getGlyphAdvance()

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

在文件 FontData.cpp233 行定义.

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

◆ getGlyphBearingX()

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

在文件 FontData.cpp231 行定义.

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

◆ getGlyphBearingY()

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

在文件 FontData.cpp232 行定义.

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

◆ getGlyphCount()

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

在文件 FontData.cpp139 行定义.

◆ getGlyphHeight()

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

在文件 FontData.cpp230 行定义.

◆ getGlyphWidth()

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

单字形度量(像素)。

在文件 FontData.cpp229 行定义.

◆ getKerning()

float eve::font::FontData::getKerning ( int  leftCodepoint,
int  rightCodepoint 
) const

在文件 FontData.cpp167 行定义.

被这些函数引用 getWidth().

◆ getLineHeight()

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

在文件 FontData.cpp119 行定义.

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

◆ getSize()

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

字号 / 度量信息。

在文件 FontData.cpp104 行定义.

◆ getStyleName()

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

在文件 FontData.cpp133 行定义.

◆ getWidth()

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

在文件 FontData.cpp212 行定义.

引用了 getKerning() , 以及 width.

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

◆ hasGlyph()

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

字形 / 文本测量。

在文件 FontData.cpp151 行定义.

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

◆ hasGlyphs()

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

在文件 FontData.cpp155 行定义.

引用了 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.cpp235 行定义.

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

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


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