diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2019-11-27 20:33:08 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2019-11-27 20:33:08 +0000 |
| commit | c5602fde9604fc330bec58c806d70be261cb2bf3 (patch) | |
| tree | cf311e5ca310e65688cd94144da677c235784fdc /font.c | |
| parent | generate-version: redirect *both* stdout and stderr to /dev/null (diff) | |
font: set pixman filter when re-scaling glyph
Diffstat (limited to 'font.c')
| -rw-r--r-- | font.c | 19 |
1 files changed, 5 insertions, 14 deletions
@@ -639,27 +639,18 @@ glyph_for_wchar(const struct font *font, wchar_t wc, struct glyph *glyph) bitmap->pixel_mode == FT_PIXEL_MODE_LCD || bitmap->pixel_mode == FT_PIXEL_MODE_LCD_V); - struct pixman_transform trans; - pixman_transform_init_identity(&trans); if (font->pixel_size_fixup != 1.) { + struct pixman_transform scale; + pixman_transform_init_identity(&scale); pixman_transform_scale( - &trans, NULL, + &scale, NULL, pixman_double_to_fixed(1.0 / font->pixel_size_fixup), pixman_double_to_fixed(1.0 / font->pixel_size_fixup)); + pixman_image_set_transform(pix, &scale); + pixman_image_set_filter(pix, PIXMAN_FILTER_BEST, NULL, 0); } - /* Figure out if we can use a translate transform instead of setting x/y in glyph */ -#if 0 - LOG_DBG("**** %f", font->face->glyph->bitmap_top * fixup - baseline); - - pixman_transform_translate( - &trans, NULL, - pixman_double_to_fixed(font->face->glyph->bitmap_left), - pixman_double_to_fixed(-(baseline / fixup - font->face->glyph->bitmap_top))); -#endif - - pixman_image_set_transform(pix, &trans); *glyph = (struct glyph){ .wc = wc, |
