45

Recently, Geany suddenly started showing underscores as spaces - i.e. they've become "invisible".

For example this text - is_empty, displays the same as is empty. But when copying to the clipboard from Geany, the underscores are as they should. They're only displayed wrong.

3
  • 1
    Do they become visible if you change the font?
    – user33758
    May 25, 2014 at 16:08
  • Yes, that fixed it. But if I set it back to Monospace the problem returns. Now I need to find some other monospace font to use with Geany, it seems. Hm, the problem is there with 'leafpad', as well - it uses Monospace, too. Also, sometimes the underscores appear, if I move the cursor on the same line (with leafpad at least). If I move the cursor away, the disappear again.
    – sashoalm
    May 25, 2014 at 16:11
  • @screener It seems it's a Monospace bug, not a geany bug, there are a lot of hits for that problem - google.com/search?q=monospace+invisible+underscore
    – sashoalm
    May 25, 2014 at 16:17

5 Answers 5

43

Same issue, Ubuntu 20.04

The problem is well described here:
https://github.com/geany/geany/issues/1387#issuecomment-287537022

Some fonts write underscores below descenders but don't include that in the declared font height, this is technically incorrect and confuses the layout software in Scintilla (the editing widget Geany uses) so insufficient height is allowed for underscores.

The solution is to either change font or to instruct Geany to make line height bigger:

Tools > Configuration Files > filetypes.common

[styling]
line_height=0;2;
2
  • 3
    If you don't want to lose so many lines of vertical space in the editor, 1 works fine, as well.
    – Pere
    Jan 19, 2021 at 18:23
  • 5
    For info if you don't want to loose space you can negate the offset with the first number. For instance instead of line_height=0;1; just write line_height=-1;1; This will visibily offset the very first line but all the others will remain unchanged and the line height problem will be solved.
    – Flinth
    Jul 22, 2021 at 12:42
10

It turned out that the problem was with the Monospace font. This happens also with other programs, such as LeafPad if they use that font.

The solution was to change the font to something else - "Lucida Console" in my case.

Edit: It seems that changing the zoom fixes it, too. Some zoom levels have invisible underscores, some don't.

2
  • 2
    Yes, zooming with Ctrl + Scroll seems to solve the issue
    – Covich
    May 7, 2020 at 15:08
  • Zooming Solves the issue for me
    – jovian
    Nov 30, 2020 at 9:16
5

For future reference, I had the same issue with Monospace 14 in Kubuntu 16.04, and it was solved by installing the recommended nvidia driver for my graphic card.

Edit: Despite the anonymous downvoter, this solution worked for me and I discovered it by chance. It means that it is a display problem. I didn't find any reference to this with search engines, so I'm pretty sure it can help someone to find it here.

3

Sorry for the very late answer, but this problem still persists.

For me, this was fixed by changing the font-hinting setting from 'slight' to 'medium', which looks like a bug to me.

I am using Cinnamon but I guess this would also work in other desktop managers.

2
  • Where can I change the font-hinting setting? Jul 14, 2020 at 12:40
  • In Cinnamon it is under System Settings -> Font Selection I would go with @gael s answer.
    – Oli
    May 15, 2021 at 20:05
3

A followup to Gael's answer which does the trick BUT

you must uncomment "[styling]" for the new line-height directive to take.

4
  • 2
    A follow up of a answer should be posted as a comment of this answer and not as a new answer. Dec 14, 2020 at 16:35
  • 1
    Thanks. I tried that but I didn't have enough points to make a comment. Catch-22. Dec 15, 2020 at 20:11
  • The header is called "[styling]" in Geany 1.36, not "[style]". Which version of Geany are you using?
    – Gael
    Feb 5, 2021 at 3:38
  • @Gael. You are correct. I mis-typed when I made the post. My file says "[styling]". Thanks. Feb 6, 2021 at 14:09

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .