That Terminal
A terminal emulator designed for video making purposes.
FontPlan Class Reference

#include <font_planner.hh>

Classes

struct  Glyph
 

Public Member Functions

void Create (unsigned width, unsigned height, char32_t firstch, char32_t numch)
 
Glyph LoadGlyph (char32_t ch, unsigned scanline, unsigned render_width) const
 

Detailed Description

FontPlan manages a set of fonts. Multiple independent instances of this class are allowed.


Class Documentation

◆ FontPlan::Glyph

struct FontPlan::Glyph

Bitmap for pixels on single scanline

Class Members
unsigned long bitmap bitmap: maximum 64 pixels.
bool bold True if the font is "bold" style.

Member Function Documentation

◆ Create()

void FontPlan::Create ( unsigned  width,
unsigned  height,
char32_t  firstch,
char32_t  numch 
)

Initializes a background process (thread) for preparing information to be used by LoadGlyph.

Parameters
widthWidth of font in pixels
heightHeight of font in pixels
firstchFirst unicode codepoint to initialize
numchNumber of unicode codepoints to initialize

Attempts to find the best representation for each glyph in this range, using information in share/fonts/preferences.txt . If a font by the exact requested size is not found, attempts to find closest match.

If the parameters are identical to when the function was last called, does nothing.

◆ LoadGlyph()

FontPlan::Glyph FontPlan::LoadGlyph ( char32_t  ch,
unsigned  scanline,
unsigned  render_width 
) const

Loads glyph for the given codepoint. Waits until the background process started by Create() has finished, if necessary.

Parameters
chCodepoint to load information for. Should be >= firstch and <= firstch+numch.
scanlineScanline to load. Should be < height.
render_widthWidth of font in pixels, when it is rendered.
Returns
Glyph structure

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