Polyphase Game Engine
Loading...
Searching...
No Matches
Font Class Reference

#include <Font.h>

Inheritance diagram for Font:
Asset Object

Public Member Functions

 DECLARE_ASSET (Font, Asset)
 
 Font ()
 
virtual ~Font ()
 
virtual void LoadStream (Stream &stream, Platform platform) override
 
virtual void SaveStream (Stream &stream, Platform platform) override
 
virtual void Create () override
 
virtual void Destroy () override
 
virtual bool Import (const std::string &path, ImportOptions *options) override
 
virtual void GatherProperties (std::vector< Property > &outProps) override
 
virtual glm::vec4 GetTypeColor () override
 
virtual const char * GetTypeName () override
 
virtual const char * GetTypeImportExt () override
 
int32_t GetSize () const
 
int32_t GetWidth () const
 
int32_t GetHeight () const
 
float GetLineSpacing () const
 
const std::vector< Character > & GetCharacters () const
 
TextureGetTexture () const
 
bool IsBold () const
 
bool IsItalic () const
 
void SetTexture (Texture *texture)
 
void RebuildFont ()
 
- Public Member Functions inherited from Asset
 DECLARE_FACTORY_MANAGER (Asset)
 
 DECLARE_FACTORY (Asset, Asset)
 
 DECLARE_OBJECT (Asset, Object)
 
 Asset ()
 
virtual ~Asset ()
 
virtual void Copy (Asset *srcAsset)
 
const std::string & GetName () const
 
bool IsLoaded () const
 
bool IsRefCounted () const
 
int32_t GetRefCount () const
 
bool IsEmbedded () const
 
void SetEmbedded (bool embed)
 
bool IsEngineAsset () const
 
void SetEngineAsset (bool engineAsset)
 
void SetName (const std::string &name)
 
void IncrementRefCount ()
 
void DecrementRefCount ()
 
void LoadFile (const char *path, AsyncLoadRequest *request=nullptr)
 
void LoadEmbedded (const EmbeddedFile *embeddedAsset, AsyncLoadRequest *request=nullptr)
 
void SaveFile (const char *path, Platform platform)
 
virtual bool ShouldSnapshotForPie () const
 
bool IsTransient () const
 
void SetTransient (bool transient)
 
uint64_t GetUuid () const
 
void SetUuid (uint64_t uuid)
 
void EnsureUuid ()
 
void WriteHeader (Stream &stream)
 
- Public Member Functions inherited from Object
virtual ~Object ()=default
 
virtual const char * RuntimeName () const =0
 
virtual const char * RuntimeParentName () const =0
 
virtual RuntimeId InstanceRuntimeId () const =0
 
virtual ObjectQueryInterface (RuntimeId id) const
 
virtual bool Is (RuntimeId id) const
 
virtual bool Is (const char *name) const
 
virtual bool DrawCustomProperty (Property &prop)
 
template<typename T >
T * As () const
 
virtual bool Equals (const Object *rhs) const
 

Static Public Member Functions

static bool HandlePropChange (Datum *datum, uint32_t index, const void *newValue)
 
- Static Public Member Functions inherited from Asset
static AssetHeader ReadHeader (Stream &stream)
 
static std::string GetNameFromPath (const std::string &path)
 
static std::string GetDirectoryFromPath (const std::string &path)
 
static const char * GetNameFromTypeId (TypeId id)
 
static TypeId GetTypeIdFromName (const char *name)
 
- Static Public Member Functions inherited from Object
static const char * ClassRuntimeName ()
 

Protected Member Functions

void ImportXml (const std::string &path, ImportOptions *options)
 

Protected Attributes

int32_t mSize = 32
 
int32_t mWidth = 0
 
int32_t mHeight = 0
 
std::vector< CharactermCharacters
 
TextureRef mTexture
 
float mLineSpacing = 0.0f
 
bool mBold = false
 
bool mItalic = false
 
bool mTtf = true
 
FilterType mFilterType = FilterType::Linear
 
WrapMode mWrapMode = WrapMode::Clamp
 
bool mMipmapped = true
 
bool mFontDirty [MAX_FRAMES] = { }
 
- Protected Attributes inherited from Asset
uint32_t mVersion = 0
 
TypeId mType = INVALID_TYPE_ID
 
uint64_t mUuid = 0
 
bool mEmbedded = false
 
bool mLoaded = false
 
bool mEnableRefCount = true
 
bool mEngineAsset = false
 
bool mTransient = false
 
std::string mName = "Asset"
 
int32_t mRefCount = 0
 

Constructor & Destructor Documentation

◆ Font()

Font::Font ( )

◆ ~Font()

Font::~Font ( )
virtual

Member Function Documentation

◆ Create()

void Font::Create ( )
overridevirtual

Reimplemented from Asset.

◆ DECLARE_ASSET()

Font::DECLARE_ASSET ( Font  ,
Asset   
)

◆ Destroy()

void Font::Destroy ( )
overridevirtual

Reimplemented from Asset.

◆ GatherProperties()

void Font::GatherProperties ( std::vector< Property > &  outProps)
overridevirtual

Reimplemented from Asset.

◆ GetCharacters()

const std::vector< Character > & Font::GetCharacters ( ) const

◆ GetHeight()

int32_t Font::GetHeight ( ) const

◆ GetLineSpacing()

float Font::GetLineSpacing ( ) const

◆ GetSize()

int32_t Font::GetSize ( ) const

◆ GetTexture()

Texture * Font::GetTexture ( ) const

◆ GetTypeColor()

glm::vec4 Font::GetTypeColor ( )
overridevirtual

Reimplemented from Asset.

◆ GetTypeImportExt()

const char * Font::GetTypeImportExt ( )
overridevirtual

Reimplemented from Asset.

◆ GetTypeName()

const char * Font::GetTypeName ( )
overridevirtual

Reimplemented from Asset.

◆ GetWidth()

int32_t Font::GetWidth ( ) const

◆ HandlePropChange()

bool Font::HandlePropChange ( Datum datum,
uint32_t  index,
const void *  newValue 
)
static

◆ Import()

bool Font::Import ( const std::string &  path,
ImportOptions options 
)
overridevirtual

Reimplemented from Asset.

◆ ImportXml()

void Font::ImportXml ( const std::string &  path,
ImportOptions options 
)
protected

◆ IsBold()

bool Font::IsBold ( ) const

◆ IsItalic()

bool Font::IsItalic ( ) const

◆ LoadStream()

void Font::LoadStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

◆ RebuildFont()

void Font::RebuildFont ( )

◆ SaveStream()

void Font::SaveStream ( Stream stream,
Platform  platform 
)
overridevirtual

Reimplemented from Asset.

◆ SetTexture()

void Font::SetTexture ( Texture texture)

Member Data Documentation

◆ mBold

bool Font::mBold = false
protected

◆ mCharacters

std::vector<Character> Font::mCharacters
protected

◆ mFilterType

FilterType Font::mFilterType = FilterType::Linear
protected

◆ mFontDirty

bool Font::mFontDirty[MAX_FRAMES] = { }
protected

◆ mHeight

int32_t Font::mHeight = 0
protected

◆ mItalic

bool Font::mItalic = false
protected

◆ mLineSpacing

float Font::mLineSpacing = 0.0f
protected

◆ mMipmapped

bool Font::mMipmapped = true
protected

◆ mSize

int32_t Font::mSize = 32
protected

◆ mTexture

TextureRef Font::mTexture
protected

◆ mTtf

bool Font::mTtf = true
protected

◆ mWidth

int32_t Font::mWidth = 0
protected

◆ mWrapMode

WrapMode Font::mWrapMode = WrapMode::Clamp
protected

The documentation for this class was generated from the following files: