The Birdfont Source Code


All Repositories / birdfont.git / commit – RSS feed

Fix bad text rendering

These changes was commited to the Birdfont repository Fri, 21 Dec 2018 19:30:55 +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>
Fri, 21 Dec 2018 19:30:55 +0000 (20:30 +0100)
committer Johan Mattsson <johan.mattsson.m@gmail.com>
Fri, 21 Dec 2018 19:30:55 +0000 (20:30 +0100)
commit 79d519ebac7c5304e027d6a0a15e0269437283cf
tree d022033c5fa93e073ef6ed77800a0c265d3800b1
parent c6bd30fd8186fd00f9e52609b2245e0fe3c6f1fc
Fix bad text rendering

libbirdfont/Renderer/Text.vala
--- a/libbirdfont/Renderer/Text.vala +++ b/libbirdfont/Renderer/Text.vala @@ -392,6 +392,11 @@ double py = cc_y; double w = get_sidebearing_extent () * screen_scale + x + margin_left + 1; + + if (!w.is_normal () || !h.is_normal ()) { + warning (@"Bad text size, h: $h w: $w"); + return Screen.create_background_surface (1, 1); + } cache_surface = Screen.create_background_surface ((int) w, (int) h); cr = new Context (cache_surface);