aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJack Jamison <jackqjamison@gmail.com>2025-10-18 13:10:59 -0400
committerJack Jamison <jackqjamison@gmail.com>2025-10-18 13:10:59 -0400
commitacef4398df70b984ad6f2f403b2fa55c72219c73 (patch)
tree34f1a4a87929d9d4aefec12c0e015ef2b8d0ccc8
parent24fb6ee3b2d6e3c68410e439c7395f5058dabce5 (diff)
improve text rendering
-rw-r--r--README.md8
-rw-r--r--font.c6
-rw-r--r--graphics.c5
-rwxr-xr-xswenu-run.sh2
4 files changed, 10 insertions, 11 deletions
diff --git a/README.md b/README.md
index 5635cbc..7f874fc 100644
--- a/README.md
+++ b/README.md
@@ -6,12 +6,14 @@ To build: `make`
## Todo -
- [x] "selection"
- [x] figure out whats going on with stderr and exit code
-- [ ] cursor
+- [ ] unicode
- [ ] fuzzy filter and sort filtering by match %
+- [ ] cursor
- [ ] fancy highlights
- [ ] scrolling
-- [ ] unicode
- [ ] kerning
-- [ ] input fluff
- [ ] config file
- [ ] emacs keybindings
+- [ ] special mode if there is no stdin
+- [ ] input fluff
+- [ ] "prompt"
diff --git a/font.c b/font.c
index 740ba6b..1ab449a 100644
--- a/font.c
+++ b/font.c
@@ -62,7 +62,7 @@ bool freetype_init(client_state* state, const char* file) {
fprintf(stderr, "Failed to set font size\n");
return false;
}
- state->load_flags = FT_LOAD_RENDER | FT_LOAD_TARGET_(FT_RENDER_MODE_SDF);
+ state->load_flags = FT_LOAD_RENDER;
state->line_height = state->ft_face->size->metrics.height >> 6;
return true;
}
@@ -96,8 +96,8 @@ void atlas_create_texture(client_state* state) {
glGenTextures(1, &state->atlas.texture);
glBindTexture(GL_TEXTURE_2D, state->atlas.texture);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);
- glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
diff --git a/graphics.c b/graphics.c
index e2f06a1..d099d2b 100644
--- a/graphics.c
+++ b/graphics.c
@@ -42,10 +42,7 @@ in vec2 o_uv;\n\
layout (location = 0) out vec4 frag_color;\n\
\n\
void main() {\n\
- float d = texture(u_texture, o_uv).r;\n\
- float aaf = fwidth(d) * 0.5f;\n\
- float alpha = smoothstep(0.5 - aaf, 0.5 + aaf, d);\n\
- frag_color = vec4(u_color, alpha);\n\
+ frag_color = vec4(u_color, texture(u_texture, o_uv).r);\n\
}";
bool init_gl(client_state* state) {
diff --git a/swenu-run.sh b/swenu-run.sh
index 4ab3aa6..8dd9daf 100755
--- a/swenu-run.sh
+++ b/swenu-run.sh
@@ -6,4 +6,4 @@ exec $(
for file in "$dir"/*; do
[ -f "$file" ] && [ -x "$file" ] && printf '%s\n' "${file##*/}"
done
- done | sort -u | ./swenu -a)
+ done | sort -u | ./swenu -al 10)