### Godot version

8449592d92eaeef990f5502b419d491ee3eeb7a6

### System information

Windows 11

### Issue description

Zooming in the script editor on an empty script freezes the entire editor for a few seconds, but if the file is large then it freezes for 4-5 seconds (which is unacceptable). Looks like a recent regression.

### Steps to reproduce

Just zoom in/out on the large script file.

### Minimal reproduction project

N/A
#endif
			}
			memset(&fd->stream, 0, sizeof(FT_StreamRec));
			fd->stream.base = (unsigned char *)p_font_data->data_ptr;
			fd->stream.size = p_font_data->data_size;
			fd->stream.pos = 0;
			FT_Open_Args fargs;
			memset(&fargs, 0, sizeof(FT_Open_Args));
			fargs.memory_base = (unsigned char *)p_font_data->data_ptr;
			fargs.memory_size = p_font_data->data_size;
			fargs.flags = FT_OPEN_MEMORY;
			fargs.stream = &fd->stream;
			int max_index = 0;
			FT_Face tmp_face = nullptr;
			error = FT_Open_Face(ft_library, &fargs, -1, &tmp_face);
			if (tmp_face && error 
				max_index = tmp_face->num_faces - 1;
			}
			if (tmp_face) {
				FT_Done_Face(tmp_face);
			}
			error = FT_Open_Face(ft_library, &fargs, CLAMP(p_font_data->face_index, 0, max_index), &fd->face);
			if (error) {
				FT_Done_Face(fd->face);
				fd->face = nullptr;
				memdelete(fd);
				ERR_FAIL_V_MSG(false, "FreeType: Error loading font: '" + String(FT_Error_String(error)) + "'.");
			}
		}
		if (p_font_data->msdf) {