### 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
const bmp_font_t *bm_font = static_cast<const bmp_font_t *>(p_font_data);
	if (!bm_font->face) {
		return 0;
	}
	if (!bm_font->face->glyph_map.has(p_glyph)) {
		return 0;
	}
	return bm_font->face->glyph_map[p_glyph].advance.x * 64;
}
hb_position_t TextServerAdvanced::_bmp_get_glyph_v_advance(hb_font_t *p_font, void *p_font_data, hb_codepoint_t p_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 0;
	}
	if (!bm_font->face->glyph_map.has(p_glyph)) {
		return 0;
	}
	return -bm_font->face->glyph_map[p_glyph].advance.y * 64;
}
hb_position_t TextServerAdvanced::_bmp_get_glyph_h_kerning(hb_font_t *p_font, void *p_font_data, hb_codepoint_t p_left_glyph, hb_codepoint_t p_right_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 0;
	}
	if (!bm_font->face->kerning_map.has(Vector2i(p_left_glyph, p_right_glyph))) {
		return 0;
	}
	return bm_font->face->kerning_map[Vector2i(p_left_glyph, p_right_glyph)].x * 64;
}
hb_bool_t TextServerAdvanced::_bmp_get_glyph_v_origin(hb_font_t *p_font, void *p_font_data, hb_codepoint_t p_glyph, hb_position_t *r_x, hb_position_t *r_y, void *p_user_data) {