### 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)

off.x += Math::floor((width - length) / 2.0);
			} break;
			case HORIZONTAL_ALIGNMENT_RIGHT: {
				if (!rtl) {
					off.x += width - length;
				}
			} break;
		}
		if (line <= dc_lines) {
			if (rtl) {
				off.x -= h_off;
			} else {
				off.x += h_off;
			}
		}
		RID rid = l.text_buf->get_line_rid(line);
		
		off.y += TS->shaped_text_get_ascent(rid);
		
		Array objects = TS->shaped_text_get_objects(rid);
		for (int i = 0; i < objects.size(); i++) {
			Item *it = reinterpret_cast<Item *>((uint64_t)objects[i]);
			if (it != nullptr) {
				Rect2 rect = TS->shaped_text_get_object_rect(rid, objects[i]);
				
				switch (it->type) {
					case ITEM_IMAGE: {
						ItemImage *img = static_cast<ItemImage *>(it);
						img->image->draw_rect(ci, Rect2(p_ofs + rect.position + off, rect.size), false, img->color);
					} break;