Skip to content

Commit

Permalink
Merge pull request #34649 from mhugent/dxf_linebreak_backport_3_10
Browse files Browse the repository at this point in the history
[backport release-3.10] DXF export: handle line breaks in label text
  • Loading branch information
mhugent committed Feb 25, 2020
2 parents fcf5e8b + 92100d0 commit 7527481
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/dxf/qgsdxfexport.cpp
Expand Up @@ -4742,10 +4742,14 @@ void QgsDxfExport::drawLabel( const QString &layerId, QgsRenderContext &context,

if ( mFlags & FlagNoMText )
{
txt.replace( QChar( QChar::LineFeed ), ' ' );
txt.replace( QChar( QChar::CarriageReturn ), ' ' );
writeText( dxfLayer, txt, QgsPoint( label->getX(), label->getY() ), label->getHeight(), label->getAlpha() * 180.0 / M_PI, tmpLyr.format().color() );
}
else
{
txt.replace( QString( QChar( QChar::CarriageReturn ) ) + QString( QChar( QChar::LineFeed ) ), QStringLiteral( "\\P" ) );
txt.replace( QChar( QChar::CarriageReturn ), QStringLiteral( "\\P" ) );
txt = txt.replace( wrapchr, QLatin1String( "\\P" ) );
txt.replace( " ", "\\~" );

Expand Down

0 comments on commit 7527481

Please sign in to comment.