From 279c34a67e60338ad4c4c7a3e02693866d2929ee Mon Sep 17 00:00:00 2001 From: Tim Bentley Date: Sat, 1 Aug 2009 19:03:07 +0100 Subject: [PATCH] Add theme bold/Italics to renderer --- openlp/core/lib/renderer.py | 8 +++++--- openlp/core/lib/themexmlhandler.py | 4 ++++ openlp/core/ui/amendthemedialog.py | 30 ++++++++++++++++++++++++++++++ 3 files changed, 39 insertions(+), 3 deletions(-) diff --git a/openlp/core/lib/renderer.py b/openlp/core/lib/renderer.py index 957818132..d6ef78434 100644 --- a/openlp/core/lib/renderer.py +++ b/openlp/core/lib/renderer.py @@ -558,13 +558,15 @@ class Renderer(object): """ self.footerFont = QtGui.QFont(self._theme.font_footer_name, int(self._theme.font_footer_proportion), # size - QtGui.QFont.Normal, # weight - 0)# italic + int(self._theme.font_footer_weight), # weight + 0)# italic + self.footerFont.setItalic(int(self._theme.font_footer_italics)) self.footerFont.setPixelSize(int(self._theme.font_footer_proportion)) self.mainFont = QtGui.QFont(self._theme.font_main_name, int(self._theme.font_main_proportion), # size - QtGui.QFont.Normal, # weight + int(self._theme.font_main_weight), # weight 0)# italic + self.mainFont.setItalic(int(self._theme.font_main_italics)) self.mainFont.setPixelSize(int(self._theme.font_main_proportion)) def _get_extent_and_render(self, line, footer, tlcorner=(0, 0), draw=False, color=None): diff --git a/openlp/core/lib/themexmlhandler.py b/openlp/core/lib/themexmlhandler.py index acb451653..bbb4a0c2a 100644 --- a/openlp/core/lib/themexmlhandler.py +++ b/openlp/core/lib/themexmlhandler.py @@ -46,12 +46,16 @@ blankthemexml=\ Arial #000000 30 + 50 + 0 Arial #000000 12 + 50 + 0 diff --git a/openlp/core/ui/amendthemedialog.py b/openlp/core/ui/amendthemedialog.py index cd0f83cf8..045d78470 100644 --- a/openlp/core/ui/amendthemedialog.py +++ b/openlp/core/ui/amendthemedialog.py @@ -165,6 +165,16 @@ class Ui_AmendThemeDialog(object): self.FontMainSizeSpinBox.setMaximum(999) self.FontMainSizeSpinBox.setObjectName(u'FontMainSizeSpinBox') self.MainFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontMainSizeSpinBox) + self.FontMainWeightComboBox = QtGui.QComboBox(self.FontMainGroupBox) + self.FontMainWeightComboBox.setObjectName("FontMainWeightComboBox") + self.FontMainWeightComboBox.addItem(QtCore.QString()) + self.FontMainWeightComboBox.addItem(QtCore.QString()) + self.FontMainWeightComboBox.addItem(QtCore.QString()) + self.FontMainWeightComboBox.addItem(QtCore.QString()) + self.MainFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontMainWeightComboBox) + self.FontMainWeightLabel = QtGui.QLabel(self.FontMainGroupBox) + self.FontMainWeightLabel.setObjectName("FontMainWeightLabel") + self.MainFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontMainWeightLabel) self.MainLeftLayout.addWidget(self.FontMainGroupBox) spacerItem1 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.MainLeftLayout.addItem(spacerItem1) @@ -292,6 +302,16 @@ class Ui_AmendThemeDialog(object): self.FontFooterSizeSpinBox.setMaximum(999) self.FontFooterSizeSpinBox.setObjectName(u'FontFooterSizeSpinBox') self.FooterFontLayout.setWidget(2, QtGui.QFormLayout.FieldRole, self.FontFooterSizeSpinBox) + self.FontFooterWeightComboBox = QtGui.QComboBox(self.FooterFontGroupBox) + self.FontFooterWeightComboBox.setObjectName("FontFooterWeightComboBox") + self.FontFooterWeightComboBox.addItem(QtCore.QString()) + self.FontFooterWeightComboBox.addItem(QtCore.QString()) + self.FontFooterWeightComboBox.addItem(QtCore.QString()) + self.FontFooterWeightComboBox.addItem(QtCore.QString()) + self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.FieldRole, self.FontFooterWeightComboBox) + self.FontFooterWeightLabel = QtGui.QLabel(self.FooterFontGroupBox) + self.FontFooterWeightLabel.setObjectName("FontFooterWeightLabel") + self.FooterFontLayout.setWidget(3, QtGui.QFormLayout.LabelRole, self.FontFooterWeightLabel) self.FooterLeftLayout.addWidget(self.FooterFontGroupBox) spacerItem3 = QtGui.QSpacerItem(20, 40, QtGui.QSizePolicy.Minimum, QtGui.QSizePolicy.Expanding) self.FooterLeftLayout.addItem(spacerItem3) @@ -550,6 +570,11 @@ class Ui_AmendThemeDialog(object): self.FontMainColorLabel.setText(translate(u'AmendThemeDialog', u'Font Color:')) self.FontMainSize.setText(translate(u'AmendThemeDialog', u'Size:')) self.FontMainSizeSpinBox.setSuffix(translate(u'AmendThemeDialog', u'pt')) + self.FontMainWeightComboBox.setItemText(0, translate("AmendThemeDialog", u'Normal')) + self.FontMainWeightComboBox.setItemText(1, translate("AmendThemeDialog", u'Bold')) + self.FontMainWeightComboBox.setItemText(2, translate("AmendThemeDialog", u'Italics')) + self.FontMainWeightComboBox.setItemText(3, translate("AmendThemeDialog", u'Bold/Italics')) + self.FontMainWeightLabel.setText(translate("AmendThemeDialog", u'Font Weight:')) self.MainLocationGroupBox.setTitle(translate(u'AmendThemeDialog', u'Display Location')) self.DefaultLocationLabel.setText(translate(u'AmendThemeDialog', u'Use Default Location:')) self.FontMainXLabel.setText(translate(u'AmendThemeDialog', u'X Position:')) @@ -566,6 +591,11 @@ class Ui_AmendThemeDialog(object): self.FontFooterColorLabel.setText(translate(u'AmendThemeDialog', u'Font Color:')) self.FontFooterSizeLabel.setText(translate(u'AmendThemeDialog', u'Size:')) self.FontFooterSizeSpinBox.setSuffix(translate(u'AmendThemeDialog', u'pt')) + self.FontFooterWeightComboBox.setItemText(0, translate("AmendThemeDialog", u'Normal')) + self.FontFooterWeightComboBox.setItemText(1, translate("AmendThemeDialog", u'Bold')) + self.FontFooterWeightComboBox.setItemText(2, translate("AmendThemeDialog", u'Italics')) + self.FontFooterWeightComboBox.setItemText(3, translate("AmendThemeDialog", u'Bold/Italics')) + self.FontFooterWeightLabel.setText(translate("AmendThemeDialog", u'Font Weight:')) self.LocationFooterGroupBox.setTitle(translate(u'AmendThemeDialog', u'Display Location')) self.FontFooterDefaultLabel.setText(translate(u'AmendThemeDialog', u'Use Default Location:')) self.FontFooterXLabel.setText(translate(u'AmendThemeDialog', u'X Position:'))