Many people are using Consolas for their primary programming font but unfortunately there is no way to change line height in Eclipse so it looks kinda ugly as it is shown below:
I was wondering if there is anyone who solved this by adding some extra space between lines or simply changing the font itself which has longer height now.
It would be nice to share it with us here on Stackoverflow.
There are some topics I've found while searching for this but none of them were what I am looking for:
- How can I change line height / line spacing in Eclipse?
- https://stackoverflow.com/questions/15153938/improved-line-spacing-for-eclipse?lq=1
- and so on...
Some of them designed their own fonts (such as Meslo Font) by modifying the existing ones so it would be nice if you could share your modified Consolas font.
As mentioned in one of the answers you reference the underlying
StyledText
control does have asetLineSpacing
method, but the existing editors do not use it.The
CSS
styling code in Eclipse 4.3 does provide a way to access this but it requires writing a plugin to extend the CSS in order to do so.The
plugin.xml
for the plugin would look like this:which declares a CSS element provider
LineSpacingElementProvider
which would be:The
StyledTextElement
this provides is just:The second declaration in the
plugin.xml
is a CSS property handler for a property calledline-spacing
With a plugin containing this installed you can then modify one of the existing CSS style sheets to contain: