godot icon indicating copy to clipboard operation
godot copied to clipboard

Syntax highlighting not working in text editor on Windows 10/Godot 4 alpha 9

Open mackenziedg opened this issue 2 years ago • 9 comments

Godot version

v4.0.alpha9.official [fc18891db]

System information

Windows 10

Issue description

There is no syntax highlighting/coloring in the text editor at all. In alpha 8 the highlighting works as expected, but the same project in alpha 9 shows as plain text, as does a new project created in alpha 9. Changing the syntax highlighting mode in the settings does not have any effect, nor does changing the colors or theme. Syntax highlighting does seem to work in the "minimap" panel on the right.

Example image

Steps to reproduce

Open a file in the text editor which should have syntax highlighting enabled.

Minimal reproduction project

No response

mackenziedg avatar Jun 05 '22 15:06 mackenziedg

Is it for all projects, or just one (can you upload a MRP)? It's working fine for me on Win11: image

AaronRecord avatar Jun 06 '22 00:06 AaronRecord

Here's an MRP. Opening this in a9 has no highlighting, but opening it in a8 does have highlighting. This was an issue from the first time running a9 so I haven't changed any settings at all as far as I'm aware.

mackenziedg avatar Jun 06 '22 01:06 mackenziedg

I can't reproduce on my laptop (this is what the MRP looks like for me): image

AaronRecord avatar Jun 06 '22 01:06 AaronRecord

I just upgraded a few different laptops to 3.5 last night, and one of them (an old Sony Vaio) exhibits this same issue. No syntax highlighting in the main editor, but working in the mini-map. The same project highlights as expected in 3.4.4 on the offending system. Also, a brand new project, started in 3.5 shows no syntax highlighting.

Toggling highlighting on/off in the Editor settings changes the highlighting in the mini-map (as expected), but has no impact on the main editor.

The offending project highlights correctly on the other (upgraded to 3.5) laptop. So, it's seemingly hardware related.

jgodfrey avatar Aug 06 '22 14:08 jgodfrey

@mackenziedg @jgodfrey Which graphics card model and driver version are you using on the machine exhibiting the problem?

Calinou avatar Aug 07 '22 07:08 Calinou

@Calinou - Here's the Speccy info on this (ancient) Vaio laptop's GPU. Unfortunately, this is the latest, newest video driver for this system. It's mostly relegated to web browsing at this point, but Godot has always worked well on it, so I've continued to use it from time to time... :)

image

jgodfrey avatar Aug 07 '22 14:08 jgodfrey

Same problem here in v3.5.stable.official [991bb6ac7] on Windows 11. Video drivers are up to date. Video card: NVIDIA GeForce GTX 1060 6GB Driver version: 31.0.15.1694

colinvaufrey avatar Sep 07 '22 17:09 colinvaufrey

It may be related to custom fonts. Works again for me after resetting to default editor font.

colinvaufrey avatar Sep 18 '22 12:09 colinvaufrey

Ah, yes. Nice find @TheKiwy. Resetting the Code Font to the default value fixes the syntax highlighting here also. Though, I'd really prefer to use a custom font... :)

jgodfrey avatar Sep 18 '22 22:09 jgodfrey

One more update here in case it's helpful...

In my case, the offending hardware (outlined above) is currently running Windows 10 and Godot v3.5.stable.official. My normal coding font is SourceCodePro, which results in this issue (no syntax highlighting). However, I recently switched to using JetBrainsMono for my coding font, which DOES NOT exhibit this issue. With that font, the syntax highlighting works as expected.

I did notice that my SourceCodePro font is an OTF file while my JetBrainsMono font is a TTF file. As a test, I found a TTF version fo SourceCodePro, but it also does not show any syntax highlighting.

So, at least for me, only some custom fonts cause this issue. Incidentally, syntax highlighting works as expected in v3.4.4 using SourceCodePro.

jgodfrey avatar Nov 23 '22 23:11 jgodfrey

I just had this issue as well in the stable 4.0 mono release. But changing the font antialiasing in interface/editor/font_antialiasing back to the default (grayscale) fixed it for me.

njs-guy avatar Mar 03 '23 22:03 njs-guy

Can any of you who can reproduce this try to bisect the regression between 4.0.alpha8 and 4.0.alpha9?

  • 4.0.alpha8 (good)'s commit hash is 917fd65748957304c987414c63d54ef4f6972394.
  • 4.0.alpha8 (bad)'s commit hash is d9daf3869f27e2afdacb2744168052ce0d4ae43b.

Calinou avatar Mar 04 '23 00:03 Calinou