本文整理汇总了Python中qgis.PyQt.QtGui.QFont.setPointSizeF方法的典型用法代码示例。如果您正苦于以下问题:Python QFont.setPointSizeF方法的具体用法?Python QFont.setPointSizeF怎么用?Python QFont.setPointSizeF使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qgis.PyQt.QtGui.QFont
的用法示例。
在下文中一共展示了QFont.setPointSizeF方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_word_spacing
# 需要导入模块: from qgis.PyQt.QtGui import QFont [as 别名]
# 或者: from qgis.PyQt.QtGui.QFont import setPointSizeF [as 别名]
def test_word_spacing(self):
# Modified word spacing
font = QFont(self._TestFont)
font.setPointSizeF(30)
font.setWordSpacing(20.5)
self.lyr.textFont = font
self.checkTest()
示例2: test_letter_spacing
# 需要导入模块: from qgis.PyQt.QtGui import QFont [as 别名]
# 或者: from qgis.PyQt.QtGui.QFont import setPointSizeF [as 别名]
def test_letter_spacing(self):
# Modified letter spacing
font = QFont(self._TestFont)
font.setLetterSpacing(QFont.AbsoluteSpacing, 3.5)
font.setPointSizeF(30)
self.lyr.textFont = font
self.checkTest()
示例3: test_text_size_map_unit
# 需要导入模块: from qgis.PyQt.QtGui import QFont [as 别名]
# 或者: from qgis.PyQt.QtGui.QFont import setPointSizeF [as 别名]
def test_text_size_map_unit(self):
# Label text size in map units
self.lyr.fontSizeInMapUnits = True
font = QFont(self._TestFont)
font.setPointSizeF(460)
self.lyr.textFont = font
self._Mismatches['TestCanvasPoint'] = 776
self._ColorTols['TestComposerPdfPoint'] = 2
self.checkTest()
示例4: test_partials_labels_disabled
# 需要导入模块: from qgis.PyQt.QtGui import QFont [as 别名]
# 或者: from qgis.PyQt.QtGui.QFont import setPointSizeF [as 别名]
def test_partials_labels_disabled(self):
# Set Big font size
font = QFont(self._TestFont)
font.setPointSizeF(84)
self.lyr.textFont = font
# Disable partials labels
self._Pal.setShowingPartialsLabels(False)
self._Pal.saveEngineSettings()
self.checkTest()
示例5: test_partials_labels_enabled
# 需要导入模块: from qgis.PyQt.QtGui import QFont [as 别名]
# 或者: from qgis.PyQt.QtGui.QFont import setPointSizeF [as 别名]
def test_partials_labels_enabled(self):
# Set Big font size
font = QFont(self._TestFont)
font.setPointSizeF(84)
self.lyr.textFont = font
# Enable partials labels
self._Pal.setShowingPartialsLabels(True)
self._Pal.saveEngineSettings()
self._Mismatches['TestCanvasPoint'] = 779
self._ColorTols['TestComposerPdfPoint'] = 2
self.checkTest()
示例6: test_background_svg
# 需要导入模块: from qgis.PyQt.QtGui import QFont [as 别名]
# 或者: from qgis.PyQt.QtGui.QFont import setPointSizeF [as 别名]
def test_background_svg(self):
# Label SVG background
self.lyr.fontSizeInMapUnits = True
font = QFont(self._TestFont)
font.setPointSizeF(460)
self.lyr.textFont = font
self.lyr.shapeDraw = True
self.lyr.shapeType = QgsPalLayerSettings.ShapeSVG
svg = os.path.join(svgSymbolsPath(), "backgrounds", "background_square.svg")
self.lyr.shapeSVGFile = svg
self.lyr.shapeSizeUnits = QgsPalLayerSettings.MapUnits
self.lyr.shapeSizeType = QgsPalLayerSettings.SizeBuffer
self.lyr.shapeSize = QPointF(100.0, 0.0)
self._Mismatches["TestComposerPdfVsComposerPoint"] = 580
self._Mismatches["TestCanvasPoint"] = 776
self._ColorTols["TestComposerPdfPoint"] = 2
self.checkTest()
示例7: test_background_rect_w_offset
# 需要导入模块: from qgis.PyQt.QtGui import QFont [as 别名]
# 或者: from qgis.PyQt.QtGui.QFont import setPointSizeF [as 别名]
def test_background_rect_w_offset(self):
# Label rectangular background
self._Mismatches['TestComposerImageVsCanvasPoint'] = 800
self._Mismatches['TestComposerImagePoint'] = 800
# verify fix for issues
# http://hub.qgis.org/issues/9057
# http://gis.stackexchange.com/questions/86900
self.lyr.fontSizeInMapUnits = True
font = QFont(self._TestFont)
font.setPointSizeF(460)
self.lyr.textFont = font
self.lyr.shapeDraw = True
self.lyr.shapeOffsetUnits = QgsPalLayerSettings.MapUnits
self.lyr.shapeOffset = QPointF(-2900.0, -450.0)
self._Mismatches['TestCanvasPoint'] = 774
self._ColorTols['TestComposerPdfPoint'] = 2
self.checkTest()