vtgl

terminal emulator implemented in OpenGL
git clone anongit@rnpnr.xyz:vtgl.git
Log | Files | Refs | Feed | LICENSE

Commit: 0b42f34f01f856160187761fa4af6ca3b76b6fb4
Parent: 369f2e36d8cba0ca74369a1ec4497537f62d21b3
Author: Randy Palamar
Date:   Mon,  2 Sep 2024 15:41:19 -0600

update comment about term top-left and subpixel rendering

Diffstat:
Mvtgl.c | 8++++++--
1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/vtgl.c b/vtgl.c @@ -86,10 +86,14 @@ get_occupied_size(Term *t) static v2 get_terminal_top_left(Term *t) { + /* NOTE: There is trade-off here: you can center the usable area which looks good but + * causes the contents to jump around when resizing; or you can only consider the global + * padding and have the contents fixed while resizing. We are choosing the former! */ + /* IMPORTANT: Assume the glyphs already have subpixel rendering so cells must be aligned + * on pixels. No harm if they don't but if they do and we don't align on pixels they + * will look like crap. */ v2 os = get_occupied_size(t); v2 delta = {.x = t->gl.window_size.w - os.w, .y = t->gl.window_size.h - os.h}; - /* NOTE: IMPORTANT: freetype fonts already have subpixel rendering so cells must - * be aligned on pixels. If they are not glyphs will look like crap */ v2 result = {.x = (u32)(delta.x / 2), .y = (u32)(t->gl.window_size.h - delta.y / 2)}; return result; }