Search Results for

    Show / Hide Table of Contents

    Class FontAsset

    Font asset contains glyph collection and cached data used to render text.

    Inheritance
    Object
    ScriptingObject
    ManagedScriptingObject
    Asset
    BinaryAsset
    FontAsset
    Inherited Members
    Asset::_deleteFileOnUnload
    BinaryAsset::_dependantAssets
    ScriptingObject::_gcHandle
    BinaryAsset::_header
    ScriptingObject::_id
    BinaryAsset::_isSaving
    Asset::_isVirtual
    Asset::_loadingTask
    Asset::_loadState
    Asset::_refCount
    BinaryAsset::_storageRef
    ScriptingObject::_type
    BinaryAsset::AddDependency(BinaryAsset* asset)
    Asset::AddReference()
    Asset::Asset(const SpawnParams& params, const AssetInfo* info)
    ScriptingObject::CanCast(const ScriptingTypeHandle& from, const ScriptingTypeHandle& to)
    ScriptingObject::CanCast(const MClass* from, const MClass* to)
    Asset::CancelStreaming()
    ScriptingObject::Cast(ScriptingObject* obj)
    Asset::ChangeID(const Guid& newId)
    BinaryAsset::ClearDependencies()
    Asset::const
    BinaryAsset::createLoadingTask()
    Asset::CreateManaged()
    ScriptingObject::CreateManagedInternal()
    Asset::DECLARE_ENUM_7(LoadResult, Ok, Failed, MissingDataChunk, CannotLoadData, CannotLoadStorage, CannotLoadInitData, InvalidData)
    ScriptingObject::Deleted
    Asset::DeleteManaged()
    Object::DeleteObject(float timeToLive = 0.0f, bool useGameTime=false)
    Object::DeleteObjectNow()
    BinaryAsset::Dependencies
    Asset::DEPRECATED("Use GetReferences with assets and files parameter instead")
    Asset::DestroyManaged()
    FontAsset
    Object::Flags
    ScriptingObject::FromInterface(void* interfaceObj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::FromInterface(T* interfaceObj)
    BinaryAsset::GetChunk(int32 index)
    BinaryAsset::GetChunkData(int32 index, BytesContainer& data)
    BinaryAsset::GetChunkSize(int32 index)
    ScriptingObject::GetClass()
    ScriptingObject::GetID()
    BinaryAsset::GetImportMetadata(String& path, String& username)
    BinaryAsset::GetImportPath()
    ScriptingObject::GetManagedInstance()
    BinaryAsset::GetOrCreateChunk(int32 index)
    ScriptingObject::GetOrCreateManagedInstance()
    BinaryAsset::GetPath()
    Asset::GetReferences(Array<Guid, HeapAllocation>& assets, Array<String, HeapAllocation>& files)
    Asset::GetReferences()
    Asset::GetReferencesCount()
    BinaryAsset::GetSerializedVersion()
    ScriptingObject::GetType()
    ScriptingObject::GetTypeHandle()
    Asset::GetTypeName()
    BinaryAsset::HasChunk(int32 index)
    BinaryAsset::HasChunkLoaded(int32 index)
    BinaryAsset::HasDependenciesModified()
    ScriptingObject::HasManagedInstance()
    BinaryAsset::Init(const FlaxStorageReference& storage, AssetHeader& header)
    BinaryAsset::Init(AssetInitData& initData)
    Asset::InitAsVirtual()
    BinaryAsset::InitVirtual(AssetInitData& initData)
    ScriptingObject::Is(const ScriptingTypeHandle& type)
    ScriptingObject::Is(const MClass* type)
    ScriptingObject::Is()
    Asset::IsInternalType()
    Asset::IsLoaded()
    ScriptingObject::IsRegistered()
    Asset::IsVirtual()
    Asset::LastLoadFailed()
    BinaryAsset::loadAsset()
    BinaryAsset::LoadChunk(int32 chunkIndex)
    BinaryAsset::LoadChunks(AssetChunksFlag chunks)
    FontAsset
    Asset::Locker
    ManagedScriptingObject::ManagedScriptingObject(const SpawnParams& params)
    BinaryAsset::Metadata
    ScriptingObject::NewObject(const ScriptingTypeHandle& typeHandle)
    ScriptingObject::NewObject()
    Asset::OnCheckSave(const StringView& path=StringView::Empty)
    BinaryAsset::OnDeleteObject()
    BinaryAsset::OnDependencyModified(BinaryAsset* asset)
    Asset::onLoad(LoadAssetTask* task)
    Asset::OnLoaded
    Asset::onLoaded()
    Asset::onLoaded_MainThread()
    Asset::OnManagedInstanceDeleted()
    Asset::OnReloading
    BinaryAsset::onRename(const StringView& newPath)
    Asset::OnScriptingDispose()
    Asset::onUnload_MainThread()
    Asset::OnUnloaded
    ScriptingObject::RegisterObject()
    BinaryAsset::Reimport()
    BinaryAsset::ReleaseChunk(int32 index)
    BinaryAsset::ReleaseChunks()
    BinaryAsset::releaseStorage()
    Asset::Reload()
    Asset::RemoveReference()
    BinaryAsset::RequestChunkDataAsync(int32 index)
    BinaryAsset::SaveAsset(AssetInitData& data, bool silentMode=false)
    BinaryAsset::SaveAsset(const StringView& path, AssetInitData& data, bool silentMode=false)
    BinaryAsset::SaveToAsset(const StringView& path, AssetInitData& data, bool silentMode=false)
    ScriptingObject::ScriptingObject(const SpawnParams& params)
    BinaryAsset::SetChunk(int32 index, const Span<byte>& data)
    ManagedScriptingObject::SetManagedInstance(MObject* instance)
    Asset::ShouldDeleteFileOnUnload()
    FontAsset
    Asset::startLoading()
    BinaryAsset::Storage
    ScriptingObject::ToInterface(ScriptingObject* obj, const ScriptingTypeHandle& interfaceType)
    ScriptingObject::ToInterface(ScriptingObject* obj)
    ScriptingObject::ToManaged(const ScriptingObject* obj)
    ScriptingObject::ToNative(MObject* obj)
    Asset::ToString()
    ScriptingObject::UnregisterObject()
    Asset::WaitForLoaded(double timeoutInMilliseconds=30000.0)
    BinaryAsset::~BinaryAsset()
    Object::~Object()
    ScriptingObject::~ScriptingObject()
    Assembly: FlaxEngine.dll
    File: Engine/Render2D/FontAsset.h
    Syntax
    public class FontAsset : public BinaryAsset

    Methods

    ContainsChar(Char c)

    Check if the font contains the glyph of a char.

    Declaration
    public bool ContainsChar(Char c) const
    Parameters
    Char c

    The char to test.

    Returns
    bool

    True if the font contains the glyph of the char, otherwise false.

    CreateFont(float size)

    Creates the font object of given characters size.

    Declaration
    public Font* CreateFont(float size)
    Parameters
    float size

    The font characters size.

    Returns
    Font

    The created font object.

    GetBold()

    Gets the font with bold style. Returns itself or creates a new virtual font asset using this font but with bold option enabled.

    Declaration
    public FontAsset* GetBold()
    Returns
    FontAsset

    The virtual font or this.

    getChunksToPreload()

    Gets packed chunks indices to preload before asset loading action

    Declaration
    protected virtual AssetChunksFlag getChunksToPreload() const override
    Returns
    AssetChunksFlag

    Chunks to load flags

    Overrides
    BinaryAsset::getChunksToPreload()

    GetFamilyName()

    Gets the font family name.

    Declaration
    public String GetFamilyName() const
    Returns
    String

    GetFTFace()

    Gets FreeType face handle.

    Declaration
    public FT_Face GetFTFace() const
    Returns
    FT_Face

    GetItalic()

    Gets the font with italic style. Returns itself or creates a new virtual font asset using this font but with italic option enabled.

    Declaration
    public FontAsset* GetItalic()
    Returns
    FontAsset

    The virtual font or this.

    GetMemoryUsage()

    Gets amount of CPU memory used by this resource (in bytes). It's a rough estimation. Memory may be fragmented, compressed or sub-allocated so the actual memory pressure from this resource may vary.

    Declaration
    public virtual uint64 GetMemoryUsage() const override
    Returns
    uint64

    Overrides
    BinaryAsset::GetMemoryUsage()

    GetOptions()

    Gets the font options.

    Declaration
    public FontOptions GetOptions() const
    Returns
    FontOptions

    GetStyle()

    Gets the font style flags.

    Declaration
    public FontFlags GetStyle() const
    Returns
    FontFlags

    GetStyleName()

    Gets the font style name.

    Declaration
    public String GetStyleName() const
    Returns
    String

    init(AssetInitData& initData)

    Initializes the specified asset.

    Declaration
    protected virtual bool init(AssetInitData& initData) override
    Parameters
    AssetInitData initData

    The initialize data.

    Returns
    bool

    True if cannot init, otherwise false

    Overrides
    BinaryAsset::init(AssetInitData& initData)

    Init(const BytesContainer& fontFile)

    Initializes the font with a custom font file data.

    Declaration
    public bool Init(const BytesContainer& fontFile)
    Parameters
    BytesContainer fontFile

    Raw bytes with font file data.

    Returns
    bool

    True if cannot init, otherwise false.

    Invalidate()

    Invalidates all cached dynamic font atlases using this font. Can be used to reload font characters after changing font asset options.

    Declaration
    public void Invalidate()

    load()

    Load data from the chunks

    Declaration
    protected virtual LoadResult load() override
    Returns
    LoadResult

    Loading result

    Overrides
    BinaryAsset::load()

    Save(const StringView& path=StringView::Empty)

    Saves this asset to the file. Supported only in Editor.

    Declaration
    public virtual bool Save(const StringView& path=StringView::Empty) override
    Parameters
    StringView path

    The custom asset path to use for the saving. Use empty value to save this asset to its own storage location. Can be used to duplicate asset. Must be specified when saving virtual asset.

    Returns
    bool

    True when cannot save data, otherwise false.

    Overrides
    Asset::Save(const StringView& path=StringView::Empty)

    SetOptions(const FontOptions& value)

    Sets the font options.

    Declaration
    public void SetOptions(const FontOptions& value)
    Parameters
    FontOptions value

    unload(bool isReloading)

    Unloads asset data

    Declaration
    protected virtual void unload(bool isReloading) override
    Parameters
    bool isReloading

    True if asset is reloading data, otherwise false.

    Overrides
    Asset::unload(bool isReloading)
    • Improve this Doc
    • View Source
    In This Article
    Back to top Copyright © 2012-2024 Wojciech Figat