### Godot version

v4.0.2.stable.official [7a0977ce2]

### System information

Windows 10, not platform specific

### Issue description

Methods `get_character_line` and `get_character_paragraph` return wrong indices for characters that are first in the respective line/paragraph. See the attached screenshot.

![image](https://user-images.githubusercontent.com/892180/236546781-692603be-eb09-419e-822e-d4152a66d9b6.png)


### Steps to reproduce

Run attached project.

The script goes through all characters in `RichTextLabel` and prints the respective character, line index, and paragraph index. None of them should be -1 since we are iterating through valid indices.

### Minimal reproduction project

[RichTextLabel.zip](https://github.com/godotengine/godot/files/11409399/RichTextLabel.zip)

}
				
				const int available_width = p_width - theme_cache.table_h_separation * (col_count - 1);
				int idx = 0;
				for (Item *E : table->subitems) {
					ERR_CONTINUE(E->type != ITEM_FRAME); 
					ItemFrame *frame = static_cast<ItemFrame *>(E);
					int column = idx % col_count;
					float prev_h = 0;
					for (int i = 0; i < (int)frame->lines.size(); i++) {
						MutexLock sub_lock(frame->lines[i].text_buf->get_mutex());
						int char_offset = l.char_offset + l.char_count;
						int w = _find_margin(frame->lines[i].from, p_base_font, p_base_font_size) + 1;
						prev_h = _shape_line(frame, i, p_base_font, p_base_font_size, w, prev_h, &char_offset);
						int cell_ch = (char_offset - (l.char_offset + l.char_count));
						l.char_count += cell_ch;
						t_char_count += cell_ch;
						remaining_characters -= cell_ch;
						table->columns[column].min_width = MAX(table->columns[column].min_width, ceil(frame->lines[i].text_buf->get_size().x));
						table->columns[column].max_width = MAX(table->columns[column].max_width, ceil(frame->lines[i].text_buf->get_non_wrapped_size().x));
					}
					idx++;
				}
				
				int total_ratio = 0;
				int remaining_width = available_width;
				table->total_width = theme_cache.table_h_separation;
				for (int i = 0; i < col_count; i++) {
					remaining_width -= table->columns[i].min_width;
					if (table->columns[i].max_width > table->columns[i].min_width) {