CoriEngine
Loading...
Searching...
No Matches
Cori::Graphics::Font Class Reference

Font asset to be used when rendering text. Pretty expensive to create if not cached, always preload it. More...

#include <Font.hpp>

Inheritance diagram for Cori::Graphics::Font:
Collaboration diagram for Cori::Graphics::Font:

Classes

struct  CharsetRange
 A UTF-32 charset range. More...
struct  CharsetRanges
 These are predefined UTF-32 charset ranges to be used when creating a Font. More...
class  Descriptor
 Font Descriptor meant to be used with AssetManager only. More...

Public Member Functions

 Font ()
 ~Font ()
AssetStatus GetStatus () const

Static Public Member Functions

static std::shared_ptr< FontCreate (const std::filesystem::path &path, const std::vector< CharsetRange > &charsets, const float minimalScale=48.0f, const float miterLimit=1.0f)
 Creates a Font object.

Friends

class Renderer2D

Detailed Description

Font asset to be used when rendering text. Pretty expensive to create if not cached, always preload it.

Definition at line 15 of file Font.hpp.

Constructor & Destructor Documentation

◆ Font()

Cori::Graphics::Font::Font ( )

Definition at line 40 of file Font.cpp.

◆ ~Font()

Cori::Graphics::Font::~Font ( )

Definition at line 262 of file Font.cpp.

Member Function Documentation

◆ Create()

std::shared_ptr< Font > Cori::Graphics::Font::Create ( const std::filesystem::path & path,
const std::vector< CharsetRange > & charsets,
const float minimalScale = 48.0f,
const float miterLimit = 1.0f )
staticnodiscard

Creates a Font object.

Parameters
pathPath to the font file.
charsetsAn vector with CharsetRanges to be loaded from the font.
minimalScaleMinimal glyph scale, the higher the value, the slower generation time, higher memory usage, but smoother glyphs when using high font size. Default is a good middle-ground, increase only if your glyphs looks choppy or have slight imperfections.
miterLimitYou shouldn't touch this, the default is good, but you can try to increase it in case you see some significant artifacts.
Returns
Shared pointer to the loaded Font asset.

Definition at line 9 of file Font.cpp.

Here is the call graph for this function:

◆ GetStatus()

AssetStatus Cori::Graphics::Font::GetStatus ( ) const

Definition at line 266 of file Font.cpp.

◆ Renderer2D

friend class Renderer2D
friend

Definition at line 103 of file Font.hpp.


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