Introduce subpixel text positioning within rencache

In order to fix the issue with cursor positioning a subpixel-aware draw
text operation within rencache was required.

With this modification the cursor positioning problem is completely
resolved.

A new function renderer.draw_text_subpixel is introduced to perform
consecutive, inline, text drawings with subpixel accuracy.
This commit is contained in:
Francesco Abbate
2021-03-06 18:12:02 +01:00
parent 9ff6a0325e
commit 3426bc5d73
6 changed files with 51 additions and 24 deletions
+1 -1
View File
@@ -8,7 +8,7 @@ void rencache_show_debug(bool enable);
void rencache_free_font(RenFont *font);
void rencache_set_clip_rect(RenRect rect);
void rencache_draw_rect(RenRect rect, RenColor color);
int rencache_draw_text(RenFont *font, const char *text, int x, int y, RenColor color);
int rencache_draw_text(RenFont *font, const char *text, int x, int y, RenColor color, bool draw_subpixel);
void rencache_invalidate(void);
void rencache_begin_frame(void);
void rencache_end_frame(void);