| -rwxr-xr-x | slippy.py | 12 |
1 files changed, 1 insertions, 11 deletions
@@ -457,7 +457,7 @@ class Slide: i += 1 layout.set_width (int (lw * pango.SCALE)) - layout.set_markup (_remove_empty_lines (text)) + layout.set_markup (text) cr.move_to ((w - lw) * .5, (h - lh) * .5) cr.show_layout (layout) cr.restore () @@ -486,15 +486,6 @@ def _extents_intersect (ex1, ex2): y2 = min (ex1[1] + ex1[3], ex2[1] + ex2[3]) return [x1, y1, x2 - x1, y2 - y1] -def _remove_empty_lines (text): - """replace empty lines with lines of a single space. this works - around a pango bug with wrong computation of line height for empty - lines under cairo scales""" - text = text.replace ("\n\n", "\n \n") - if text.endswith ("\n"): - text += " " - return text - class Renderer: @@ -538,7 +529,6 @@ class Renderer: def create_layout (self, text, markup=True): cr = self.cr - text = _remove_empty_lines (text) layout = cr.create_layout () font_options = cairo.FontOptions () |
