### Godot version

4.0.dev Beta 14

### System information

Windows 10 and Linux (Pop!_OS 22.04)

### Issue description

When opening a UTF-8 text file with an emoji or other unicode character, the line will not show up and the editor starts producing a number of errors in output. Here is the output:

--- GDScript language server started ---
  U_ILLEGAL_ARGUMENT_ERROR
  modules/text_server_adv/text_server_adv.cpp:4389 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5829 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  U_ILLEGAL_ARGUMENT_ERROR
  modules/text_server_adv/text_server_adv.cpp:4389 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:3837 - Condition "!sd" is true. Returning: TextServer::ORIENTATION_HORIZONTAL
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5730 - Condition "!sd" is true. Returning: nullptr
  modules/text_server_adv/text_server_adv.cpp:5741 - Condition "!sd" is true. Returning: 0
  modules/text_server_adv/text_server_adv.cpp:5818 - Condition "!sd" is true. Returning: 0.0
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5770 - Condition "!sd" is true. Returning: Vector2i()
  modules/text_server_adv/text_server_adv.cpp:5803 - Condition "!sd" is true. Returning: Size2()

### Steps to reproduce

Add a text file and paste in an emoji into the text resource file then open it in the editor.

### Minimal reproduction project

[FileIOGuide.zip](https://github.com/godotengine/godot/files/10477742/FileIOGuide.zip)

fd->glyph_map[p_glyph] = FontGlyph();
				ERR_FAIL_V_MSG(false, "FreeType: Failed to load glyph stroker.");
			}
			FT_Stroker_Set(stroker, (int)(fd->size.y * fd->oversampling * 16.0), FT_STROKER_LINECAP_BUTT, FT_STROKER_LINEJOIN_ROUND, 0);
			FT_Glyph glyph;
			FT_BitmapGlyph glyph_bitmap;
			if (FT_Get_Glyph(fd->face->glyph, &glyph) != 0) {
				goto cleanup_stroker;
			}
			if (FT_Glyph_Stroke(&glyph, stroker, 1) != 0) {
				goto cleanup_glyph;
			}
			if (FT_Glyph_To_Bitmap(&glyph, aa_mode, nullptr, 1) != 0) {
				goto cleanup_glyph;
			}
			glyph_bitmap = (FT_BitmapGlyph)glyph;
			gl = rasterize_bitmap(fd, rect_range, glyph_bitmap->bitmap, glyph_bitmap->top, glyph_bitmap->left, Vector2(), bgra);
		cleanup_glyph:
			FT_Done_Glyph(glyph);
		cleanup_stroker:
			FT_Stroker_Done(stroker);
		}
		fd->glyph_map[p_glyph] = gl;
		return gl.found;
	}
#endif
	fd->glyph_map[p_glyph] = FontGlyph();
	return false;
}
_FORCE_INLINE_ bool TextServerAdvanced::_ensure_cache_for_size(FontAdvanced *p_font_data, const Vector2i &p_size) const {