Merge lp:~j-corwin/openlp/bug-891775 into lp:openlp

Proposed by Jonathan Corwin
Status: Merged
Merged at revision: 1914
Proposed branch: lp:~j-corwin/openlp/bug-891775
Merge into: lp:openlp
Diff against target: 54 lines (+10/-4)
2 files modified
openlp/core/lib/htmlbuilder.py (+7/-2)
openlp/core/lib/renderer.py (+3/-2)
To merge this branch: bzr merge lp:~j-corwin/openlp/bug-891775
Reviewer Review Type Date Requested Status
Raoul Snyman Approve
Tim Bentley Approve
Review via email: mp+98752@code.launchpad.net

Description of the change

When the theme is bottom-aligned, stop the tails for y's and g's from being chopped off.

To post a comment you must log in.
Revision history for this message
Tim Bentley (trb143) :
review: Approve
Revision history for this message
Raoul Snyman (raoul-snyman) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'openlp/core/lib/htmlbuilder.py'
2--- openlp/core/lib/htmlbuilder.py 2012-01-07 23:03:14 +0000
3+++ openlp/core/lib/htmlbuilder.py 2012-03-21 22:36:45 +0000
4@@ -458,13 +458,18 @@
5 # fix tag incompatibilities
6 if theme.display_horizontal_align == HorizontalType.Justify:
7 justify = u''
8+ if theme.display_vertical_align == VerticalType.Bottom:
9+ padding_bottom = u'0.5em'
10+ else:
11+ padding_bottom = u'0'
12 lyrics = u'%s word-wrap: break-word; ' \
13 'text-align: %s; vertical-align: %s; font-family: %s; ' \
14 'font-size: %spt; color: %s; line-height: %d%%; margin: 0;' \
15- 'padding: 0; padding-left: %spx; width: %spx; height: %spx; ' % \
16+ 'padding: 0; padding-bottom: %s; padding-left: %spx; width: %spx;' \
17+ 'height: %spx; ' % \
18 (justify, align, valign, theme.font_main_name, theme.font_main_size,
19 theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
20- left_margin, width, height)
21+ padding_bottom, left_margin, width, height)
22 if theme.font_main_outline:
23 if webkit_version() <= 534.3:
24 lyrics += u' letter-spacing: 1px;'
25
26=== modified file 'openlp/core/lib/renderer.py'
27--- openlp/core/lib/renderer.py 2011-12-27 10:33:55 +0000
28+++ openlp/core/lib/renderer.py 2012-03-21 22:36:45 +0000
29@@ -289,7 +289,7 @@
30
31 def _calculate_default(self):
32 """
33- Calculate the default dimentions of the screen.
34+ Calculate the default dimensions of the screen.
35 """
36 screen_size = self.screens.current[u'size']
37 self.width = screen_size.width()
38@@ -380,6 +380,7 @@
39 (build_lyrics_format_css(self.theme_data, self.page_width,
40 self.page_height), build_lyrics_outline_css(self.theme_data))
41 self.web.setHtml(html)
42+ self.empty_height = self.web_frame.contentsSize().height()
43
44 def _paginate_slide(self, lines, line_end):
45 """
46@@ -600,7 +601,7 @@
47 """
48 self.web_frame.evaluateJavaScript(u'show_text("%s")' %
49 text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
50- return self.web_frame.contentsSize().height() <= self.page_height
51+ return self.web_frame.contentsSize().height() <= self.empty_height
52
53 def _words_split(self, line):
54 """