### 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
}
				if (!sd->preserve_control && is_control(gl.index)) {
					gl.index = 0x0020;
				}
				
				for (int k = 0; k < span.fonts.size(); k++) {
					if (_font_has_char(span.fonts[k], gl.index)) {
						gl.font_rid = span.fonts[k];
						break;
					}
				}
				if (!gl.font_rid.is_valid() && prev_font.is_valid()) {
					if (_font_has_char(prev_font, gl.index)) {
						gl.font_rid = prev_font;
					}
				}
				if (!gl.font_rid.is_valid() && OS::get_singleton()->has_feature("system_fonts") && span.fonts.size() > 0) {
					
					RID fdef = span.fonts[0];
					if (_font_is_allow_system_fallback(fdef)) {
						String text = sd->text.substr(j, 1);
						String font_name = _font_get_name(fdef);
						BitField<FontStyle> font_style = _font_get_style(fdef);
						int font_weight = _font_get_weight(fdef);
						int font_stretch = _font_get_stretch(fdef);
						Dictionary dvar = _font_get_variation_coordinates(fdef);
						static int64_t wgth_tag = _name_to_tag("weight");
						static int64_t wdth_tag = _name_to_tag("width");
						static int64_t ital_tag = _name_to_tag("italic");
						if (dvar.has(wgth_tag)) {