Lysa  0.0
Lysa 3D Engine
Font Class Reference

Detailed Description

A font resource to render text A font is a combination of a font file name and a size.

+ Inheritance diagram for Font:

Classes

struct  GlyphBounds
 
struct  GlyphInfo
 

Public Member Functions

 Font (const std::string &path)
 
 Font (const Font &font)
 
 ~Font () override
 
void getSize (const std::string &text, float fontScale, float &width, float &height)
 
auto getFontSize () const
 
auto getLineHeight () const
 
auto getAscender () const
 
auto getDescender () const
 
const GlyphInfogetGlyphInfo (uint32 index) const
 
auto getAtlas () const
 
const auto & getFontParams () const
 
void setOutlineColor (const float4 &color)
 
void setOutlineBias (const float bias)
 
void setOutlineWidthAbsolute (const float width)
 
void setOutlineWidthRelative (const float width)
 
void setOutlineBlur (const float blur)
 
void setOutlineThreshold (const float threshold)
 
auto getHarfBuzzFont () const
 
- Public Member Functions inherited from Resource
 Resource (const std::string &name)
 
auto getId () const
 
const auto & getName () const
 
bool operator== (const Resource &other) const
 
bool operator< (const Resource &other) const
 
bool operator> (const Resource &other) const
 
virtual std::shared_ptr< Resource > duplicate () const
 
- Public Member Functions inherited from Object
void connect (const Signal::signal &name, const Signal::Handler &handler)
 
void connect (const Signal::signal &name, const std::function< void ()> &handler)
 
void emit (const Signal::signal &name, void *params=nullptr)
 
virtual std::string toString () const
 
 Object () = default
 
virtual ~Object () = default
 

Constructor & Destructor Documentation

Font ( const std::string &  path)

Creates a font resource

Parameters
path: font file path, relative to the application working directory
Font ( const Font &  font)
~Font ( )
override

Member Function Documentation

auto getAscender ( ) const
inline
auto getAtlas ( ) const
inline
auto getDescender ( ) const
inline
const auto& getFontParams ( ) const
inline
auto getFontSize ( ) const
inline

Returns the font size in the atlas

const GlyphInfo& getGlyphInfo ( uint32  index) const
auto getHarfBuzzFont ( ) const
inline
auto getLineHeight ( ) const
inline
void getSize ( const std::string &  text,
float  fontScale,
float &  width,
float &  height 
)

Returns the size (in pixels) for a string.

void setOutlineBias ( const float  bias)
inline
void setOutlineBlur ( const float  blur)
inline
void setOutlineColor ( const float4 &  color)
inline
void setOutlineThreshold ( const float  threshold)
inline
void setOutlineWidthAbsolute ( const float  width)
inline
void setOutlineWidthRelative ( const float  width)
inline

Friends And Related Function Documentation

friend class Window
friend