### 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
continue;
					}
					
					if (sd_glyphs[i].flags & GRAPHEME_IS_RTL) {
						if ((i + count < sd_size - 1) && ((sd_glyphs[i + count].flags & (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT)) == (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT))) {
							i += (sd_glyphs[i].count - 1);
							continue;
						}
					} else {
						if ((sd_glyphs[i].flags & (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT)) == (GRAPHEME_IS_SPACE | GRAPHEME_IS_BREAK_SOFT)) {
							i += (sd_glyphs[i].count - 1);
							continue;
						}
					}
					Glyph gl;
					gl.start = sd_glyphs[i].start;
					gl.end = sd_glyphs[i].end;
					gl.count = 1;
					gl.font_rid = sd_glyphs[i].font_rid;
					gl.font_size = sd_glyphs[i].font_size;
					gl.flags = GRAPHEME_IS_BREAK_SOFT | GRAPHEME_IS_VIRTUAL | GRAPHEME_IS_SPACE;
					
					if (c_punct_size 
						if (u_ispunct(c) && c != 0x005f) {
							gl.flags |= GRAPHEME_IS_PUNCTUATION;
						}
					} else {
						for (int j = 0; j < c_punct_size; j++) {
							if (c_punct[j] == c) {
								gl.flags |= GRAPHEME_IS_PUNCTUATION;