Terminal Graphics
Single-file, header-only C++20 functionality for producing graphics on the terminal using the sixel protocol
Loading...
Searching...
No Matches
TG::Font Class Reference

A class to hold the information about the font used for text rendering. More...

Public Member Functions

constexpr Font (int width, int height, const std::span< const unsigned char > &data)
 
constexpr int width () const
 
constexpr int height () const
 
bool get (int offset, int x, int y) const
 
template<typename ValueType>
void render (Image< ValueType > &canvas, char c, int x, int y, int colour_index) const
 

Static Public Member Functions

static constexpr const Font get_font (int size=16)
 

Detailed Description

A class to hold the information about the font used for text rendering.

This is should not need to be used directly outside of this file.

Constructor & Destructor Documentation

◆ Font()

TG::Font::Font ( int width,
int height,
const std::span< const unsigned char > & data )
inlineconstexpr

Member Function Documentation

◆ width()

int TG::Font::width ( ) const
inlineconstexpr

◆ height()

int TG::Font::height ( ) const
inlineconstexpr

◆ get()

bool TG::Font::get ( int offset,
int x,
int y ) const
inline

◆ render()

template<typename ValueType>
void TG::Font::render ( Image< ValueType > & canvas,
char c,
int x,
int y,
int colour_index ) const
inline

◆ get_font()

const Font TG::Font::get_font ( int size = 16)
inlinestaticconstexpr