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()
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()
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()
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()
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()
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()