### 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
gl.index = glyph_info[i].codepoint;
			if (gl.index != 0) {
				_ensure_glyph(fd, fss, gl.index | mod);
				if (p_sd->orientation == ORIENTATION_HORIZONTAL) {
					if (subpos) {
						gl.advance = (double)glyph_pos[i].x_advance / (64.0 / scale) + ea;
					} else {
						gl.advance = Math::round((double)glyph_pos[i].x_advance / (64.0 / scale) + ea);
					}
				} else {
					gl.advance = -Math::round((double)glyph_pos[i].y_advance / (64.0 / scale));
				}
				if (subpos) {
					gl.x_off = (double)glyph_pos[i].x_offset / (64.0 / scale);
				} else {
					gl.x_off = Math::round((double)glyph_pos[i].x_offset / (64.0 / scale));
				}
				gl.y_off = -Math::round((double)glyph_pos[i].y_offset / (64.0 / scale));
			}
			if (!last_run || i < glyph_count - 1) {
				
				if (sp_sp && is_whitespace(p_sd->text[glyph_info[i].cluster])) {
					gl.advance += sp_sp;
				} else {
					gl.advance += sp_gl;
				}
			}
			if (p_sd->preserve_control) {
				last_cluster_valid = last_cluster_valid && ((glyph_info[i].codepoint != 0) || (p_sd->text[glyph_info[i].cluster] == 0x0009) || (u_isblank(p_sd->text[glyph_info[i].cluster]) && (gl.advance != 0)) || (!u_isblank(p_sd->text[glyph_info[i].cluster]) && is_linebreak(p_sd->text[glyph_info[i].cluster])));
			} else {