qgis/QGIS — pull request #1286 by dakcarto (2014-04-01 16:01:41+00:00)
Title: Fix for issue 3975, labeling svg as text

Reinstates output of text-as-text for use in SVG, PDF and PS exports.

**Implements the following:**

* Labeling engine (per project) setting.
* Labeling engine option overrides as `QgsMapSettings` properties. Allows all map rendering options to be encapsulated in `QgsMapSettings` and programmatically set without having to edit user's project settings. For example: `QgsMapRendererSequentialJob(mapsettings)`, where the instantiation of `QgsPalLabeling` is embedded in the class and not publicly accessible.
* Text-as-outlines (vectorized) remains the default, with text-as-text optional.
* `QImage::Format` can now be defined for render jobs' backend `QImage`, via `QgsMapSettings` property.
* Does *not* implement any optional choosing of text output mode during SVG or PDF export. These should be added.

**Preliminary (non-unit) testing results:**

* Since the label buffer is already drawn as text-as-outline, the use of text-as-text over the buffer resulted in poor registration. Text-as-text does not include any allowance for stroke width, which leads to some styling features, e.g. underline, to be offset from the buffer with no easy means of fixing it (Qt glyph and style rendering).
* When outputting text-as-text, as a default, initial unit tests had greatly varied results. I was found that using `QImage::Format_ARGB32_Premultiplied` had a detrimental effect on the quality of text rendering. Hence the need to set `QImage::Format` for a render job.
* Outputting text-as-text in SVG has scaling issues. Text is slightly smaller scale than buffer background. Correctly aligned in PDF/PS output, however.

Unit tests to follow, once changes in `QgsMapSettings` are discussed.

Supersedes PR #1096