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_renderer & | operator= (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< Matrix > | line_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::string > | m_strlist |
FT_Pos | m_ymax |
FT_Pos | m_ymin |
int | mode |
uint8NDArray | pixels |
int | xoffset |
int | yoffset |
Definition at line 439 of file ft-text-renderer.cc.
anonymous enum |
Enumerator | |
---|---|
MODE_BBOX | |
MODE_RENDER |
Definition at line 445 of file ft-text-renderer.cc.
anonymous enum |
Enumerator | |
---|---|
ROTATION_0 | |
ROTATION_90 | |
ROTATION_180 | |
ROTATION_270 |
Definition at line 451 of file ft-text-renderer.cc.
|
inline |
Definition at line 461 of file ft-text-renderer.cc.
|
delete |
|
default |
|
private |
Definition at line 721 of file ft-text-renderer.cc.
References bbox, Matrix::extract(), Array< T >::isempty(), line_bbox, m_max_fontsize, octave::math::max(), and octave::math::round().
Referenced by get_extent(), and render().
|
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().
|
inline |
Definition at line 501 of file ft-text-renderer.cc.
|
virtual |
Implements octave::base_text_renderer.
Definition at line 1380 of file ft-text-renderer.cc.
References get_extent(), and octave::text_parser::parse().
|
virtual |
Implements octave::base_text_renderer.
Definition at line 1354 of file ft-text-renderer.cc.
References octave::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().
|
inline |
Definition at line 499 of file ft-text-renderer.cc.
|
virtual |
Implements octave::base_text_renderer.
Definition at line 654 of file ft-text-renderer.cc.
References octave::ft_manager::get_system_fonts().
|
delete |
|
private |
Definition at line 825 of file ft-text-renderer.cc.
References color, Array< T >::dim2(), Array< T >::dim3(), octave::math::floor(), font, octave::ft_text_renderer::ft_font::get_face(), octave::is_opaque(), line_bbox, line_yoffset, m_antialias, m_deltax, m_ymax, m_ymin, octave::math::max(), octave::math::min(), mode, MODE_BBOX, MODE_RENDER, pixels, push_new_line(), r, update_line_bbox(), octave::warn_glyph_render(), octave::warn_missing_glyph(), xoffset, and yoffset.
Referenced by visit().
|
private |
Definition at line 660 of file ft-text-renderer.cc.
References compute_line_xoffset(), font, octave::ft_text_renderer::ft_font::get_face(), line_bbox, line_xoffset, line_yoffset, m_deltax, m_max_fontsize, m_ymax, m_ymin, mode, MODE_BBOX, MODE_RENDER, octave::math::round(), xoffset, and yoffset.
Referenced by process_character(), and set_mode().
uint8NDArray octave::ft_text_renderer::render | ( | text_element * | elt, |
Matrix & | box, | ||
int | rotation = ROTATION_0 |
||
) |
Definition at line 1283 of file ft-text-renderer.cc.
References octave::text_element::accept(), bbox, box(), compute_bbox(), Array< T >::dim2(), Array< T >::dim3(), Array< T >::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().
|
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().
|
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().
|
inlinevirtual |
Implements octave::base_text_renderer.
Definition at line 510 of file ft-text-renderer.cc.
|
virtual |
Implements octave::base_text_renderer.
Definition at line 1270 of file ft-text-renderer.cc.
References color, Array< T >::numel(), and warning().
|
virtual |
Implements octave::base_text_renderer.
Definition at line 645 of file ft-text-renderer.cc.
Referenced by visit().
void octave::ft_text_renderer::set_mode | ( | int | m | ) |
Definition at line 775 of file ft-text-renderer.cc.
References bbox, compute_line_xoffset(), d, error(), line_bbox, line_yoffset, m, m_max_fontsize, mode, MODE_BBOX, MODE_RENDER, Array< T >::numel(), pixels, push_new_line(), xoffset, and yoffset.
Referenced by get_extent(), render(), and reset().
|
virtual |
Implements octave::base_text_renderer.
Definition at line 1412 of file ft-text-renderer.cc.
References box(), halign, Array< T >::isempty(), octave::text_parser::parse(), render(), ROTATION_180, ROTATION_270, ROTATION_90, and rotation_to_mode().
Referenced by text_to_strlist().
|
virtual |
Implements octave::base_text_renderer.
Definition at line 971 of file ft-text-renderer.cc.
References box(), m_do_strlist, m_strlist, octave::action_container::protect_var(), and text_to_pixels().
|
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().
|
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().
|
virtual |
Reimplemented from octave::text_processor.
Definition at line 1246 of file ft-text-renderer.cc.
References octave::math::max(), and xoffset.
|
virtual |
Reimplemented from octave::text_processor.
Definition at line 1181 of file ft-text-renderer.cc.
References font, octave::text_renderer::font::get_angle(), octave::text_element_fontname::get_fontname(), octave::text_renderer::font::get_size(), octave::text_renderer::font::get_weight(), mode, MODE_BBOX, set_font(), and update_line_bbox().
|
virtual |
Reimplemented from octave::text_processor.
Definition at line 1167 of file ft-text-renderer.cc.
References font, octave::text_renderer::font::get_angle(), octave::text_element_fontsize::get_fontsize(), octave::text_renderer::font::get_name(), octave::text_renderer::font::get_weight(), mode, MODE_BBOX, set_font(), and update_line_bbox().
|
virtual |
Reimplemented from octave::text_processor.
Definition at line 1191 of file ft-text-renderer.cc.
References octave::text_element_fontstyle::bold, font, octave::text_element_fontstyle::get_fontstyle(), octave::text_renderer::font::get_name(), octave::text_renderer::font::get_size(), octave::text_element_fontstyle::italic, mode, MODE_BBOX, octave::text_element_fontstyle::normal, octave::text_element_fontstyle::oblique, set_font(), and update_line_bbox().
|
virtual |
Reimplemented from octave::text_processor.
Definition at line 1084 of file ft-text-renderer.cc.
References color, font, and octave::text_processor::visit().
|
virtual |
Implements octave::text_processor.
Definition at line 994 of file ft-text-renderer.cc.
References color, font, octave::ft_text_renderer::ft_font::get_face(), octave::text_renderer::font::get_size(), octave::text_renderer::string::get_string(), octave::ft_text_renderer::ft_font::is_valid(), line_xoffset, line_yoffset, m_do_strlist, m_max_fontsize, m_strlist, max(), mode, MODE_RENDER, n, octave_u8_strmbtouc_wrapper(), process_character(), octave::text_renderer::string::set_color(), octave::text_renderer::string::set_family(), octave::text_renderer::string::set_string(), octave::text_renderer::string::set_xdata(), octave::text_renderer::string::set_y(), octave::text_element_string::string_value(), xoffset, and yoffset.
|
virtual |
Reimplemented from octave::text_processor.
Definition at line 1098 of file ft-text-renderer.cc.
References octave::math::ceil(), font, octave::text_renderer::font::get_angle(), octave::text_renderer::font::get_name(), octave::text_renderer::font::get_size(), octave::text_renderer::font::get_weight(), octave::ft_text_renderer::ft_font::is_valid(), line_yoffset, max(), mode, MODE_BBOX, set_font(), update_line_bbox(), octave::text_processor::visit(), and yoffset.
|
virtual |
Reimplemented from octave::text_processor.
Definition at line 1129 of file ft-text-renderer.cc.
References octave::math::ceil(), font, octave::text_renderer::font::get_angle(), octave::text_renderer::font::get_name(), octave::text_renderer::font::get_size(), octave::text_renderer::font::get_weight(), octave::ft_text_renderer::ft_font::is_valid(), line_yoffset, max(), mode, MODE_BBOX, set_font(), update_line_bbox(), octave::text_processor::visit(), and yoffset.
|
virtual |
Reimplemented from octave::text_processor.
Definition at line 1217 of file ft-text-renderer.cc.
References color, font, octave::text_renderer::string::get_code(), octave::ft_text_renderer::ft_font::get_face(), octave::text_element_symbol::get_symbol(), octave::text_element_symbol::get_symbol_code(), octave::text_element_symbol::invalid_code, octave::ft_text_renderer::ft_font::is_valid(), line_yoffset, m_do_strlist, m_strlist, mode, MODE_RENDER, process_character(), octave::text_renderer::string::set_code(), octave::text_renderer::string::set_color(), octave::text_renderer::string::set_family(), octave::text_renderer::string::set_xdata(), octave::text_renderer::string::set_y(), warning(), xoffset, and yoffset.
|
private |
Definition at line 592 of file ft-text-renderer.cc.
Referenced by compute_bbox(), compute_line_xoffset(), get_extent(), render(), and set_mode().
|
private |
Definition at line 620 of file ft-text-renderer.cc.
Referenced by process_character(), set_color(), and visit().
|
private |
Definition at line 585 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), set_font(), and visit().
|
private |
Definition at line 603 of file ft-text-renderer.cc.
Referenced by compute_line_xoffset(), and text_to_pixels().
|
private |
Definition at line 600 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 627 of file ft-text-renderer.cc.
Referenced by push_new_line(), and visit().
|
private |
Definition at line 609 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().
|
private |
Definition at line 634 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 text_to_strlist(), and visit().
|
private |
Definition at line 637 of file ft-text-renderer.cc.
Referenced by compute_bbox(), push_new_line(), set_mode(), and visit().
|
private |
Definition at line 624 of file ft-text-renderer.cc.
Referenced by reset(), text_to_strlist(), and visit().
|
private |
Definition at line 631 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), and update_line_bbox().
|
private |
Definition at line 630 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), and update_line_bbox().
|
private |
Definition at line 617 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), set_mode(), update_line_bbox(), and visit().
|
private |
Definition at line 596 of file ft-text-renderer.cc.
Referenced by process_character(), render(), and set_mode().
|
private |
Definition at line 606 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), set_mode(), and visit().
|
private |
Definition at line 614 of file ft-text-renderer.cc.
Referenced by process_character(), push_new_line(), set_mode(), and visit().