Page 1 of 1

Line spacing in the main window

Posted: Wed Jan 13, 2010 4:56 am
by ds_on_cl
Hi,

Is there a way to change the line spacing? I use a rather small font and that makes the extra space pixel line(s) between lines more noticeable.

It also gives me fewer lines on the screen at once. For example on another scintilla based editor with the same font, I can get about 90 lines on the screen, while on codelite I can get around 70. The font characters are the same on the screen, but the space between lines is wider on codelite.

So, tips on how to change this would be cool. If there's no current way to change this, could you take this as a feature request?

Thanks

Re: Line spacing in the main window

Posted: Wed Jan 13, 2010 9:35 am
by eranif
Wow, and interesting bug :)

Try this: open the font dialog (settings -> syntax highlight and fonts) and select the language you are using.

Select the font you use, and click 'Apply' (not OK) -> you will see that you will be able to see more lines, now:
close the file and re-open it again, it will revert the "line spacing" back - so it seems like there is a different between the two.

I will look into this

Eran

Re: Line spacing in the main window

Posted: Wed Jan 13, 2010 11:07 am
by eranif
This bug is now fixed in SVN trunk and will be part of the next release
Eran

Re: Line spacing in the main window

Posted: Thu Jan 14, 2010 1:42 am
by ds_on_cl
There's also this note in the scintilla docs:
All lines of text in Scintilla are the same height, and this height is calculated from the largest font in any current style. This restriction is for performance; if lines differed in height then calculations involving positioning of text would require the text to be styled first.
So I set the same font in all cases I could find, but I don't know if there's a hidden font in the mix that I don't have a gui for.

Also, there's this stuff from the scintilla docs that might be involved:
SCI_SETEXTRAASCENT(int extraAscent)
SCI_GETEXTRAASCENT
SCI_SETEXTRADESCENT(int extraDescent)
SCI_GETEXTRADESCENT
Text is drawn with the base of each character on a 'baseline'. The height of a line is found from the maximum that any style extends above the baseline (its 'ascent'), added to the maximum that any style extends below the baseline (its 'descent'). Space may be added to the maximum ascent (SCI_SETEXTRAASCENT) and the maximum descent (SCI_SETEXTRADESCENT) to allow for more space between lines. This may done to make the text easier to read or to accomodate underlines or highlights.
Not sure though. Just trying to help you, help me :)

Thanks again.

Re: Line spacing in the main window

Posted: Thu Jan 14, 2010 9:02 am
by eranif
Read my last post: I fixed this bug in trunk.

Btw, you can set the font to all styles by using the 'Global Font' button, it will set it to all the styles you got on that language.

Eran

Re: Line spacing in the main window

Posted: Thu Mar 04, 2010 8:54 am
by ds_on_cl
This was fixed, thanks; but it came back now that I've updated to v2.3.0.3833

Re: Line spacing in the main window

Posted: Thu Mar 04, 2010 9:26 am
by eranif
ds_on_cl wrote:but it came back now that I've updated to v2.3.0.3833
This is strange:

It looks like it depends on the font. with "Bitstream" font, I get 60 lines per editor, while using Courier New, I get 54 (same font size)

Eran

Re: Line spacing in the main window

Posted: Thu Mar 04, 2010 9:46 am
by ds_on_cl
In case it helps, I'm using the PROFONT.FON in Windows xp.

http://www.tobias-jung.de/seekingprofont/

Re: Line spacing in the main window

Posted: Wed May 12, 2010 2:36 am
by ds_on_cl
I've noticed something else I think is related to this. With the same font (and the same file), if I use View as C++ I get extra whitespace between lines, if I View as Text the extra space goes away and I get more lines on the screen.