forked from openlp/openlp
Fix text outlines
bzr-revno: 769
This commit is contained in:
commit
01dc362689
@ -505,7 +505,7 @@ class Renderer(object):
|
|||||||
self.mainFont.setPixelSize(self._theme.font_main_proportion)
|
self.mainFont.setPixelSize(self._theme.font_main_proportion)
|
||||||
|
|
||||||
def _get_extent_and_render(self, line, footer, tlcorner=(0, 0), draw=False,
|
def _get_extent_and_render(self, line, footer, tlcorner=(0, 0), draw=False,
|
||||||
color=None, outline_size=None, outline_color=None):
|
color=None, outline_size=0, outline_color=None):
|
||||||
"""
|
"""
|
||||||
Find bounding box of text - as render_single_line. If draw is set,
|
Find bounding box of text - as render_single_line. If draw is set,
|
||||||
actually draw the text to the current DC as well return width and
|
actually draw the text to the current DC as well return width and
|
||||||
@ -544,21 +544,23 @@ class Renderer(object):
|
|||||||
else:
|
else:
|
||||||
pen = QtGui.QColor(color)
|
pen = QtGui.QColor(color)
|
||||||
x, y = tlcorner
|
x, y = tlcorner
|
||||||
if outline_size:
|
if self._theme.display_outline:
|
||||||
path = QtGui.QPainterPath()
|
path = QtGui.QPainterPath()
|
||||||
path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line)
|
path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line)
|
||||||
self.painter.setBrush(self.painter.pen().brush())
|
self.painter.setBrush(self.painter.pen().brush())
|
||||||
self.painter.setPen(QtGui.QPen(QtGui.QColor(outline_color), outline_size))
|
self.painter.setPen(QtGui.QPen(
|
||||||
|
QtGui.QColor(self._theme.display_outline_color), outline_size))
|
||||||
self.painter.drawPath(path)
|
self.painter.drawPath(path)
|
||||||
self.painter.setPen(pen)
|
self.painter.setPen(pen)
|
||||||
self.painter.drawText(x, y + metrics.ascent(), line)
|
self.painter.drawText(x, y + metrics.ascent(), line)
|
||||||
if self._theme.display_slideTransition:
|
if self._theme.display_slideTransition:
|
||||||
# Print 2nd image with 70% weight
|
# Print 2nd image with 70% weight
|
||||||
if outline_size:
|
if self._theme.display_outline:
|
||||||
path = QtGui.QPainterPath()
|
path = QtGui.QPainterPath()
|
||||||
path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line)
|
path.addText(QtCore.QPointF(x, y + metrics.ascent()), font, line)
|
||||||
self.painter2.setBrush(self.painter2.pen().brush())
|
self.painter2.setBrush(self.painter2.pen().brush())
|
||||||
self.painter2.setPen(QtGui.QPen(QtGui.QColor(outline_color), outline_size))
|
self.painter2.setPen(QtGui.QPen(
|
||||||
|
QtGui.QColor(self._theme.display_outline_color), outline_size))
|
||||||
self.painter2.drawPath(path)
|
self.painter2.drawPath(path)
|
||||||
self.painter2.setFont(font)
|
self.painter2.setFont(font)
|
||||||
self.painter2.setPen(pen)
|
self.painter2.setPen(pen)
|
||||||
|
Loading…
Reference in New Issue
Block a user