GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ft_render Class Reference

#include "txt-eng-ft.h"

Inheritance diagram for ft_render:
Inheritance graph
[legend]
Collaboration diagram for ft_render:
Collaboration graph
[legend]

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_render (void)
 
 ~ft_render (void)
 
Matrix get_boundingbox (void) const
 
Matrix get_extent (text_element *elt, double rotation=0.0)
 
Matrix get_extent (const std::string &txt, double rotation=0.0, const caseless_str &interpreter="tex")
 
uint8NDArray get_pixels (void) const
 
uint8NDArray render (text_element *elt, Matrix &box, int rotation=ROTATION_0)
 
void reset (void)
 
void set_color (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 &pixels_, Matrix &bbox, int halign, int valign, double rotation, const caseless_str &interpreter="tex")
 
void visit (text_element_string &e)
 
void visit (text_element_list &e)
 
void visit (text_element_subscript &e)
 
void visit (text_element_superscript &e)
 
void visit (text_element_color &e)
 
void visit (text_element_fontsize &e)
 
void visit (text_element_fontname &e)
 
void visit (text_element_fontstyle &e)
 
void visit (text_element_symbol &e)
 
void visit (text_element_combined &e)
 

Private Member Functions

 ft_render (const ft_render &)
 
void compute_bbox (void)
 
int compute_line_xoffset (const Matrix &lb) const
 
ft_renderoperator= (const ft_render &)
 
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_yoffset
 
int mode
 
uint8NDArray pixels
 
int xoffset
 
int yoffset
 

Detailed Description

Definition at line 38 of file txt-eng-ft.h.

Member Enumeration Documentation

anonymous enum
Enumerator
MODE_BBOX 
MODE_RENDER 

Definition at line 43 of file txt-eng-ft.h.

anonymous enum
Enumerator
ROTATION_0 
ROTATION_90 
ROTATION_180 
ROTATION_270 

Definition at line 49 of file txt-eng-ft.h.

Constructor & Destructor Documentation

ft_render::ft_render ( void  )

Definition at line 310 of file txt-eng-ft.cc.

ft_render::~ft_render ( void  )

Definition at line 317 of file txt-eng-ft.cc.

ft_render::ft_render ( const ft_render )
private

Member Function Documentation

void ft_render::compute_bbox ( void  )
private

Definition at line 397 of file txt-eng-ft.cc.

References bbox, Matrix::extract(), Array< T >::is_empty(), line_bbox, and xmax().

Referenced by get_extent(), and render().

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

Definition at line 378 of file txt-eng-ft.cc.

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

Referenced by push_new_line(), and set_mode().

Matrix ft_render::get_boundingbox ( void  ) const
inline

Definition at line 86 of file txt-eng-ft.h.

Matrix ft_render::get_extent ( text_element elt,
double  rotation = 0.0 
)
Matrix ft_render::get_extent ( const std::string &  txt,
double  rotation = 0.0,
const caseless_str interpreter = "tex" 
)

Definition at line 944 of file txt-eng-ft.cc.

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

uint8NDArray ft_render::get_pixels ( void  ) const
inline

Definition at line 84 of file txt-eng-ft.h.

ft_render& ft_render::operator= ( const ft_render )
private
FT_UInt ft_render::process_character ( FT_ULong  code,
FT_UInt  previous = 0 
)
private
void ft_render::push_new_line ( void  )
private
uint8NDArray ft_render::render ( text_element elt,
Matrix box,
int  rotation = ROTATION_0 
)
void ft_render::reset ( void  )
virtual

Reimplemented from text_processor.

Definition at line 832 of file txt-eng-ft.cc.

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

int ft_render::rotation_to_mode ( double  rotation) const
private

Definition at line 955 of file txt-eng-ft.cc.

References ROTATION_0, ROTATION_180, ROTATION_270, and ROTATION_90.

Referenced by get_extent(), and text_to_pixels().

void ft_render::set_color ( Matrix  c)

Definition at line 839 of file txt-eng-ft.cc.

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

Referenced by reset(), and visit().

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

Definition at line 322 of file txt-eng-ft.cc.

References font.

Referenced by uicontrol::properties::update_text_extent(), and visit().

void ft_render::set_mode ( int  m)
void ft_render::text_to_pixels ( const std::string &  txt,
uint8NDArray pixels_,
Matrix bbox,
int  halign,
int  valign,
double  rotation,
const caseless_str interpreter = "tex" 
)
void ft_render::update_line_bbox ( void  )
private

Definition at line 429 of file txt-eng-ft.cc.

References font, ft_render::ft_font::get_face(), line_bbox, mode, MODE_BBOX, and yoffset.

Referenced by visit().

void ft_render::visit ( text_element_string e)
virtual
void ft_render::visit ( text_element_list e)
virtual

Reimplemented from text_processor.

Definition at line 675 of file txt-eng-ft.cc.

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

void ft_render::visit ( text_element_subscript e)
virtual
void ft_render::visit ( text_element_superscript e)
virtual
void ft_render::visit ( text_element_color e)
virtual

Reimplemented from text_processor.

Definition at line 751 of file txt-eng-ft.cc.

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

void ft_render::visit ( text_element_fontsize e)
virtual
void ft_render::visit ( text_element_fontname e)
virtual
void ft_render::visit ( text_element_fontstyle e)
virtual
void ft_render::visit ( text_element_symbol e)
virtual
void ft_render::visit ( text_element_combined e)
virtual

Member Data Documentation

Matrix ft_render::bbox
private

Definition at line 177 of file txt-eng-ft.h.

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

uint8NDArray ft_render::color
private

Definition at line 205 of file txt-eng-ft.h.

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

ft_font ft_render::font
private

Definition at line 170 of file txt-eng-ft.h.

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

int ft_render::halign
private

Definition at line 188 of file txt-eng-ft.h.

Referenced by compute_line_xoffset(), and text_to_pixels().

std::list<Matrix> ft_render::line_bbox
private
int ft_render::line_yoffset
private

Definition at line 194 of file txt-eng-ft.h.

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

int ft_render::mode
private

Definition at line 202 of file txt-eng-ft.h.

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

uint8NDArray ft_render::pixels
private

Definition at line 181 of file txt-eng-ft.h.

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

int ft_render::xoffset
private

Definition at line 191 of file txt-eng-ft.h.

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

int ft_render::yoffset
private

Definition at line 199 of file txt-eng-ft.h.

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


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