58 if ( maxinangle < 20.0 )
60 if ( 60.0 < maxinangle )
62 if ( maxoutangle > -20.0 )
64 if ( -95.0 > maxoutangle )
69 double labelHeight = mapScale * fm->height();
80 for (
int i = 0; i <
mClusters.count(); i++ )
87 wordSpaceFix = qreal( 0.0 );
88 if (
mClusters[i] == QLatin1String(
" " ) )
92 wordSpaceFix = ( nxt <
mClusters.count() &&
mClusters[nxt] != QLatin1String(
" " ) ) ? wordSpacing : qreal( 0.0 );
100 wordSpaceFix -= wordSpacing;
103 charWidth = fm->width( QString(
mClusters[i] ) ) + wordSpaceFix;
106 double labelWidth = mapScale * charWidth;
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.
pal::LabelInfo * mInfo
extra information for curved labels (may be null)
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.
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.
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.