aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2022-02-15 23:36:15 +0100
committerdec05eba <dec05eba@protonmail.com>2022-02-15 23:36:15 +0100
commitcac754b9f5d4695bd6416ac94fcab22423a854f9 (patch)
treeee90f9233906098a2d843f4cea8dc9f584253243
parent347a6fa2795a6856c1ad3d623673b62f879227c1 (diff)
Render missing glyphs as a crossed out box
-rw-r--r--TODO3
-rw-r--r--src/graphics/font.c4
2 files changed, 2 insertions, 5 deletions
diff --git a/TODO b/TODO
index bd0a782..5ffb9c1 100644
--- a/TODO
+++ b/TODO
@@ -4,4 +4,5 @@ Support using multiple textures in shaders by using glActiveTexture for each one
Make sure clock is monotonic (there has been some issues with CLOCK\_MONOTONIC not being monotonic on linux).\
Verify if using a separate glx context for every window is the correct approach.\
Experiment with reducing latency by removing GLX_DOUBLEBUFFER and using glFlush&&glFinish&&glXWaitVideoSyncSGI(1, 0, &rem);. Only glFinish is needed when using a compositor and that fixes the flickering. Flipping also needs to be enabled in gpu driver settings. Use glXWaitVideoSyncSGI to limit fps to vsync. Tearing fix with flipping for fullscreen applications only works when fullscreen covers all monitors which is usually not the case, so it really only works when one monitor is plugged in.\
-High precision mouse wheel event by using xi2, which also allows us to get which scroll wheel was used and scrolling in y direction. \ No newline at end of file
+High precision mouse wheel event by using xi2, which also allows us to get which scroll wheel was used and scrolling in y direction.\
+Only render one glyph for missing symbols. \ No newline at end of file
diff --git a/src/graphics/font.c b/src/graphics/font.c
index 603b1d4..9a99f22 100644
--- a/src/graphics/font.c
+++ b/src/graphics/font.c
@@ -193,10 +193,6 @@ int mgl_font_get_glyph(mgl_font *self, uint32_t codepoint, mgl_font_glyph *glyph
*/
const int glyph_index = stbtt_FindGlyphIndex(self->font_info, codepoint);
- if(glyph_index == 0) {
- memset(glyph, 0, sizeof(mgl_font_glyph));
- return -1;
- }
const float font_scale = stbtt_ScaleForPixelHeight(self->font_info, self->character_size*GLYPH_UPSAMPLE);
int advance = 0;