Implement subpixel LCD font rendering

This commit is contained in:
Francesco Abbate committed 2020-06-04 16:29:28 +02:00
1 parent f61ffc4710
commit a0e7d16167
6 files changed
+218 -116

No files matched your search

+2 -1
View File
@@ -81,9 +81,10 @@ static GlyphSet* load_glyphset_agg(RenFont *font, int idx) {
retry:
set->image = ren_new_image(width, height);
const int subpixel_scale = 3;
int res = FontRendererBakeFontBitmap(font->renderer, font->height,
(void *) set->image->pixels, width, height,
idx << 8, 256, set->glyphs);
idx << 8, 256, set->glyphs, subpixel_scale);
/* retry with a larger image buffer if the buffer wasn't large enough */
if (res < 0) {