From 6b7e073c580b905325d5a068e143900223b5ac04 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Fri, 1 Aug 2014 09:50:31 +0100 Subject: Add support for double-size rendering of internal font for headings. --- framebuffer/framebuffer.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'framebuffer/framebuffer.c') diff --git a/framebuffer/framebuffer.c b/framebuffer/framebuffer.c index 1b0c34b54..a0f39707c 100644 --- a/framebuffer/framebuffer.c +++ b/framebuffer/framebuffer.c @@ -126,12 +126,16 @@ static bool framebuffer_plot_text(int x, int y, const char *text, size_t length, const plot_font_style_t *fstyle) { enum fb_font_style style = fb_get_font_style(fstyle); + int size = fb_get_font_size(fstyle); const uint8_t *chrp; size_t nxtchr = 0; nsfb_bbox_t loc; uint32_t ucs4; + int p = FB_FONT_PITCH * size; + int w = FB_FONT_WIDTH * size; + int h = FB_FONT_HEIGHT * size; - y -= ((FB_FONT_HEIGHT * 3) / 4); + y -= ((h * 3) / 4); /* 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; @@ -145,13 +149,13 @@ static bool framebuffer_plot_text(int x, int y, const char *text, size_t length, loc.x0 = x; loc.y0 = y; - loc.x1 = loc.x0 + FB_FONT_WIDTH; - loc.y1 = loc.y0 + FB_FONT_HEIGHT; + loc.x1 = loc.x0 + w; + loc.y1 = loc.y0 + h; - chrp = fb_get_glyph(ucs4, style); - nsfb_plot_glyph1(nsfb, &loc, chrp, FB_FONT_PITCH, fstyle->foreground); + chrp = fb_get_glyph(ucs4, style, size); + nsfb_plot_glyph1(nsfb, &loc, chrp, p, fstyle->foreground); - x += FB_FONT_WIDTH; + x += w; } -- cgit v1.2.3