The Birdfont Source Code


All Repositories / birdfont.git / commitdiff – 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
[Fri, 21 Dec 2018 19:30:55 +0000]

Updated Files

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