← Back to team overview

openlp-core team mailing list archive

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

 

Jonathan Corwin has proposed merging lp:~j-corwin/openlp/bug-891775 into lp:openlp.

Requested reviews:
  OpenLP Core (openlp-core)
Related bugs:
  Bug #891775 in OpenLP: "Bottom aligned display text is cut short below base line"
  https://bugs.launchpad.net/openlp/+bug/891775

For more details, see:
https://code.launchpad.net/~j-corwin/openlp/bug-891775/+merge/98752

When the theme is bottom-aligned, stop the tails for y's and g's from being chopped off.
-- 
https://code.launchpad.net/~j-corwin/openlp/bug-891775/+merge/98752
Your team OpenLP Core is requested to review the proposed merge of lp:~j-corwin/openlp/bug-891775 into lp:openlp.
=== modified file 'openlp/core/lib/htmlbuilder.py'
--- openlp/core/lib/htmlbuilder.py	2012-01-07 23:03:14 +0000
+++ openlp/core/lib/htmlbuilder.py	2012-03-21 22:36:45 +0000
@@ -458,13 +458,18 @@
     # fix tag incompatibilities
     if theme.display_horizontal_align == HorizontalType.Justify:
         justify = u''
+    if theme.display_vertical_align == VerticalType.Bottom:
+        padding_bottom = u'0.5em'
+    else:
+        padding_bottom = u'0'
     lyrics = u'%s word-wrap: break-word; ' \
         'text-align: %s; vertical-align: %s; font-family: %s; ' \
         'font-size: %spt; color: %s; line-height: %d%%; margin: 0;' \
-        'padding: 0; padding-left: %spx; width: %spx; height: %spx; ' % \
+        'padding: 0; padding-bottom: %s; padding-left: %spx; width: %spx;' \
+        'height: %spx; ' % \
         (justify, align, valign, theme.font_main_name, theme.font_main_size,
         theme.font_main_color, 100 + int(theme.font_main_line_adjustment),
-        left_margin, width, height)
+        padding_bottom, left_margin, width, height)
     if theme.font_main_outline:
         if webkit_version() <= 534.3:
             lyrics += u' letter-spacing: 1px;'

=== modified file 'openlp/core/lib/renderer.py'
--- openlp/core/lib/renderer.py	2011-12-27 10:33:55 +0000
+++ openlp/core/lib/renderer.py	2012-03-21 22:36:45 +0000
@@ -289,7 +289,7 @@
 
     def _calculate_default(self):
         """
-        Calculate the default dimentions of the screen.
+        Calculate the default dimensions of the screen.
         """
         screen_size = self.screens.current[u'size']
         self.width = screen_size.width()
@@ -380,6 +380,7 @@
             (build_lyrics_format_css(self.theme_data, self.page_width,
             self.page_height), build_lyrics_outline_css(self.theme_data))
         self.web.setHtml(html)
+        self.empty_height = self.web_frame.contentsSize().height()
 
     def _paginate_slide(self, lines, line_end):
         """
@@ -600,7 +601,7 @@
         """
         self.web_frame.evaluateJavaScript(u'show_text("%s")' %
             text.replace(u'\\', u'\\\\').replace(u'\"', u'\\\"'))
-        return self.web_frame.contentsSize().height() <= self.page_height
+        return self.web_frame.contentsSize().height() <= self.empty_height
 
     def _words_split(self, line):
         """


Follow ups