GNU Octave  8.1.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
ft_text_renderer Class Reference
Inheritance diagram for ft_text_renderer:
Collaboration diagram for ft_text_renderer:

Classes

class  ft_font
 

Public Types

enum  { ROTATION_0 = 0 , ROTATION_90 = 1 , ROTATION_180 = 2 , ROTATION_270 = 3 }
 
enum  { MODE_BBOX = 0 , MODE_RENDER = 1 }
 

Public Member Functions

 ft_text_renderer (const ft_text_renderer &)=delete
 
 ft_text_renderer (void)
 
 ~ft_text_renderer (void)=default
 
void fix_bbox_anchor (Matrix &bbox, int halign, int valign, int rot_mode, bool handle_rotation) const
 
Matrix get_boundingbox (void) const
 
Matrix get_extent (const std::string &txt, double rotation, const caseless_str &interpreter)
 
Matrix get_extent (text_element *elt, double rotation=0.0)
 
uint8NDArray get_pixels (void) const
 
octave_map get_system_fonts (void)
 
virtual bool ok (void)
 
ft_text_rendereroperator= (const ft_text_renderer &)=delete
 
uint8NDArray render (text_element *elt, Matrix &box, int rotation=ROTATION_0)
 
void reset (void)
 
void rotate_pixels (uint8NDArray &pixels, int rot_mode) const
 
int rotation_to_mode (double rotation) const
 
void set_anti_aliasing (bool val)
 
void set_color (const Matrix &c)
 
void set_font (const std::string &name, const std::string &weight, const std::string &angle, double size)
 
void set_mode (int m)
 
void text_to_pixels (const std::string &txt, uint8NDArray &pxls, Matrix &bbox, int halign, int valign, double rotation, const caseless_str &interpreter, bool handle_rotation)
 
void text_to_strlist (const std::string &txt, std::list< text_renderer::string > &lst, Matrix &bbox, int halign, int valign, double rotation, const caseless_str &interp)
 
void visit (text_element_color &e)
 
void visit (text_element_combined &e)
 
void visit (text_element_fontname &e)
 
void visit (text_element_fontsize &e)
 
void visit (text_element_fontstyle &e)
 
void visit (text_element_list &e)
 
void visit (text_element_string &e)
 
void visit (text_element_subscript &e)
 
void visit (text_element_superscript &e)
 
void visit (text_element_symbol &e)
 

Private Member Functions

void compute_bbox (void)
 
int compute_line_xoffset (const Matrix &lb) const
 
FT_UInt process_character (FT_ULong code, FT_UInt previous, std::string &sub_font)
 
void push_new_line (void)
 
void update_line_bbox (void)
 

Private Attributes

bool m_antialias
 
Matrix m_bbox
 
uint8NDArray m_color
 
FT_Pos m_deltax
 
bool m_do_strlist
 
ft_font m_font
 
int m_halign
 
std::list< Matrixm_line_bbox
 
int m_line_xoffset
 
int m_line_yoffset
 
double m_max_fontsize
 
int m_mode
 
uint8NDArray m_pixels
 
std::list< text_renderer::stringm_strlist
 
int m_xoffset
 
FT_Pos m_ymax
 
FT_Pos m_ymin
 
int m_yoffset
 

Detailed Description

Definition at line 457 of file ft-text-renderer.cc.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
inherited
Enumerator
ROTATION_0 
ROTATION_90 
ROTATION_180 
ROTATION_270 

Definition at line 48 of file base-text-renderer.h.

◆ anonymous enum

anonymous enum
Enumerator
MODE_BBOX 
MODE_RENDER 

Definition at line 463 of file ft-text-renderer.cc.

Constructor & Destructor Documentation

◆ ft_text_renderer() [1/2]

ft_text_renderer::ft_text_renderer ( void  )
inline

Definition at line 471 of file ft-text-renderer.cc.

Referenced by make_ft_text_renderer().

◆ ft_text_renderer() [2/2]

ft_text_renderer::ft_text_renderer ( const ft_text_renderer )
delete

◆ ~ft_text_renderer()

ft_text_renderer::~ft_text_renderer ( void  )
default

Member Function Documentation

◆ compute_bbox()

void ft_text_renderer::compute_bbox ( void  )
private

◆ compute_line_xoffset()

int ft_text_renderer::compute_line_xoffset ( const Matrix lb) const
private

Definition at line 711 of file ft-text-renderer.cc.

References Array< T, Alloc >::isempty(), m_bbox, and m_halign.

Referenced by push_new_line(), and set_mode().

◆ fix_bbox_anchor()

void base_text_renderer::fix_bbox_anchor ( Matrix bbox,
int  halign,
int  valign,
int  rot_mode,
bool  handle_rotation 
) const
inherited

◆ get_boundingbox()

Matrix ft_text_renderer::get_boundingbox ( void  ) const
inline

Definition at line 511 of file ft-text-renderer.cc.

◆ get_extent() [1/2]

Matrix ft_text_renderer::get_extent ( const std::string &  txt,
double  rotation,
const caseless_str interpreter 
)
virtual

Implements base_text_renderer.

Definition at line 1443 of file ft-text-renderer.cc.

References get_extent(), and text_parser::parse().

◆ get_extent() [2/2]

◆ get_pixels()

uint8NDArray ft_text_renderer::get_pixels ( void  ) const
inline

Definition at line 509 of file ft-text-renderer.cc.

◆ get_system_fonts()

octave_map ft_text_renderer::get_system_fonts ( void  )
virtual

Implements base_text_renderer.

Definition at line 663 of file ft-text-renderer.cc.

References ft_manager::get_system_fonts().

◆ ok()

virtual bool base_text_renderer::ok ( void  )
inlinevirtualinherited

◆ operator=()

ft_text_renderer& ft_text_renderer::operator= ( const ft_text_renderer )
delete

◆ process_character()

◆ push_new_line()

◆ render()

uint8NDArray ft_text_renderer::render ( text_element elt,
Matrix box,
int  rotation = ROTATION_0 
)

◆ reset()

void ft_text_renderer::reset ( void  )
virtual

Reimplemented from text_processor.

Definition at line 1371 of file ft-text-renderer.cc.

References m_strlist, MODE_BBOX, set_color(), and set_mode().

◆ rotate_pixels()

◆ rotation_to_mode()

int base_text_renderer::rotation_to_mode ( double  rotation) const
inherited

◆ set_anti_aliasing()

void ft_text_renderer::set_anti_aliasing ( bool  val)
inlinevirtual

Implements base_text_renderer.

Definition at line 520 of file ft-text-renderer.cc.

◆ set_color()

void ft_text_renderer::set_color ( const Matrix c)
virtual

Implements base_text_renderer.

Definition at line 1379 of file ft-text-renderer.cc.

References m_color, Array< T, Alloc >::numel(), and warning().

Referenced by reset(), and visit().

◆ set_font()

void ft_text_renderer::set_font ( const std::string &  name,
const std::string &  weight,
const std::string &  angle,
double  size 
)
virtual

Implements base_text_renderer.

Definition at line 654 of file ft-text-renderer.cc.

References m_font.

Referenced by visit().

◆ set_mode()

◆ text_to_pixels()

void ft_text_renderer::text_to_pixels ( const std::string &  txt,
uint8NDArray pxls,
Matrix bbox,
int  halign,
int  valign,
double  rotation,
const caseless_str interpreter,
bool  handle_rotation 
)
virtual

◆ text_to_strlist()

void ft_text_renderer::text_to_strlist ( const std::string &  txt,
std::list< text_renderer::string > &  lst,
Matrix bbox,
int  halign,
int  valign,
double  rotation,
const caseless_str interp 
)
virtual

Implements base_text_renderer.

Definition at line 1039 of file ft-text-renderer.cc.

References box(), m_do_strlist, m_strlist, and text_to_pixels().

◆ update_line_bbox()

void ft_text_renderer::update_line_bbox ( void  )
private

Definition at line 764 of file ft-text-renderer.cc.

References m_deltax, m_line_bbox, m_mode, m_ymax, m_ymin, and MODE_BBOX.

Referenced by process_character(), and visit().

◆ visit() [1/10]

void ft_text_renderer::visit ( text_element_color e)
virtual

Reimplemented from text_processor.

Definition at line 1251 of file ft-text-renderer.cc.

References text_element_color::get_color(), m_mode, MODE_RENDER, and set_color().

◆ visit() [2/10]

void ft_text_renderer::visit ( text_element_combined e)
virtual

Reimplemented from text_processor.

Definition at line 1355 of file ft-text-renderer.cc.

References m_xoffset, and max().

◆ visit() [3/10]

◆ visit() [4/10]

◆ visit() [5/10]

◆ visit() [6/10]

void ft_text_renderer::visit ( text_element_list e)
virtual

Reimplemented from text_processor.

Definition at line 1175 of file ft-text-renderer.cc.

References m_color, m_font, and text_processor::visit().

◆ visit() [7/10]

◆ visit() [8/10]

◆ visit() [9/10]

◆ visit() [10/10]

Member Data Documentation

◆ m_antialias

bool ft_text_renderer::m_antialias
private

Definition at line 649 of file ft-text-renderer.cc.

Referenced by process_character().

◆ m_bbox

Matrix ft_text_renderer::m_bbox
private

Definition at line 601 of file ft-text-renderer.cc.

Referenced by compute_bbox(), compute_line_xoffset(), get_extent(), render(), and set_mode().

◆ m_color

uint8NDArray ft_text_renderer::m_color
private

Definition at line 629 of file ft-text-renderer.cc.

Referenced by process_character(), set_color(), and visit().

◆ m_deltax

FT_Pos ft_text_renderer::m_deltax
private

Definition at line 643 of file ft-text-renderer.cc.

Referenced by process_character(), push_new_line(), and update_line_bbox().

◆ m_do_strlist

bool ft_text_renderer::m_do_strlist
private

Definition at line 632 of file ft-text-renderer.cc.

Referenced by text_to_strlist(), and visit().

◆ m_font

ft_font ft_text_renderer::m_font
private

Definition at line 594 of file ft-text-renderer.cc.

Referenced by process_character(), push_new_line(), set_font(), and visit().

◆ m_halign

int ft_text_renderer::m_halign
private

Definition at line 612 of file ft-text-renderer.cc.

Referenced by compute_line_xoffset(), and text_to_pixels().

◆ m_line_bbox

std::list<Matrix> ft_text_renderer::m_line_bbox
private

◆ m_line_xoffset

int ft_text_renderer::m_line_xoffset
private

Definition at line 636 of file ft-text-renderer.cc.

Referenced by push_new_line(), and visit().

◆ m_line_yoffset

int ft_text_renderer::m_line_yoffset
private

Definition at line 618 of file ft-text-renderer.cc.

Referenced by process_character(), push_new_line(), set_mode(), and visit().

◆ m_max_fontsize

double ft_text_renderer::m_max_fontsize
private

Definition at line 646 of file ft-text-renderer.cc.

Referenced by compute_bbox(), push_new_line(), set_mode(), and visit().

◆ m_mode

int ft_text_renderer::m_mode
private

◆ m_pixels

uint8NDArray ft_text_renderer::m_pixels
private

Definition at line 605 of file ft-text-renderer.cc.

Referenced by process_character(), render(), and set_mode().

◆ m_strlist

std::list<text_renderer::string> ft_text_renderer::m_strlist
private

Definition at line 633 of file ft-text-renderer.cc.

Referenced by reset(), text_to_strlist(), and visit().

◆ m_xoffset

int ft_text_renderer::m_xoffset
private

Definition at line 615 of file ft-text-renderer.cc.

Referenced by process_character(), push_new_line(), set_mode(), and visit().

◆ m_ymax

FT_Pos ft_text_renderer::m_ymax
private

Definition at line 640 of file ft-text-renderer.cc.

Referenced by process_character(), push_new_line(), and update_line_bbox().

◆ m_ymin

FT_Pos ft_text_renderer::m_ymin
private

Definition at line 639 of file ft-text-renderer.cc.

Referenced by process_character(), push_new_line(), and update_line_bbox().

◆ m_yoffset

int ft_text_renderer::m_yoffset
private

Definition at line 623 of file ft-text-renderer.cc.

Referenced by process_character(), push_new_line(), set_mode(), and visit().


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