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

Public Types

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

Public Member Functions

 latex_renderer (void)
 
 ~latex_renderer (void)
 
void fix_bbox_anchor (Matrix &bbox, int halign, int valign, int rot_mode, bool handle_rotation) const
 
Matrix get_extent (const std::string &txt, double rotation, const caseless_str &interpreter)
 
Matrix get_extent (text_element *, double)
 
octave_map get_system_fonts (void)
 
bool ok (void)
 
virtual void reset (void)
 
void rotate_pixels (uint8NDArray &pixels, int rot_mode) const
 
int rotation_to_mode (double rotation) const
 
void set_anti_aliasing (bool)
 
void set_color (const Matrix &c)
 
void set_font (const std::string &, const std::string &, const std::string &, double size)
 
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)
 
virtual void visit (text_element_color &)
 
virtual void visit (text_element_combined &)
 
virtual void visit (text_element_fontname &)
 
virtual void visit (text_element_fontsize &)
 
virtual void visit (text_element_fontstyle &)
 
virtual void visit (text_element_list &e)
 
virtual void visit (text_element_string &)
 
virtual void visit (text_element_subscript &e)
 
virtual void visit (text_element_superscript &e)
 
virtual void visit (text_element_symbol &)
 

Private Member Functions

std::string key (const std::string &txt, int halign)
 
bool read_image (const std::string &png_file, uint8NDArray &data) const
 
uint8NDArray render (const std::string &txt, int halign=0)
 
void warn_helper (std::string caller, std::string txt, std::string cmd, process_execution_result result)
 
std::string write_tex_file (const std::string &txt, int halign)
 

Private Attributes

uint8NDArray m_color
 
bool m_debug
 
std::string m_dvipng_binary
 
std::string m_dvisvg_binary
 
std::string m_fontname
 
double m_fontsize
 
std::string m_latex_binary
 
bool m_testing
 
std::string m_tmp_dir
 

Detailed Description

Definition at line 52 of file latex-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.

Constructor & Destructor Documentation

◆ latex_renderer()

latex_renderer::latex_renderer ( void  )
inline

Definition at line 59 of file latex-text-renderer.cc.

References quote_string().

◆ ~latex_renderer()

latex_renderer::~latex_renderer ( void  )
inline

Definition at line 80 of file latex-text-renderer.cc.

References recursive_rmdir().

Member Function Documentation

◆ 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_extent() [1/2]

Matrix latex_renderer::get_extent ( const std::string &  txt,
double  rotation,
const caseless_str interpreter 
)
inlinevirtual

Implements base_text_renderer.

Definition at line 107 of file latex-text-renderer.cc.

References Matrix::extract_n().

◆ get_extent() [2/2]

Matrix latex_renderer::get_extent ( text_element ,
double   
)
inlinevirtual

Implements base_text_renderer.

Definition at line 102 of file latex-text-renderer.cc.

References Matrix.

◆ get_system_fonts()

octave_map latex_renderer::get_system_fonts ( void  )
inlinevirtual

Implements base_text_renderer.

Definition at line 147 of file latex-text-renderer.cc.

◆ key()

std::string latex_renderer::key ( const std::string &  txt,
int  halign 
)
inlineprivate

Definition at line 153 of file latex-text-renderer.cc.

Referenced by render().

◆ ok()

bool latex_renderer::ok ( void  )
virtual

Reimplemented from base_text_renderer.

Definition at line 186 of file latex-text-renderer.cc.

References Array< T, Alloc >::isempty(), m_testing, render(), and warning_with_id().

Referenced by text_to_pixels().

◆ read_image()

bool latex_renderer::read_image ( const std::string &  png_file,
uint8NDArray data 
) const
private

◆ render()

◆ reset()

virtual void text_processor::reset ( void  )
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 363 of file text-engine.h.

◆ rotate_pixels()

◆ rotation_to_mode()

int base_text_renderer::rotation_to_mode ( double  rotation) const
inherited

◆ set_anti_aliasing()

void latex_renderer::set_anti_aliasing ( bool  )
inlinevirtual

Implements base_text_renderer.

Definition at line 145 of file latex-text-renderer.cc.

◆ set_color()

void latex_renderer::set_color ( const Matrix c)
inlinevirtual

Implements base_text_renderer.

Definition at line 92 of file latex-text-renderer.cc.

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

◆ set_font()

void latex_renderer::set_font ( const std::string &  ,
const std::string &  ,
const std::string &  ,
double  size 
)
inlinevirtual

Implements base_text_renderer.

Definition at line 86 of file latex-text-renderer.cc.

◆ text_to_pixels()

void latex_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 latex_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 
)
inlinevirtual

◆ visit() [1/10]

virtual void text_processor::visit ( text_element_color )
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 361 of file text-engine.h.

◆ visit() [2/10]

virtual void text_processor::visit ( text_element_combined )
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 353 of file text-engine.h.

◆ visit() [3/10]

virtual void text_processor::visit ( text_element_fontname )
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 357 of file text-engine.h.

◆ visit() [4/10]

virtual void text_processor::visit ( text_element_fontsize )
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 359 of file text-engine.h.

◆ visit() [5/10]

virtual void text_processor::visit ( text_element_fontstyle )
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 355 of file text-engine.h.

◆ visit() [6/10]

virtual void text_processor::visit ( text_element_list e)
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 339 of file text-engine.h.

◆ visit() [7/10]

virtual void text_processor::visit ( text_element_string )
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 335 of file text-engine.h.

Referenced by ft_text_renderer::visit().

◆ visit() [8/10]

virtual void text_processor::visit ( text_element_subscript e)
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 347 of file text-engine.h.

References text_element::accept(), and text_element_subscript::get_element().

◆ visit() [9/10]

virtual void text_processor::visit ( text_element_superscript e)
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 350 of file text-engine.h.

References text_element::accept(), and text_element_superscript::get_element().

◆ visit() [10/10]

virtual void text_processor::visit ( text_element_symbol )
inlinevirtualinherited

Reimplemented in ft_text_renderer.

Definition at line 337 of file text-engine.h.

◆ warn_helper()

void latex_renderer::warn_helper ( std::string  caller,
std::string  txt,
std::string  cmd,
process_execution_result  result 
)
private

◆ write_tex_file()

std::string latex_renderer::write_tex_file ( const std::string &  txt,
int  halign 
)
private

Member Data Documentation

◆ m_color

uint8NDArray latex_renderer::m_color
private

Definition at line 176 of file latex-text-renderer.cc.

Referenced by read_image().

◆ m_debug

bool latex_renderer::m_debug
private

Definition at line 180 of file latex-text-renderer.cc.

Referenced by render(), and warn_helper().

◆ m_dvipng_binary

std::string latex_renderer::m_dvipng_binary
private

Definition at line 178 of file latex-text-renderer.cc.

Referenced by render().

◆ m_dvisvg_binary

std::string latex_renderer::m_dvisvg_binary
private

Definition at line 179 of file latex-text-renderer.cc.

Referenced by render().

◆ m_fontname

std::string latex_renderer::m_fontname
private

Definition at line 174 of file latex-text-renderer.cc.

◆ m_fontsize

double latex_renderer::m_fontsize
private

Definition at line 173 of file latex-text-renderer.cc.

Referenced by render().

◆ m_latex_binary

std::string latex_renderer::m_latex_binary
private

Definition at line 177 of file latex-text-renderer.cc.

Referenced by render().

◆ m_testing

bool latex_renderer::m_testing
private

Definition at line 181 of file latex-text-renderer.cc.

Referenced by ok(), and warn_helper().

◆ m_tmp_dir

std::string latex_renderer::m_tmp_dir
private

Definition at line 175 of file latex-text-renderer.cc.

Referenced by render(), and write_tex_file().


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