Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
text-editing.h File Reference

Go to the source code of this file.

Typedefs

typedef std::pair< Inkscape::Text::Layout::iterator, Inkscape::Text::Layout::iteratoriterator_pair
 

Functions

Inkscape::Text::Layout const * te_get_layout (SPItem const *item)
 
void te_update_layout_now_recursive (SPItem *item)
 
bool sp_te_output_is_empty (SPItem const *item)
 Returns true if there are no visible characters on the canvas.
 
bool sp_te_input_is_empty (SPObject const *item)
 Returns true if the user has typed nothing in the text box.
 
unsigned sp_text_get_length (SPObject const *item)
 Recursively gets the length of all the SPStrings at or below the given item.
 
unsigned sp_text_get_length_upto (SPObject const *item, SPObject const *upto)
 Recursively gets the length of all the SPStrings at or below the given item, before and not including upto.
 
std::vector< Geom::Pointsp_te_create_selection_quads (SPItem const *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, Geom::Affine const &transform)
 
Inkscape::Text::Layout::iterator sp_te_get_position_by_coords (SPItem const *item, Geom::Point const &i_p)
 
void sp_te_get_cursor_coords (SPItem const *item, Inkscape::Text::Layout::iterator const &position, Geom::Point &p0, Geom::Point &p1)
 
double sp_te_get_average_linespacing (SPItem *text)
 
SPStyle const * sp_te_style_at_position (SPItem const *text, Inkscape::Text::Layout::iterator const &position)
 
SPObject const * sp_te_object_at_position (SPItem const *text, Inkscape::Text::Layout::iterator const &position)
 
Inkscape::Text::Layout::iterator sp_te_insert (SPItem *item, Inkscape::Text::Layout::iterator const &position, char const *utf8)
 
Inkscape::Text::Layout::iterator sp_te_replace (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, char const *utf8)
 
Inkscape::Text::Layout::iterator sp_te_insert_line (SPItem *text, Inkscape::Text::Layout::iterator &position)
 inserts a new line break at the given position in a text or flowtext object.
 
bool sp_te_delete (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, iterator_pair &iter_pair)
 
Glib::ustring sp_te_get_string_multiline (SPItem const *text)
 Gets a text-only representation of the given text or flowroot object, replacing line break elements with '
'.
 
Glib::ustring sp_te_get_string_multiline (SPItem const *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end)
 Gets a text-only representation of the characters in a text or flowroot object from start to end only.
 
void sp_te_set_repr_text_multiline (SPItem *text, char const *str)
 
TextTagAttributestext_tag_attributes_at_position (SPItem *item, Inkscape::Text::Layout::iterator const &position, unsigned *char_index)
 Returns the attributes block and the character index within that block which represents the iterator position.
 
void sp_te_adjust_kerning_screen (SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, Geom::Point by)
 
void sp_te_adjust_dx (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double delta)
 
void sp_te_adjust_dy (SPItem *item, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double delta)
 
void sp_te_adjust_rotation_screen (SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double pixels)
 
void sp_te_adjust_rotation (SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double degrees)
 
void sp_te_set_rotation (SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double degrees)
 
void sp_te_adjust_tspan_letterspacing_screen (SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double by)
 
void sp_te_adjust_linespacing_screen (SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPDesktop *desktop, double by)
 
void sp_te_apply_style (SPItem *text, Inkscape::Text::Layout::iterator const &start, Inkscape::Text::Layout::iterator const &end, SPCSSAttr const *css)
 Applies the given CSS fragment to the characters of the given text or flowtext object between start and end, creating or removing span elements as necessary and optimal.
 
bool is_part_of_text_subtree (SPObject const *obj)
 
bool is_top_level_text_object (SPObject const *obj)
 
bool has_visible_text (SPObject const *obj)
 

Typedef Documentation

◆ iterator_pair

Function Documentation

◆ has_visible_text()

bool has_visible_text ( SPObject const *  obj)

Definition at line 2166 of file text-editing.cpp.

References child, SPObject::children, has_visible_text(), and is_part_of_text_subtree().

Referenced by has_visible_text().

◆ is_part_of_text_subtree()

bool is_part_of_text_subtree ( SPObject const *  obj)

Definition at line 2148 of file text-editing.cpp.

Referenced by has_visible_text(), and sp_te_get_ustring_multiline().

◆ is_top_level_text_object()

bool is_top_level_text_object ( SPObject const *  obj)

Definition at line 2160 of file text-editing.cpp.

◆ sp_te_adjust_dx()

◆ sp_te_adjust_dy()

◆ sp_te_adjust_kerning_screen()

◆ sp_te_adjust_linespacing_screen()

void sp_te_adjust_linespacing_screen ( SPItem text,
Inkscape::Text::Layout::iterator const &  start,
Inkscape::Text::Layout::iterator const &  end,
SPDesktop desktop,
double  by 
)

◆ sp_te_adjust_rotation()

void sp_te_adjust_rotation ( SPItem text,
Inkscape::Text::Layout::iterator const &  start,
Inkscape::Text::Layout::iterator const &  end,
SPDesktop desktop,
double  degrees 
)

◆ sp_te_adjust_rotation_screen()

void sp_te_adjust_rotation_screen ( SPItem text,
Inkscape::Text::Layout::iterator const &  start,
Inkscape::Text::Layout::iterator const &  end,
SPDesktop desktop,
double  pixels 
)

◆ sp_te_adjust_tspan_letterspacing_screen()

void sp_te_adjust_tspan_letterspacing_screen ( SPItem text,
Inkscape::Text::Layout::iterator const &  start,
Inkscape::Text::Layout::iterator const &  end,
SPDesktop desktop,
double  by 
)

◆ sp_te_apply_style()

◆ sp_te_create_selection_quads()

std::vector< Geom::Point > sp_te_create_selection_quads ( SPItem const *  item,
Inkscape::Text::Layout::iterator const &  start,
Inkscape::Text::Layout::iterator const &  end,
Geom::Affine const &  transform 
)

◆ sp_te_delete()

◆ sp_te_get_average_linespacing()

◆ sp_te_get_cursor_coords()

void sp_te_get_cursor_coords ( SPItem const *  item,
Inkscape::Text::Layout::iterator const &  position,
Geom::Point p0,
Geom::Point p1 
)

◆ sp_te_get_position_by_coords()

◆ sp_te_get_string_multiline() [1/2]

◆ sp_te_get_string_multiline() [2/2]

Glib::ustring sp_te_get_string_multiline ( SPItem const *  text,
Inkscape::Text::Layout::iterator const &  start,
Inkscape::Text::Layout::iterator const &  end 
)

Gets a text-only representation of the characters in a text or flowroot object from start to end only.

Line break elements are replaced with '
'.

Definition at line 941 of file text-editing.cpp.

References end, Inkscape::Text::Layout::getSourceOfCharacter(), Inkscape::Text::Layout::iterator::nextCharacter(), result, start, and te_get_layout().

◆ sp_te_input_is_empty()

bool sp_te_input_is_empty ( SPObject const *  item)

Returns true if the user has typed nothing in the text box.

Definition at line 87 of file text-editing.cpp.

References child, SPObject::children, item, and sp_te_input_is_empty().

Referenced by sp_te_input_is_empty().

◆ sp_te_insert()

Inkscape::Text::Layout::iterator sp_te_insert ( SPItem item,
Inkscape::Text::Layout::iterator const &  position,
char const *  utf8 
)

◆ sp_te_insert_line()

Inkscape::Text::Layout::iterator sp_te_insert_line ( SPItem item,
Inkscape::Text::Layout::iterator position 
)

◆ sp_te_object_at_position()

SPObject const * sp_te_object_at_position ( SPItem const *  text,
Inkscape::Text::Layout::iterator const &  position 
)

◆ sp_te_output_is_empty()

bool sp_te_output_is_empty ( SPItem const *  item)

Returns true if there are no visible characters on the canvas.

Definition at line 81 of file text-editing.cpp.

References Inkscape::Text::Layout::begin(), Inkscape::Text::Layout::end(), item, and te_get_layout().

◆ sp_te_replace()

Inkscape::Text::Layout::iterator sp_te_replace ( SPItem item,
Inkscape::Text::Layout::iterator const &  start,
Inkscape::Text::Layout::iterator const &  end,
char const *  utf8 
)

◆ sp_te_set_repr_text_multiline()

void sp_te_set_repr_text_multiline ( SPItem text,
char const *  str 
)

◆ sp_te_set_rotation()

void sp_te_set_rotation ( SPItem text,
Inkscape::Text::Layout::iterator const &  start,
Inkscape::Text::Layout::iterator const &  end,
SPDesktop desktop,
double  degrees 
)

◆ sp_te_style_at_position()

◆ sp_text_get_length()

unsigned sp_text_get_length ( SPObject const *  item)

Recursively gets the length of all the SPStrings at or below the given item.

Also adds 1 for each line break encountered.

Definition at line 227 of file text-editing.cpp.

References child, SPObject::children, is_line_break_object(), item, and sp_text_get_length().

Referenced by delete_line_break(), fix_blank_line(), sp_te_adjust_tspan_letterspacing_screen(), sp_text_get_length(), sum_sibling_text_lengths_before(), and tidy_operator_repeated_spans().

◆ sp_text_get_length_upto()

unsigned sp_text_get_length_upto ( SPObject const *  item,
SPObject const *  upto 
)

Recursively gets the length of all the SPStrings at or below the given item, before and not including upto.

Also adds 1 for each line break encountered.

Definition at line 250 of file text-editing.cpp.

References child, SPObject::children, SPObject::firstChild(), is_line_break_object(), SPObject::isAncestorOf(), item, SPObject::parent, and sp_text_get_length_upto().

Referenced by SPTRef::bbox(), SPTSpan::bbox(), fix_blank_line(), and sp_text_get_length_upto().

◆ te_get_layout()

Inkscape::Text::Layout const * te_get_layout ( SPItem const *  item)

Definition at line 48 of file text-editing.cpp.

References item.

Referenced by Inkscape::ObjectSnapper::_collectPaths(), Inkscape::UI::Toolbar::TextToolbar::_cursorMoved(), Inkscape::UI::Tools::TextTool::_selectionChanged(), Inkscape::UI::Tools::TextTool::_styleQueried(), Inkscape::UI::Tools::TextTool::_updateCursor(), Inkscape::UI::Tools::TextTool::_validateCursorIterators(), curve_for_item(), curve_for_item_before_LPE(), SPText::description(), fix_blank_line(), Inkscape::LivePathEffect::getNodes(), Inkscape::UI::Tools::TextTool::item_handler(), Inkscape::UI::Dialog::Find::item_text_match(), Inkscape::UI::Dialog::SpellCheck::nextText(), object_align_text(), object_distribute_text(), Inkscape::UI::Dialog::SpellCheck::onObjModified(), Inkscape::UI::Toolbar::TextToolbar::prepare_inner(), Inkscape::UI::Tools::TextTool::root_handler(), Inkscape::UI::Tools::MeasureTool::showCanvasItems(), SPFlowtext::snappoints(), SPText::snappoints(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_flowtext_render(), sp_selected_item_to_curved_repr(), sp_te_adjust_linespacing_screen(), sp_te_adjust_rotation_screen(), sp_te_adjust_tspan_letterspacing_screen(), sp_te_apply_style(), sp_te_create_selection_quads(), sp_te_delete(), sp_te_get_average_linespacing(), sp_te_get_cursor_coords(), sp_te_get_position_by_coords(), sp_te_get_string_multiline(), sp_te_insert(), sp_te_insert_line(), sp_te_object_at_position(), sp_te_output_is_empty(), Inkscape::Extension::Internal::LaTeXTextRenderer::sp_text_render(), Inkscape::UI::Toolbar::TextToolbar::subselection_wrap_toggle(), text_flow_into_shape(), text_put_on_path(), and Inkscape::Extension::Internal::OdfOutput::writeTree().

◆ te_update_layout_now_recursive()

void te_update_layout_now_recursive ( SPItem item)

◆ text_tag_attributes_at_position()