Closed mjkloeckner closed 1 year ago
Could this constant be derived from font metrics to support user customizable fonts in the future? Relevant docs: https://freetype.org/freetype2/docs/glyphs/glyphs-3.html
linespace = ascent - descent + linegap
Well, I already tested the cursor offset with other fonts (Ubuntu Mono, JetBrains, FiraCode) and the offset looks good in all cases. I leave you some screenshots:
I did notice though, that in some fonts (for example Victor Mono) there are characters bigger than the cursor, so maybe what you are saying applies when the cursor size is being computed?
@mjkloeckner looks good to me! :+1: Thank you for your contribution!
Adds an offset to the cursor and the selected text in editor mode, as well as the selected file in file browser mode.
The offset is a constant defined in
src/common.h
that is added to they
coordinate of the respective cursor when being rendered.