font: ceil and scale glyph horizontal advance

This commit is contained in:
Daniel Eklöf 2019-11-27 21:42:35 +01:00
parent 303b61a2e6
commit fa725c69d5
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

4
font.c
View file

@ -4,7 +4,7 @@
#include <stdint.h>
#include <stdbool.h>
#include <wchar.h>
//#include <math.h>
#include <math.h>
#include <assert.h>
#include <threads.h>
@ -581,7 +581,7 @@ glyph_for_wchar(const struct font *font, wchar_t wc, struct glyph *glyph)
.pix = pix,
.x = font->face->glyph->bitmap_left * font->pixel_size_fixup,
.y = font->face->glyph->bitmap_top * font->pixel_size_fixup,
.x_advance = font->face->glyph->advance.x / 64,
.x_advance = ceil(font->face->glyph->advance.x / 64) * font->pixel_size_fixup,
.width = width,
.height = rows,
.valid = true,