15 #ifndef QGSPALGEOMETRY_H 16 #define QGSPALGEOMETRY_H 72 if ( maxinangle < 20.0 )
74 if ( 60.0 < maxinangle )
76 if ( maxoutangle > -20.0 )
78 if ( -95.0 > maxoutangle )
83 double labelHeight = mapScale * fm->
height() / fontScale;
101 wordSpaceFix = qreal( 0.0 );
114 wordSpaceFix -= wordSpacing;
120 double labelWidth = mapScale * charWidth / fontScale;
150 #endif //QGSPALGEOMETRY_H QFontMetricsF * mFontMetrics
Metrics of the font for rendering.
QgsTextLabelFeature(QgsFeatureId id, GEOSGeometry *geometry, const QSizeF &size)
Construct text label feature.
QString mLabelText
text of the label
QStringList mClusters
List of graphemes (used for curved labels)
~QgsTextLabelFeature()
Clean up.
const T & at(int i) const
const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > & dataDefinedValues() const
Get data-defined values.
pal::LabelInfo * mInfo
extra information for curved labels (may be null)
Class that adds extra information to QgsLabelFeature for text labels.
GEOSGeometry * geometry() const
Get access to the associated geometry.
void setDefinedFont(const QFont &f)
Set font to be used for rendering.
qreal width(const QString &text) const
bool qgsDoubleNear(double a, double b, double epsilon=4 *DBL_EPSILON)
Compare two doubles (but allow some difference)
CharacterInfo * char_info
Perform transforms between map coordinates and device coordinates.
int count(const T &value) const
QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > mDataDefinedValues
Stores attribute values for data defined properties.
qreal letterSpacing() const
void setDataDefinedValues(const QMap< QgsPalLayerSettings::DataDefinedProperties, QVariant > &values)
Set data-defined values.
Optional additional info about label (for curved labels)
void calculateInfo(bool curvedLabeling, QFontMetricsF *fm, const QgsMapToPixel *xform, double fontScale, double maxinangle, double maxoutangle)
calculate data for info(). setDefinedFont() must have been called already.
QString text(int partId) const
Returns the text component corresponding to a specified label part.
double mapUnitsPerPixel() const
Return current map units per pixel.
QSizeF size() const
Size of the label (in map units)
QFont definedFont()
Font to be used for rendering.
The QgsLabelFeature class describes a feature that should be used within the labeling engine...
static QStringList splitToGraphemes(const QString &text)
Splits a text string to a list of graphemes, which are the smallest allowable character divisions in ...
QFont mDefinedFont
Font for rendering.
QFontMetricsF * labelFontMetrics()
Metrics of the font for rendering.
qreal wordSpacing() const