From 00b58cb05bad0ae8a51d25bb6ab5f2d348639ece Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Sep 2016 18:37:52 +0200 Subject: [PATCH] - shellexec: add hack to get descender of font --- text.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/text.c b/text.c index dd000d2..8d58e2c 100644 --- a/text.c +++ b/text.c @@ -253,6 +253,17 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color) return 0; } + int _d = 0; + if (1) + { + //printf("shellexec \n"); + FT_UInt _i = FT_Get_Char_Index(face, 'g'); + FTC_SBit _g; + FTC_SBitCache_Lookup(cache, &desc, _i, &_g, NULL); + _d = _g->height - _g->top; + _d += 1; + } + if(use_kerning) { FT_Get_Kerning(face, prev_glyphindex, glyphindex, ft_kerning_default, &kerning); @@ -268,7 +279,7 @@ int RenderChar(FT_ULong currentchar, int _sx, int _sy, int _ex, int color) uint32_t bgcolor = *(lbb + (starty + _sy) * stride + (startx + _sx)); uint32_t fgcolor = bgra[color]; uint32_t *colors = lookup_colors(fgcolor, bgcolor); - uint32_t *p = lbb + (startx + _sx + sbit->left + kerning.x) + stride * (starty + _sy - sbit->top); + uint32_t *p = lbb + (startx + _sx + sbit->left + kerning.x) + stride * (starty + _sy - sbit->top - _d); uint32_t *r = p + (_ex - _sx); /* end of usable box */ for(row = 0; row < sbit->height; row++) { -- 2.39.5