From 888d8eac4f102f6ecb75878e7717c3495e81a215 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 26 Jul 2012 17:37:44 +0100 Subject: A few tweaks from when I was looking for internal font renderer bug in wrong place. --- framebuffer/framebuffer.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c index 9195398cf..fda8aae0d 100644 --- a/framebuffer/framebuffer.c +++ b/framebuffer/framebuffer.c @@ -136,12 +136,14 @@ static bool framebuffer_plot_text(int x, int y, const char *text, size_t length, if (buffer == NULL) return true; - /* y is given to the fonts baseline we need it to the fonts top */ - y-=((fb_font->height * 75)/100); + /* y is given as the baseline, at 3/4 from top. + * we need it to the top */ + y -= ((fb_font->height * 3) / 4); - y+=1; /* the coord is the bottom-left of the pixels offset by 1 to make - * it work since fb coords are the top-left of pixels - */ + /* the coord is the bottom-left of the pixels offset by 1 to make + * it work since fb coords are the top-left of pixels + */ + y += 1; blen = strlen(buffer); @@ -154,7 +156,7 @@ static bool framebuffer_plot_text(int x, int y, const char *text, size_t length, chrp = fb_font->data + ((unsigned char)buffer[chr] * fb_font->height); nsfb_plot_glyph1(nsfb, &loc, (uint8_t *)chrp, 32, fstyle->foreground); - x+=fb_font->width; + x += fb_font->width; } -- cgit v1.2.3