diff --git a/openlp/core/lib/htmlbuilder.py b/openlp/core/lib/htmlbuilder.py index 0782dd717..182f91023 100644 --- a/openlp/core/lib/htmlbuilder.py +++ b/openlp/core/lib/htmlbuilder.py @@ -126,22 +126,38 @@ def build_lyrics(item, width, height): lyrics = """ #lyrics { position: absolute; - left: 0px; - top: 0px; - width: 1024px; - height: 768px; + %s z-index:3; %s; %s; - font-family %s; - font-size: %spx; + %s + %s } """ theme = item.themedata lyrics_html = u'' + position = u'' shadow = u'' outline = u'' + font = u'' + text = u'' if theme: + position = u' left: %spx; top: %spx; width: %spx; height: %spx; ' %\ + (item.main.x(), item.main.y(), item.main.width(), item.main.height()) + font = u' font-family %s; font-size: %spx;' %\ + (theme.font_main_name, theme.font_main_proportion) + align = u'' + if theme.display_horizontalAlign == 2: + align = u'align=center;' + elif theme.display_horizontalAlign == 1: + align = u'align=right;' + if theme.display_verticalAlign == 2: + valign = u'vertical-align=top;' + elif theme.display_verticalAlign == 1: + valign = u'vertical-align=middle;' + else: + valign = u'vertical-align=bottom;' + text = u'color:%s;%s%s' % (theme.font_main_color, align, valign) if theme.display_shadow: shadow = u'text-shadow: %spx %spx %spx %s' %\ (theme.display_shadow_size, theme.display_shadow_size, @@ -151,7 +167,7 @@ def build_lyrics(item, width, height): outline = u'text-outline: %spx 1px %s' %\ (theme.display_outline_size, theme.display_outline_color) outline = u'text-shadow: -1px 0 white, 0 1px white, 1px 0 white, 0 -1px white' - lyrics_html = lyrics % (shadow, outline, theme.font_main_name, theme.font_main_proportion) + lyrics_html = lyrics % (position, shadow, outline, font, text) print lyrics_html return lyrics_html diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 50dece0dd..e4ef6d10b 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -173,12 +173,15 @@ class Renderer(object): myCursor = QtGui.QTextCursor(doc) layout = doc.documentLayout() formatted = [] - if self._theme.display_horizontalAlign == 2: - shell = "

%s

" - elif self._theme.display_horizontalAlign == 1: - shell = "

%s

" - else: - shell = "

%s

" +# if self._theme.display_horizontalAlign == 2: +# shell = """

""" %\ +# self._theme.font_main_color +# elif self._theme.display_horizontalAlign == 1: +# shell = """

""" %\ +# self._theme.font_main_color +# else: +# shell = """

""" % self._theme.font_main_color + shell = u'

%s

' temp_text = u'' old_html_text = u'' page = []