summaryrefslogtreecommitdiff
authorBehdad Esfahbod <behdad@behdad.org>2010-05-04 17:47:33 (GMT)
committer Behdad Esfahbod <behdad@behdad.org>2010-05-04 17:47:33 (GMT)
commit9fd84fa983fd32c081c9edfb2a02c844f13b0d49 (patch) (side-by-side diff)
tree7cf20dd7d4af324a3e9f47c6019cf8415aba90eb
parent134652526b8c45ed183dfefcbbd565c4d35c0346 (diff)
downloadslippy-master.zip
slippy-master.tar.gz
Remove empty_lines hack since Pango master is fixed nowHEADmaster
Diffstat (more/less context) (ignore whitespace changes)
-rwxr-xr-xslippy.py12
1 files changed, 1 insertions, 11 deletions
diff --git a/slippy.py b/slippy.py
index 4ed3d84..a42c542 100755
--- a/slippy.py
+++ b/slippy.py
@@ -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 ()