diff --git a/font.c b/font.c index 229425e..596794a 100644 --- a/font.c +++ b/font.c @@ -285,13 +285,13 @@ from_font_set(FcPattern *pattern, FcFontSet *fonts, int start_idx, font->is_fallback = is_fallback; font->ref_counter = 1; - font->fextents.height = height * font->pixel_size_fixup; - font->fextents.descent = -descent * font->pixel_size_fixup; - font->fextents.ascent = ascent * font->pixel_size_fixup; - font->fextents.max_x_advance = max_x_advance * font->pixel_size_fixup; + font->height = height * font->pixel_size_fixup; + font->descent = -descent * font->pixel_size_fixup; + font->ascent = ascent * font->pixel_size_fixup; + font->max_x_advance = max_x_advance * font->pixel_size_fixup; LOG_DBG("metrics: height: %d, descent: %d, ascent: %d, x-advance: %d", - height, descent, ascent, max_x_advance); + font->height, font->descent, font->ascent, font->max_x_advance); if (!is_fallback) { font->fc_pattern = pattern; diff --git a/font.h b/font.h index 9021904..54da41e 100644 --- a/font.h +++ b/font.h @@ -41,12 +41,10 @@ struct font { double pixel_size_fixup; /* Scale factor - should only be used with ARGB32 glyphs */ bool bgr; /* True for FC_RGBA_BGR and FC_RGBA_VBGR */ - struct { - int height; - int descent; - int ascent; - int max_x_advance; - } fextents; + int height; + int descent; + int ascent; + int max_x_advance; struct { int position; diff --git a/particles/string.c b/particles/string.c index ec1fcdd..b857f49 100644 --- a/particles/string.c +++ b/particles/string.c @@ -97,8 +97,8 @@ expose(const struct exposable *exposable, pixman_image_t *pix, int x, int y, int * font family. */ const double baseline = (double)y + - (double)(height + font->fextents.ascent + font->fextents.descent) / 2.0 - - (font->fextents.descent > 0 ? font->fextents.descent : 0); + (double)(height + font->ascent + font->descent) / 2.0 - + (font->descent > 0 ? font->descent : 0); x += exposable->particle->left_margin;