### 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
bmp_font_t *bm_font = memnew(bmp_font_t);
	if (!bm_font) {
		return nullptr;
	}
	bm_font->face = p_face;
	bm_font->unref = p_unref;
	return bm_font;
}
void TextServerAdvanced::_bmp_font_destroy(void *p_data) {
	bmp_font_t *bm_font = static_cast<bmp_font_t *>(p_data);
	memdelete(bm_font);
}
hb_bool_t TextServerAdvanced::_bmp_get_nominal_glyph(hb_font_t *p_font, void *p_font_data, hb_codepoint_t p_unicode, hb_codepoint_t *r_glyph, void *p_user_data) {
	const bmp_font_t *bm_font = static_cast<const bmp_font_t *>(p_font_data);
	if (!bm_font->face) {
		return false;
	}
	if (!bm_font->face->glyph_map.has(p_unicode)) {
		if (bm_font->face->glyph_map.has(0xf000u + p_unicode)) {
			*r_glyph = 0xf000u + p_unicode;
			return true;
		} else {
			return false;
		}
	}
	*r_glyph = p_unicode;
	return true;
}
hb_position_t TextServerAdvanced::_bmp_get_glyph_h_advance(hb_font_t *p_font, void *p_font_data, hb_codepoint_t p_glyph, void *p_user_data) {