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

Classes

class  ft_font
 

Public Types

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

Public Member Functions

 ft_text_renderer (const ft_text_renderer &)=delete
 
 ft_text_renderer (void)
 
 ~ft_text_renderer (void)=default
 
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)
 
ft_text_rendereroperator= (const ft_text_renderer &)=delete
 
uint8NDArray render (text_element *elt, Matrix &box, int rotation=ROTATION_0)
 
void reset (void)
 
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=0)
 
void push_new_line (void)
 
int rotation_to_mode (double rotation) const
 
void update_line_bbox (void)
 

Private Attributes

Matrix bbox
 
uint8NDArray color
 
ft_font font
 
int halign
 
std::list< Matrixline_bbox
 
int line_xoffset
 
int line_yoffset
 
bool m_antialias
 
FT_Pos m_deltax
 
bool m_do_strlist
 
double m_max_fontsize
 
std::list< text_renderer::stringm_strlist
 
FT_Pos m_ymax
 
FT_Pos m_ymin
 
int mode
 
uint8NDArray pixels
 
int xoffset
 
int yoffset
 

Detailed Description

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

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
MODE_BBOX 
MODE_RENDER 

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

◆ anonymous enum

anonymous enum
Enumerator
ROTATION_0 
ROTATION_90 
ROTATION_180 
ROTATION_270 

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

Constructor & Destructor Documentation

◆ ft_text_renderer() [1/2]

octave::ft_text_renderer::ft_text_renderer ( void  )
inline

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

◆ ft_text_renderer() [2/2]

octave::ft_text_renderer::ft_text_renderer ( const ft_text_renderer )
delete

◆ ~ft_text_renderer()

octave::ft_text_renderer::~ft_text_renderer ( void  )
default

Member Function Documentation

◆ compute_bbox()

void octave::ft_text_renderer::compute_bbox ( void  )
private

◆ compute_line_xoffset()

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

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

References bbox, halign, and Array< T >::isempty().

Referenced by push_new_line(), and set_mode().

◆ get_boundingbox()

Matrix octave::ft_text_renderer::get_boundingbox ( void  ) const
inline

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

◆ get_extent() [1/2]

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

Implements octave::base_text_renderer.

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

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

◆ get_extent() [2/2]

Matrix octave::ft_text_renderer::get_extent ( text_element elt,
double  rotation = 0.0 
)
virtual

◆ get_pixels()

uint8NDArray octave::ft_text_renderer::get_pixels ( void  ) const
inline

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

◆ get_system_fonts()

octave_map octave::ft_text_renderer::get_system_fonts ( void  )
virtual

◆ operator=()

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

◆ process_character()

◆ push_new_line()

◆ render()

◆ reset()

void octave::ft_text_renderer::reset ( void  )
virtual

Reimplemented from octave::text_processor.

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

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

◆ rotation_to_mode()

int octave::ft_text_renderer::rotation_to_mode ( double  rotation) const
private

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

References ROTATION_0, ROTATION_180, ROTATION_270, and ROTATION_90.

Referenced by get_extent(), and text_to_pixels().

◆ set_anti_aliasing()

void octave::ft_text_renderer::set_anti_aliasing ( bool  val)
inlinevirtual

Implements octave::base_text_renderer.

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

◆ set_color()

void octave::ft_text_renderer::set_color ( const Matrix c)
virtual

Implements octave::base_text_renderer.

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

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

Referenced by reset(), and visit().

◆ set_font()

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

Implements octave::base_text_renderer.

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

References font, and name.

Referenced by visit().

◆ set_mode()

void octave::ft_text_renderer::set_mode ( int  m)

◆ text_to_pixels()

void octave::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 octave::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

◆ update_line_bbox()

void octave::ft_text_renderer::update_line_bbox ( void  )
private

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

References line_bbox, m_deltax, m_ymax, m_ymin, mode, and MODE_BBOX.

Referenced by process_character(), and visit().

◆ visit() [1/10]

void octave::ft_text_renderer::visit ( text_element_color e)
virtual

Reimplemented from octave::text_processor.

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

References octave::text_element_color::get_color(), mode, MODE_RENDER, and set_color().

◆ visit() [2/10]

void octave::ft_text_renderer::visit ( text_element_combined e)
virtual

Reimplemented from octave::text_processor.

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

References octave::math::max(), and xoffset.

◆ visit() [3/10]

◆ visit() [4/10]

◆ visit() [5/10]

◆ visit() [6/10]

void octave::ft_text_renderer::visit ( text_element_list e)
virtual

Reimplemented from octave::text_processor.

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

References color, font, and octave::text_processor::visit().

◆ visit() [7/10]

◆ visit() [8/10]

◆ visit() [9/10]

◆ visit() [10/10]

Member Data Documentation

◆ bbox

Matrix octave::ft_text_renderer::bbox
private

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

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

◆ color

uint8NDArray octave::ft_text_renderer::color
private

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

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

◆ font

ft_font octave::ft_text_renderer::font
private

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

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

◆ halign

int octave::ft_text_renderer::halign
private

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

Referenced by compute_line_xoffset(), and text_to_pixels().

◆ line_bbox

std::list<Matrix> octave::ft_text_renderer::line_bbox
private

◆ line_xoffset

int octave::ft_text_renderer::line_xoffset
private

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

Referenced by push_new_line(), and visit().

◆ line_yoffset

int octave::ft_text_renderer::line_yoffset
private

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

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

◆ m_antialias

bool octave::ft_text_renderer::m_antialias
private

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

Referenced by process_character().

◆ m_deltax

FT_Pos octave::ft_text_renderer::m_deltax
private

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

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

◆ m_do_strlist

bool octave::ft_text_renderer::m_do_strlist
private

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

Referenced by text_to_strlist(), and visit().

◆ m_max_fontsize

double octave::ft_text_renderer::m_max_fontsize
private

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

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

◆ m_strlist

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

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

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

◆ m_ymax

FT_Pos octave::ft_text_renderer::m_ymax
private

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

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

◆ m_ymin

FT_Pos octave::ft_text_renderer::m_ymin
private

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

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

◆ mode

int octave::ft_text_renderer::mode
private

◆ pixels

uint8NDArray octave::ft_text_renderer::pixels
private

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

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

◆ xoffset

int octave::ft_text_renderer::xoffset
private

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

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

◆ yoffset

int octave::ft_text_renderer::yoffset
private

Definition at line 614 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: