Photon 1.0.0
Loading...
Searching...
No Matches
RasterFont Class Reference

#include <Font.h>

Inheritance diagram for RasterFont:
Font litehtml::font_metrics

Classes

struct  size_name
 

Public Member Functions

 RasterFont (int size, int weight)
 
Bitmap get_glyph (int ch, color color)
 
void load (string filename)
 
int text_width (string text) override
 
void draw_text (canvas &canvas, string text, color color, int x, int y) override
 
- Public Member Functions inherited from litehtml::font_metrics
 font_metrics ()
 
int base_line () const
 

Static Public Member Functions

static RasterFontcreate (string face, int size, int weight)
 
- Static Public Member Functions inherited from Font
static Fontcreate (string face, int size, int weight)
 

Static Public Attributes

static struct RasterFont::size_name installed_fonts []
 

Private Attributes

int width = 0
 
std::map< int, Bitmapglyphs
 

Additional Inherited Members

- Public Attributes inherited from litehtml::font_metrics
int font_size
 
int height
 
int ascent
 
int descent
 
int x_height
 
int ch_width
 
bool draw_spaces
 

Constructor & Destructor Documentation

◆ RasterFont()

RasterFont::RasterFont ( int  size,
int  weight 
)

Member Function Documentation

◆ create()

RasterFont * RasterFont::create ( string  face,
int  size,
int  weight 
)
static

◆ draw_text()

void RasterFont::draw_text ( canvas canvas,
string  text,
color  color,
int  x,
int  y 
)
overridevirtual

Implements Font.

◆ get_glyph()

Bitmap RasterFont::get_glyph ( int  ch,
color  color 
)

◆ load()

void RasterFont::load ( string  filename)

◆ text_width()

int RasterFont::text_width ( string  text)
overridevirtual

Implements Font.

Member Data Documentation

◆ glyphs

std::map<int, Bitmap> RasterFont::glyphs
private

◆ installed_fonts

RasterFont::size_name RasterFont::installed_fonts
static
Initial value:
=
{
{ 12, "terminus-12px.yaff" },
{ 14, "terminus-14px.yaff" },
{ 16, "terminus-16px.yaff" },
{ 18, "terminus-18px.yaff" },
{ 20, "terminus-20px.yaff" },
{ 22, "terminus-22px.yaff" },
{ 24, "terminus-24px.yaff" },
{ 28, "terminus-28px.yaff" },
{ 32, "terminus-32px.yaff" },
{ 0, "" }
}

◆ width

int RasterFont::width = 0
private

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