Line spacing in the main window

General questions regarding the usage of CodeLite
ds_on_cl
CodeLite Enthusiast
Posts: 13
Joined: Wed Jan 13, 2010 3:58 am
Genuine User: Yes
IDE Question: c++
Contact:

Line spacing in the main window

Post 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
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Line spacing in the main window

Post 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
Make sure you have read the HOW TO POST thread
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Line spacing in the main window

Post by eranif »

This bug is now fixed in SVN trunk and will be part of the next release
Eran
Make sure you have read the HOW TO POST thread
ds_on_cl
CodeLite Enthusiast
Posts: 13
Joined: Wed Jan 13, 2010 3:58 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Line spacing in the main window

Post 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.
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Line spacing in the main window

Post 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
Make sure you have read the HOW TO POST thread
ds_on_cl
CodeLite Enthusiast
Posts: 13
Joined: Wed Jan 13, 2010 3:58 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Line spacing in the main window

Post by ds_on_cl »

This was fixed, thanks; but it came back now that I've updated to v2.3.0.3833
User avatar
eranif
CodeLite Plugin
Posts: 6372
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: Line spacing in the main window

Post 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
Make sure you have read the HOW TO POST thread
ds_on_cl
CodeLite Enthusiast
Posts: 13
Joined: Wed Jan 13, 2010 3:58 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Line spacing in the main window

Post by ds_on_cl »

In case it helps, I'm using the PROFONT.FON in Windows xp.

http://www.tobias-jung.de/seekingprofont/
ds_on_cl
CodeLite Enthusiast
Posts: 13
Joined: Wed Jan 13, 2010 3:58 am
Genuine User: Yes
IDE Question: c++
Contact:

Re: Line spacing in the main window

Post 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.
Post Reply