GNU Octave
3.8.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
|
#include "txt-eng-ft.h"
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 } |
Private Member Functions | |
ft_render (const ft_render &) | |
void | compute_bbox (void) |
int | compute_line_xoffset (const Matrix &lb) const |
ft_render & | operator= (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< Matrix > | line_bbox |
int | line_yoffset |
int | mode |
uint8NDArray | pixels |
int | xoffset |
int | yoffset |
Definition at line 38 of file txt-eng-ft.h.
anonymous enum |
Definition at line 43 of file txt-eng-ft.h.
anonymous enum |
Definition at line 49 of file txt-eng-ft.h.
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.
|
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().
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().
Definition at line 86 of file txt-eng-ft.h.
Matrix ft_render::get_extent | ( | text_element * | elt, |
double | rotation = 0.0 |
||
) |
Definition at line 918 of file txt-eng-ft.cc.
References text_element::accept(), bbox, compute_bbox(), MODE_BBOX, ROTATION_0, ROTATION_180, ROTATION_270, ROTATION_90, rotation_to_mode(), and set_mode().
Referenced by get_extent(), and uicontrol::properties::update_text_extent().
Matrix ft_render::get_extent | ( | const std::string & | txt, |
double | rotation = 0.0 , |
||
const caseless_str & | interpreter = "tex" |
||
) |
Definition at line 943 of file txt-eng-ft.cc.
References get_extent(), and text_parser::parse().
|
inline |
Definition at line 84 of file txt-eng-ft.h.
|
private |
Definition at line 501 of file txt-eng-ft.cc.
References color, Array< T >::dim2(), Array< T >::dim3(), font, ft_render::ft_font::get_face(), gripe_glyph_render(), gripe_missing_glyph(), line_bbox, line_yoffset, mode, MODE_BBOX, MODE_RENDER, pixels, push_new_line(), xmax(), xoffset, and yoffset.
Referenced by visit().
Definition at line 331 of file txt-eng-ft.cc.
References compute_line_xoffset(), font, ft_render::ft_font::get_face(), line_bbox, line_yoffset, mode, MODE_BBOX, MODE_RENDER, xoffset, and yoffset.
Referenced by process_character(), and set_mode().
uint8NDArray ft_render::render | ( | text_element * | elt, |
Matrix & | box, | ||
int | rotation = ROTATION_0 |
||
) |
Definition at line 851 of file txt-eng-ft.cc.
References text_element::accept(), bbox, compute_bbox(), Array< T >::dim2(), Array< T >::dim3(), Array< T >::index(), idx_vector::index(), MODE_BBOX, MODE_RENDER, Array< T >::numel(), MArray< T >::permute(), pixels, ROTATION_0, ROTATION_180, ROTATION_270, ROTATION_90, and set_mode().
Referenced by text_to_pixels().
Reimplemented from text_processor.
Definition at line 831 of file txt-eng-ft.cc.
References MODE_BBOX, set_color(), and set_mode().
Definition at line 954 of file txt-eng-ft.cc.
References ROTATION_0, ROTATION_180, ROTATION_270, and ROTATION_90.
Referenced by get_extent(), and text_to_pixels().
Definition at line 838 of file txt-eng-ft.cc.
References color, Array< T >::numel(), and warning().
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().
Definition at line 465 of file txt-eng-ft.cc.
References bbox, compute_line_xoffset(), error(), line_bbox, line_yoffset, mode, MODE_BBOX, MODE_RENDER, Array< T >::numel(), pixels, push_new_line(), warning(), xoffset, and yoffset.
Referenced by get_extent(), render(), and reset().
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" |
||
) |
Definition at line 975 of file txt-eng-ft.cc.
References box(), halign, Array< T >::numel(), text_parser::parse(), render(), ROTATION_180, ROTATION_270, ROTATION_90, and rotation_to_mode().
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().
|
virtual |
Implements text_processor.
Definition at line 631 of file txt-eng-ft.cc.
References font, ft_render::ft_font::is_valid(), process_character(), text_element_string::string_value(), and warning().
Referenced by visit().
|
virtual |
Reimplemented from text_processor.
Definition at line 674 of file txt-eng-ft.cc.
|
virtual |
Reimplemented from text_processor.
Definition at line 688 of file txt-eng-ft.cc.
References font, ft_render::ft_font::get_angle(), ft_render::ft_font::get_face(), ft_render::ft_font::get_name(), ft_render::ft_font::get_size(), ft_render::ft_font::get_weight(), ft_render::ft_font::is_valid(), line_yoffset, mode, MODE_BBOX, set_font(), update_line_bbox(), visit(), and yoffset.
|
virtual |
Reimplemented from text_processor.
Definition at line 719 of file txt-eng-ft.cc.
References font, ft_render::ft_font::get_angle(), ft_render::ft_font::get_face(), ft_render::ft_font::get_name(), ft_render::ft_font::get_size(), ft_render::ft_font::get_weight(), ft_render::ft_font::is_valid(), line_yoffset, mode, MODE_BBOX, set_font(), update_line_bbox(), visit(), and yoffset.
|
virtual |
Reimplemented from text_processor.
Definition at line 750 of file txt-eng-ft.cc.
References text_element_color::get_color(), mode, MODE_RENDER, and set_color().
|
virtual |
Reimplemented from text_processor.
Definition at line 757 of file txt-eng-ft.cc.
References font, ft_render::ft_font::get_angle(), text_element_fontsize::get_fontsize(), ft_render::ft_font::get_name(), ft_render::ft_font::get_weight(), mode, MODE_BBOX, set_font(), and update_line_bbox().
|
virtual |
Reimplemented from text_processor.
Definition at line 771 of file txt-eng-ft.cc.
References font, ft_render::ft_font::get_angle(), text_element_fontname::get_fontname(), ft_render::ft_font::get_size(), ft_render::ft_font::get_weight(), mode, MODE_BBOX, set_font(), and update_line_bbox().
|
virtual |
Reimplemented from text_processor.
Definition at line 781 of file txt-eng-ft.cc.
References text_element_fontstyle::bold, font, text_element_fontstyle::get_fontstyle(), ft_render::ft_font::get_name(), ft_render::ft_font::get_size(), text_element_fontstyle::italic, mode, MODE_BBOX, text_element_fontstyle::normal, text_element_fontstyle::oblique, set_font(), and update_line_bbox().
|
virtual |
Reimplemented from text_processor.
Definition at line 804 of file txt-eng-ft.cc.
References font, text_element_symbol::get_symbol(), text_element_symbol::get_symbol_code(), text_element_symbol::invalid_code, ft_render::ft_font::is_valid(), process_character(), and warning().
|
virtual |
Reimplemented from text_processor.
Definition at line 815 of file txt-eng-ft.cc.
References octave_base_list< elt_type >::begin(), octave_base_list< elt_type >::end(), xmax(), and xoffset.
|
private |
Definition at line 177 of file txt-eng-ft.h.
Referenced by compute_bbox(), compute_line_xoffset(), get_extent(), render(), and set_mode().
|
private |
Definition at line 205 of file txt-eng-ft.h.
Referenced by process_character(), set_color(), and visit().
|
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().
|
private |
Definition at line 188 of file txt-eng-ft.h.
Referenced by compute_line_xoffset(), and text_to_pixels().
|
private |
Definition at line 185 of file txt-eng-ft.h.
Referenced by compute_bbox(), process_character(), push_new_line(), set_mode(), and update_line_bbox().
|
private |
Definition at line 194 of file txt-eng-ft.h.
Referenced by process_character(), push_new_line(), set_mode(), and visit().
|
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().
|
private |
Definition at line 181 of file txt-eng-ft.h.
Referenced by process_character(), render(), and set_mode().
|
private |
Definition at line 191 of file txt-eng-ft.h.
Referenced by process_character(), push_new_line(), set_mode(), and visit().
|
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().