The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix text alignment to pixel grid

These changes was commited to the Birdfont repository Sun, 13 Dec 2015 18:18:39 +0000.

Contributing

Send patches or pull requests to johan.mattsson.m@gmail.com.
Clone this repository: git clone https://github.com/johanmattssonm/birdfont.git
author Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 13 Dec 2015 18:18:39 +0000 (19:18 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Sun, 13 Dec 2015 18:19:06 +0000 (19:19 +0100)
commit f1a33ba5f3d741dd178a134cd3c44e59257afcf7
tree ba778443394cd5d518f381bc0181dcf66b74ce1c
parent be6a3636f34e151d70c124cbd30707ee0a9b69a9
Fix text alignment to pixel grid

libbirdfont/Renderer/Text.vala
--- a/libbirdfont/Renderer/Text.vala +++ b/libbirdfont/Renderer/Text.vala @@ -13,6 +13,7 @@ */ using Cairo; + using Math; namespace BirdFont { @@ -338,7 +339,7 @@ double s = get_font_scale (); double cache_y = py - s * (cached_font.top_limit - cached_font.base_line); - cr.set_source_surface ((!) cache, (int) px, (int) cache_y); + cr.set_source_surface ((!) cache, (int) rint (px), (int) rint (cache_y)); cr.paint (); }