| author | Behdad Esfahbod <behdad@behdad.org> | 2010-05-04 17:47:33 (GMT) |
|---|---|---|
| committer | Behdad Esfahbod <behdad@behdad.org> | 2010-05-04 17:47:33 (GMT) |
| commit | 9fd84fa983fd32c081c9edfb2a02c844f13b0d49 (patch) (side-by-side diff) | |
| tree | 7cf20dd7d4af324a3e9f47c6019cf8415aba90eb | |
| parent | 134652526b8c45ed183dfefcbbd565c4d35c0346 (diff) | |
| download | slippy-master.zip slippy-master.tar.gz | |
| -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 () |
