52 int16_t prev_chop_coord;
55 C_OUTLINE_LIST left_coutlines;
56 C_OUTLINE_LIST right_coutlines;
58 C_BLOB_IT cblob_it = &cblobs;
60 WERD_IT word_it = &words;
71 #ifndef GRAPHICS_DISABLED
83 rep_left = rep_it.data ()->bounding_box ().left ();
86 xstarts[0] = box_it.data ()->bounding_box ().left ();
87 if (rep_left < xstarts[0]) {
88 xstarts[0] = rep_left;
90 if (cell_it.empty () || row->
char_cells.singleton ()) {
91 tprintf (
"Row without enough char cells!\n");
92 tprintf (
"Leftmost blob is at (%d,%d)\n",
93 box_it.data ()->bounding_box ().left (),
94 box_it.data ()->bounding_box ().bottom ());
98 prev_chop_coord = cell_it.data ()->x ();
100 while (rep_left < cell_it.data ()->x ()) {
104 cell_it.mark_cycle_pt ();
105 if (prev_chop_coord >= cell_it.data ()->x ())
107 for (; !cell_it.cycled_list (); cell_it.forward ()) {
108 chop_coord = cell_it.data ()->x ();
109 while (!box_it.empty ()
110 && box_it.data ()->bounding_box ().left () <= chop_coord) {
111 if (box_it.data ()->bounding_box ().right () > prev_x)
112 prev_x = box_it.data ()->bounding_box ().right ();
118 while (!box_it.empty() && box_it.data()->cblob() ==
nullptr) {
119 delete box_it.extract();
123 if (!right_coutlines.empty() && left_coutlines.empty())
128 if (!left_coutlines.empty()) {
129 cblob_it.add_after_then_move(
new C_BLOB(&left_coutlines));
131 if (rep_left < chop_coord) {
132 if (rep_left > prev_chop_coord)
133 new_blanks =
static_cast<uint8_t
>(floor ((rep_left - prev_chop_coord)
139 if (chop_coord > prev_chop_coord)
140 new_blanks =
static_cast<uint8_t
>(floor ((chop_coord - prev_chop_coord)
145 if (!cblob_it.empty()) {
146 if (blanks < 1 && word != nullptr && !word->flag (
W_REP_CHAR))
148 word =
new WERD (&cblobs, blanks,
nullptr);
149 cblob_it.set_to_list (&cblobs);
151 word_it.add_after_then_move (word);
159 blanks += new_blanks;
160 while (rep_left < chop_coord) {
165 if (prev_chop_coord < chop_coord)
166 prev_chop_coord = chop_coord;
168 if (!cblob_it.empty()) {
169 word =
new WERD(&cblobs, blanks,
nullptr);
171 word_it.add_after_then_move (word);
176 while (!rep_it.empty ()) {
181 word_it.data ()->set_flag (
W_EOL,
true);
182 if (prev_chop_coord > prev_x)
183 prev_x = prev_chop_coord;
184 xstarts[1] = prev_x + 1;
186 word_it.set_to_list (real_row->
word_list ());
188 word_it.add_list_after (&words);
@ W_REP_CHAR
repeated character
@ W_DONT_CHOP
fixed pitch chopped
DLLSYM void tprintf(const char *format,...)
void plot_row_cells(ScrollView *win, ScrollView::Color colour, TO_ROW *row, float xshift, ICOORDELT_LIST *cells)
WERD * add_repeated_word(WERD_IT *rep_it, int16_t &rep_left, int16_t &prev_chop_coord, uint8_t &blanks, float pitch, WERD_IT *word_it)
int textord_fp_chop_error
void split_to_blob(BLOBNBOX *blob, int16_t chop_coord, float pitch_error, C_OUTLINE_LIST *left_coutlines, C_OUTLINE_LIST *right_coutlines)
bool textord_show_page_cuts
BLOBNBOX_LIST * blob_list()
ICOORDELT_LIST char_cells
void recalc_bounding_box()
void set_flag(WERD_FLAGS mask, bool value)