unixwork / xnedit

A fast and classic X11 text editor, based on NEdit, with full unicode support and antialiased text rendering.
Other
83 stars 11 forks source link

line spacing is too high #93

Closed daveriesz closed 1 year ago

daveriesz commented 1 year ago

I'm coming to XNedit after using old Nedit for something like 25 years. For the longest time, I've been using the font:

-adobe-courier-medium-r-normal--14-100-100-100-m-90-iso8859-1

The best analog I can seem to find in XNedit is:

Courier:size=11

The font size seems to match pretty well, but the line spacing looks to be about 50% greater. Is it possible to allow this to be adjusted?

unixwork commented 1 year ago

The line spacing depends on the font. It is actually possible to use old bitmap fonts like adobe courier in xnedit, and it looks just like nedit.

Manually adjusting the line spacing is currently not possible. Reducing it could lead to some rendering bugs, and you could probably save only one pixel.

For example, try to measure the space between these two lines in xnedit with your font:

g  
Â

In my case, there is only one white pixel between the two lines.

daveriesz commented 1 year ago

Screenshot from (classic) NEdit: ga-nedit line spacing is 1 pixel, total height is 21 pixels

Screenshot from XNEdit: ga-xnedit line spacing is 4 pixels, total height is 25 pixels

Is it possible to specify the font in such a way that the font renderer will reduce the line spacing? Something like:

Courier:size=11:vpadding:1

I can't find any doc describing this sort of specification string, so I'm not even sure if I'm thinking about it correctly.

Edit: The above screenshots are made using xmag.

daveriesz commented 1 year ago

Another item to note:

I'm using Ubuntu with the packages xfonts-100dpi and xfonts-75dpi installed. I can use the bitmap Courier font from these packages as you described in XNEdit.

However to do this I must remove the package "texlive-fonts-recommended" because XNEdit's font selector cannot distinguish between the "Courier" fonts in these packages.

unixwork commented 1 year ago

The font name in XNEdit is passed directly to Xft/Fontconfig. There is no attribute to change the line height.

You can check which exact font is used with the tool fc-match, for example fc-match Courier

In your screenshot the line spacing is quite high. I'm using DejaVu Sans Mono, and it has much less empty space.

DejaVu Sans Mono

daveriesz commented 1 year ago

Thanks for taking the time to explain this to me. It's clear that this isn't a defect in XNEdit. I'll close the issue.