The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – 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
[Sun, 13 Dec 2015 18:18:39 +0000]

Updated Files

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 (); }