From befac6668eab41849b0e638b20c2636e82328fb4 Mon Sep 17 00:00:00 2001 From: Nathan Reiner Date: Sun, 30 Apr 2023 09:35:29 +0200 Subject: add mouse support --- drw.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drw.c') diff --git a/drw.c b/drw.c index 3800de5..a131623 100644 --- a/drw.c +++ b/drw.c @@ -413,7 +413,7 @@ load_bitmap(Font *font, uint_least32_t charcode) } FT_Get_Glyph(slot, &glyph); - FT_Glyph_StrokeBorder(&glyph, font->stroke, 0, 1); + error = FT_Glyph_StrokeBorder(&glyph, font->stroke, 0, 1); if (error) { fprintf(stderr, "warning: could not apply stroke\n"); return cglyph; @@ -441,17 +441,19 @@ draw_char(Canvas *canvas, FontCache *fontcache, uint_least32_t charcode, unsigne { Font *font; CacheGlyph cg; + unsigned stroke_size; font = get_font_with_charcode(fontcache, charcode); FT_Set_Pixel_Sizes(font->face, 0, fontcache->fontsize); if (boldstokemode && fontcache->fonttype == FONT_BOLD) { - FT_Stroker_Set(font->stroke, fontcache->fontsize * 2, FT_STROKER_LINECAP_BUTT, FT_STROKER_LINEJOIN_ROUND, fontcache->fontsize * 2); - y -= fontcache->fontsize * 2 / 64 + 1; + stroke_size = fontcache->fontsize * 2; } else { - FT_Stroker_Set(font->stroke, 0, FT_STROKER_LINECAP_BUTT, FT_STROKER_LINEJOIN_ROUND, 0); + stroke_size = 0; } + FT_Stroker_Set(font->stroke, stroke_size, FT_STROKER_LINECAP_BUTT, FT_STROKER_LINEJOIN_ROUND, 0); + cg = load_bitmap(font, charcode); if (cg.bg == 0) -- cgit v1.2.3-70-g09d2