diff options
| author | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-04-30 09:35:29 +0200 |
|---|---|---|
| committer | Nathan Reiner <nathan@nathanreiner.xyz> | 2023-04-30 09:35:29 +0200 |
| commit | befac6668eab41849b0e638b20c2636e82328fb4 (patch) | |
| tree | e1ddc08c1a0095a5948a7ee9dcc4efc1899ce629 /drw.c | |
| parent | 93044651200982abc936d727c0447b911dfe36b8 (diff) | |
add mouse support
Diffstat (limited to 'drw.c')
| -rw-r--r-- | drw.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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) |