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_renderer & | operator= (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< Matrix > | m_line_bbox |
int | m_line_xoffset |
int | m_line_yoffset |
double | m_max_fontsize |
int | m_mode |
uint8NDArray | m_pixels |
std::list< text_renderer::string > | m_strlist |
int | m_xoffset |
FT_Pos | m_ymax |
FT_Pos | m_ymin |
int | m_yoffset |
Definition at line 457 of file ft-text-renderer.cc.
|
inherited |
Enumerator | |
---|---|
ROTATION_0 | |
ROTATION_90 | |
ROTATION_180 | |
ROTATION_270 |
Definition at line 48 of file base-text-renderer.h.
anonymous enum |
Enumerator | |
---|---|
MODE_BBOX | |
MODE_RENDER |
Definition at line 463 of file ft-text-renderer.cc.
|
inline |
Definition at line 471 of file ft-text-renderer.cc.
Referenced by make_ft_text_renderer().
|
delete |
|
default |
|
private |
Definition at line 730 of file ft-text-renderer.cc.
References Matrix::extract(), Array< T, Alloc >::isempty(), m_bbox, m_line_bbox, m_max_fontsize, Matrix, max(), and round().
Referenced by get_extent(), and render().
|
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().
|
inherited |
Definition at line 109 of file base-text-renderer.cc.
References base_text_renderer::ROTATION_180, base_text_renderer::ROTATION_270, and base_text_renderer::ROTATION_90.
Referenced by text_to_pixels(), and latex_renderer::text_to_pixels().
|
inline |
Definition at line 511 of file ft-text-renderer.cc.
|
virtual |
Implements base_text_renderer.
Definition at line 1443 of file ft-text-renderer.cc.
References get_extent(), and text_parser::parse().
|
virtual |
Implements base_text_renderer.
Definition at line 1417 of file ft-text-renderer.cc.
References text_element::accept(), compute_bbox(), m_bbox, MODE_BBOX, base_text_renderer::ROTATION_0, base_text_renderer::ROTATION_180, base_text_renderer::ROTATION_270, base_text_renderer::ROTATION_90, base_text_renderer::rotation_to_mode(), and set_mode().
Referenced by get_extent().
|
inline |
Definition at line 509 of file ft-text-renderer.cc.
|
virtual |
Implements base_text_renderer.
Definition at line 663 of file ft-text-renderer.cc.
References ft_manager::get_system_fonts().
|
inlinevirtualinherited |
Reimplemented in latex_renderer.
Definition at line 81 of file base-text-renderer.h.
Referenced by text_renderer::get_extent(), text_renderer::text_to_pixels(), and text_renderer::text_to_strlist().
|
delete |
|
private |
Definition at line 835 of file ft-text-renderer.cc.
References Array< T, Alloc >::dim2(), Array< T, Alloc >::dim3(), floor(), text_renderer::font::get_angle(), ft_text_renderer::ft_font::get_face(), ft_manager::get_font(), text_renderer::font::get_name(), text_renderer::font::get_size(), text_renderer::font::get_weight(), is_opaque(), m_antialias, m_color, m_deltax, m_font, m_line_bbox, m_line_yoffset, m_mode, m_pixels, m_xoffset, m_ymax, m_ymin, m_yoffset, max(), min(), MODE_BBOX, MODE_RENDER, push_new_line(), r, update_line_bbox(), warn_glyph_render(), warn_missing_glyph(), and warning_with_id().
Referenced by visit().
|
private |
Definition at line 669 of file ft-text-renderer.cc.
References compute_line_xoffset(), ft_text_renderer::ft_font::get_face(), m_deltax, m_font, m_line_bbox, m_line_xoffset, m_line_yoffset, m_max_fontsize, m_mode, m_xoffset, m_ymax, m_ymin, m_yoffset, MODE_BBOX, MODE_RENDER, and round().
Referenced by process_character(), and set_mode().
uint8NDArray ft_text_renderer::render | ( | text_element * | elt, |
Matrix & | box, | ||
int | rotation = ROTATION_0 |
||
) |
Definition at line 1392 of file ft-text-renderer.cc.
References text_element::accept(), box(), compute_bbox(), m_bbox, m_pixels, MODE_BBOX, MODE_RENDER, Array< T, Alloc >::numel(), base_text_renderer::rotate_pixels(), and set_mode().
Referenced by text_to_pixels().
|
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().
|
inherited |
Definition at line 35 of file base-text-renderer.cc.
References Array< T, Alloc >::dim2(), Array< T, Alloc >::dim3(), Array< T, Alloc >::index(), MArray< T >::permute(), base_text_renderer::ROTATION_0, base_text_renderer::ROTATION_180, base_text_renderer::ROTATION_270, and base_text_renderer::ROTATION_90.
Referenced by render(), and latex_renderer::text_to_pixels().
|
inherited |
Definition at line 88 of file base-text-renderer.cc.
References base_text_renderer::ROTATION_0, base_text_renderer::ROTATION_180, base_text_renderer::ROTATION_270, and base_text_renderer::ROTATION_90.
Referenced by get_extent(), text_to_pixels(), and latex_renderer::text_to_pixels().
|
inlinevirtual |
Implements base_text_renderer.
Definition at line 520 of file ft-text-renderer.cc.
|
virtual |
Implements base_text_renderer.
Definition at line 1379 of file ft-text-renderer.cc.
References m_color, Array< T, Alloc >::numel(), and warning().
|
virtual |
Implements base_text_renderer.
Definition at line 654 of file ft-text-renderer.cc.
References m_font.
Referenced by visit().
void ft_text_renderer::set_mode | ( | int | m | ) |
Definition at line 784 of file ft-text-renderer.cc.
References compute_line_xoffset(), d, error(), m, m_bbox, m_line_bbox, m_line_yoffset, m_max_fontsize, m_mode, m_pixels, m_xoffset, m_yoffset, Matrix, MODE_BBOX, MODE_RENDER, Array< T, Alloc >::numel(), and push_new_line().
Referenced by get_extent(), render(), and reset().
|
virtual |
Implements base_text_renderer.
Definition at line 1454 of file ft-text-renderer.cc.
References box(), base_text_renderer::fix_bbox_anchor(), Array< T, Alloc >::isempty(), m_halign, text_parser::parse(), render(), and base_text_renderer::rotation_to_mode().
Referenced by text_to_strlist().
|
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().
|
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().
|
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().
|
virtual |
Reimplemented from text_processor.
Definition at line 1355 of file ft-text-renderer.cc.
|
virtual |
Reimplemented from text_processor.
Definition at line 1273 of file ft-text-renderer.cc.
References text_renderer::font::get_angle(), text_element_fontname::get_fontname(), text_renderer::font::get_size(), text_renderer::font::get_weight(), m_font, m_mode, MODE_BBOX, set_font(), and update_line_bbox().
|
virtual |
Reimplemented from text_processor.
Definition at line 1258 of file ft-text-renderer.cc.
References text_renderer::font::get_angle(), text_element_fontsize::get_fontsize(), text_renderer::font::get_name(), text_renderer::font::get_weight(), m_font, m_mode, MODE_BBOX, set_font(), and update_line_bbox().
|
virtual |
Reimplemented from text_processor.
Definition at line 1283 of file ft-text-renderer.cc.
References text_element_fontstyle::bold, text_element_fontstyle::get_fontstyle(), text_renderer::font::get_name(), text_renderer::font::get_size(), text_element_fontstyle::italic, m_font, m_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 1175 of file ft-text-renderer.cc.
References m_color, m_font, and text_processor::visit().
|
virtual |
Reimplemented from text_processor.
Definition at line 1063 of file ft-text-renderer.cc.
References ft_text_renderer::ft_font::get_face(), text_renderer::string::get_family(), text_renderer::font::get_size(), text_renderer::string::get_string(), ft_text_renderer::ft_font::is_valid(), m_color, m_do_strlist, m_font, m_line_xoffset, m_line_yoffset, m_max_fontsize, m_mode, m_strlist, m_xoffset, m_yoffset, max(), MODE_RENDER, n, octave_u8_strmbtouc_wrapper(), process_character(), text_renderer::string::set_color(), text_renderer::string::set_family(), text_renderer::string::set_string(), text_renderer::string::set_xdata(), text_renderer::string::set_y(), and text_element_string::string_value().
|
virtual |
Reimplemented from text_processor.
Definition at line 1189 of file ft-text-renderer.cc.
References ceil(), text_renderer::font::get_angle(), text_renderer::font::get_name(), text_renderer::font::get_size(), text_renderer::font::get_weight(), ft_text_renderer::ft_font::is_valid(), m_font, m_line_yoffset, m_mode, m_yoffset, max(), MODE_BBOX, set_font(), update_line_bbox(), and text_processor::visit().
|
virtual |
Reimplemented from text_processor.
Definition at line 1220 of file ft-text-renderer.cc.
References ceil(), text_renderer::font::get_angle(), text_renderer::font::get_name(), text_renderer::font::get_size(), text_renderer::font::get_weight(), ft_text_renderer::ft_font::is_valid(), m_font, m_line_yoffset, m_mode, m_yoffset, max(), MODE_BBOX, set_font(), update_line_bbox(), and text_processor::visit().
|
virtual |
Reimplemented from text_processor.
Definition at line 1309 of file ft-text-renderer.cc.
References text_renderer::string::get_code(), ft_text_renderer::ft_font::get_face(), text_renderer::string::get_family(), text_element_symbol::get_symbol(), text_element_symbol::get_symbol_code(), text_element_symbol::invalid_code, ft_text_renderer::ft_font::is_valid(), m_color, m_do_strlist, m_font, m_line_yoffset, m_mode, m_strlist, m_xoffset, m_yoffset, MODE_RENDER, process_character(), text_renderer::string::set_code(), text_renderer::string::set_color(), text_renderer::string::set_family(), text_renderer::string::set_xdata(), text_renderer::string::set_y(), and warning().
|
private |
Definition at line 649 of file ft-text-renderer.cc.
Referenced by process_character().
|
private |
Definition at line 601 of file ft-text-renderer.cc.
Referenced by compute_bbox(), compute_line_xoffset(), get_extent(), render(), and set_mode().
|
private |
Definition at line 629 of file ft-text-renderer.cc.
Referenced by process_character(), set_color(), and visit().
|
private |
Definition at line 643 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), and update_line_bbox().
|
private |
Definition at line 632 of file ft-text-renderer.cc.
Referenced by text_to_strlist(), and visit().
|
private |
Definition at line 594 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), set_font(), and visit().
|
private |
Definition at line 612 of file ft-text-renderer.cc.
Referenced by compute_line_xoffset(), and text_to_pixels().
|
private |
Definition at line 609 of file ft-text-renderer.cc.
Referenced by compute_bbox(), process_character(), push_new_line(), set_mode(), and update_line_bbox().
|
private |
Definition at line 636 of file ft-text-renderer.cc.
Referenced by push_new_line(), and visit().
|
private |
Definition at line 618 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), set_mode(), and visit().
|
private |
Definition at line 646 of file ft-text-renderer.cc.
Referenced by compute_bbox(), push_new_line(), set_mode(), and visit().
|
private |
Definition at line 626 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), set_mode(), update_line_bbox(), and visit().
|
private |
Definition at line 605 of file ft-text-renderer.cc.
Referenced by process_character(), render(), and set_mode().
|
private |
Definition at line 633 of file ft-text-renderer.cc.
Referenced by reset(), text_to_strlist(), and visit().
|
private |
Definition at line 615 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), set_mode(), and visit().
|
private |
Definition at line 640 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), and update_line_bbox().
|
private |
Definition at line 639 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), and update_line_bbox().
|
private |
Definition at line 623 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), set_mode(), and visit().