Monopoly — Portage moderne 0.1.0
Portage moderne C/C++23 du Monopoly de 1999
Loading...
Searching...
No Matches
monopoly::fonts::Runtime Class Referencefinal

#include <FontRuntime.hpp>

Public Member Functions

 Runtime ()
 
 ~Runtime ()
 
 Runtime (const Runtime &)=delete
 
Runtime & operator= (const Runtime &)=delete
 
bool ready () const noexcept
 
const Settings & settings () const noexcept
 
const Settings * savedSettings (std::size_t slot) const noexcept
 
std::expected< void, Error > setFont (const std::filesystem::path &path, std::string familyName={})
 
std::expected< void, Error > setSize (int points)
 
void setWeight (int weight)
 
void setItalic (bool enabled)
 
void setUnderline (bool enabled)
 
void setStrikeOut (bool enabled)
 
void resetCharacteristics ()
 
std::expected< void, Error > saveSettings (std::size_t slot)
 
std::expected< void, Error > restoreSettings (std::size_t slot)
 
std::expected< Metrics, Error > measure (std::string_view utf8) const
 
std::expected< Metrics, Error > measure (std::u16string_view utf16) const
 
std::expected< std::vector< std::string >, Error > wrap (std::string_view utf8, int width) const
 
std::expected< data::LegacyBitmapRGBA8, Error > render (std::string_view utf8, std::uint32_t colorRef, bool antialiased=false) const
 
std::expected< data::LegacyBitmapRGBA8, Error > render (std::u16string_view utf16, std::uint32_t colorRef, bool antialiased=false) const
 
std::size_t presentationFaceCount () const noexcept
 
std::expected< data::LegacyBitmapRGBA8, Error > renderPresentation (std::string_view utf8, std::uint32_t colorRef, int size, int weight, bool italic, bool underline=false, bool strikeOut=false, bool antialiased=true)
 
std::expected< data::LegacyBitmapRGBA8, Error > renderClipped (std::string_view utf8, std::uint32_t colorRef, ClipRect clip, bool antialiased=false) const
 
std::expected< data::LegacyBitmapRGBA8, Error > renderClipped (std::u16string_view utf16, std::uint32_t colorRef, ClipRect clip, bool antialiased=false) const
 
std::expected< void, Error > blitText (data::LegacyBitmapRGBA8 &destination, std::string_view utf8, int x, int y, std::uint32_t colorRef) const
 
std::expected< void, Error > blitText (data::LegacyBitmapRGBA8 &destination, std::u16string_view utf16, int x, int y, std::uint32_t colorRef) const
 

Static Public Attributes

static constexpr std::size_t SlotCount = 10
 
static constexpr std::size_t PresentationFaceLimit = 32
 

Detailed Description

Definition at line 73 of file FontRuntime.hpp.

Constructor & Destructor Documentation

◆ Runtime() [1/2]

monopoly::fonts::Runtime::Runtime ( )

Definition at line 186 of file FontRuntime.cpp.

◆ ~Runtime()

monopoly::fonts::Runtime::~Runtime ( )

Definition at line 191 of file FontRuntime.cpp.

◆ Runtime() [2/2]

monopoly::fonts::Runtime::Runtime ( const Runtime &  )
delete

Member Function Documentation

◆ blitText() [1/2]

std::expected< void, Error > monopoly::fonts::Runtime::blitText ( data::LegacyBitmapRGBA8 &  destination,
std::string_view  utf8,
int  x,
int  y,
std::uint32_t  colorRef 
) const

Definition at line 612 of file FontRuntime.cpp.

◆ blitText() [2/2]

std::expected< void, Error > monopoly::fonts::Runtime::blitText ( data::LegacyBitmapRGBA8 &  destination,
std::u16string_view  utf16,
int  x,
int  y,
std::uint32_t  colorRef 
) const

Definition at line 697 of file FontRuntime.cpp.

◆ measure() [1/2]

std::expected< Metrics, Error > monopoly::fonts::Runtime::measure ( std::string_view  utf8) const

Definition at line 357 of file FontRuntime.cpp.

◆ measure() [2/2]

std::expected< Metrics, Error > monopoly::fonts::Runtime::measure ( std::u16string_view  utf16) const

Definition at line 373 of file FontRuntime.cpp.

◆ operator=()

Runtime & monopoly::fonts::Runtime::operator= ( const Runtime &  )
delete

◆ presentationFaceCount()

std::size_t monopoly::fonts::Runtime::presentationFaceCount ( ) const
noexcept

Definition at line 485 of file FontRuntime.cpp.

◆ ready()

bool monopoly::fonts::Runtime::ready ( ) const
noexcept

Definition at line 198 of file FontRuntime.cpp.

◆ render() [1/2]

std::expected< data::LegacyBitmapRGBA8, Error > monopoly::fonts::Runtime::render ( std::string_view  utf8,
std::uint32_t  colorRef,
bool  antialiased = false 
) const

Definition at line 528 of file FontRuntime.cpp.

◆ render() [2/2]

std::expected< data::LegacyBitmapRGBA8, Error > monopoly::fonts::Runtime::render ( std::u16string_view  utf16,
std::uint32_t  colorRef,
bool  antialiased = false 
) const

Definition at line 588 of file FontRuntime.cpp.

◆ renderClipped() [1/2]

std::expected< data::LegacyBitmapRGBA8, Error > monopoly::fonts::Runtime::renderClipped ( std::string_view  utf8,
std::uint32_t  colorRef,
ClipRect  clip,
bool  antialiased = false 
) const

Definition at line 596 of file FontRuntime.cpp.

◆ renderClipped() [2/2]

std::expected< data::LegacyBitmapRGBA8, Error > monopoly::fonts::Runtime::renderClipped ( std::u16string_view  utf16,
std::uint32_t  colorRef,
ClipRect  clip,
bool  antialiased = false 
) const

Definition at line 604 of file FontRuntime.cpp.

◆ renderPresentation()

std::expected< data::LegacyBitmapRGBA8, Error > monopoly::fonts::Runtime::renderPresentation ( std::string_view  utf8,
std::uint32_t  colorRef,
int  size,
int  weight,
bool  italic,
bool  underline = false,
bool  strikeOut = false,
bool  antialiased = true 
)

Definition at line 491 of file FontRuntime.cpp.

◆ resetCharacteristics()

void monopoly::fonts::Runtime::resetCharacteristics ( )

Definition at line 302 of file FontRuntime.cpp.

◆ restoreSettings()

std::expected< void, Error > monopoly::fonts::Runtime::restoreSettings ( std::size_t  slot)

Definition at line 326 of file FontRuntime.cpp.

◆ savedSettings()

const Settings * monopoly::fonts::Runtime::savedSettings ( std::size_t  slot) const
noexcept

Definition at line 321 of file FontRuntime.cpp.

◆ saveSettings()

std::expected< void, Error > monopoly::fonts::Runtime::saveSettings ( std::size_t  slot)

Definition at line 312 of file FontRuntime.cpp.

◆ setFont()

std::expected< void, Error > monopoly::fonts::Runtime::setFont ( const std::filesystem::path &  path,
std::string  familyName = {} 
)

Definition at line 241 of file FontRuntime.cpp.

◆ setItalic()

void monopoly::fonts::Runtime::setItalic ( bool  enabled)

Definition at line 284 of file FontRuntime.cpp.

◆ setSize()

std::expected< void, Error > monopoly::fonts::Runtime::setSize ( int  points)

Definition at line 255 of file FontRuntime.cpp.

◆ setStrikeOut()

void monopoly::fonts::Runtime::setStrikeOut ( bool  enabled)

Definition at line 296 of file FontRuntime.cpp.

◆ settings()

const Settings & monopoly::fonts::Runtime::settings ( ) const
noexcept

Definition at line 203 of file FontRuntime.cpp.

◆ setUnderline()

void monopoly::fonts::Runtime::setUnderline ( bool  enabled)

Definition at line 290 of file FontRuntime.cpp.

◆ setWeight()

void monopoly::fonts::Runtime::setWeight ( int  weight)

Definition at line 278 of file FontRuntime.cpp.

◆ wrap()

std::expected< std::vector< std::string >, Error > monopoly::fonts::Runtime::wrap ( std::string_view  utf8,
int  width 
) const

Definition at line 380 of file FontRuntime.cpp.

Member Data Documentation

◆ PresentationFaceLimit

constexpr std::size_t monopoly::fonts::Runtime::PresentationFaceLimit = 32
staticconstexpr

Definition at line 118 of file FontRuntime.hpp.

◆ SlotCount

constexpr std::size_t monopoly::fonts::Runtime::SlotCount = 10
staticconstexpr

Definition at line 76 of file FontRuntime.hpp.


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