Skip to content

Commit

Permalink
Improve mapbox ems to character count conversion ratio
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed Sep 14, 2020
1 parent 9cb7493 commit 0685c5e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/vectortile/qgsmapboxglstyleconverter.cpp
Expand Up @@ -678,8 +678,8 @@ void QgsMapBoxGlStyleConverter::parseSymbolLayer( const QVariantMap &jsonLayer,
}
}

// em to character tends to underestimate, so scale up by ~40%
constexpr double EM_TO_CHARS = 1.4;
// a rough average of ems to character count conversion for a variety of fonts
constexpr double EM_TO_CHARS = 2.0;

double textMaxWidth = -1;
if ( jsonLayout.contains( QStringLiteral( "text-max-width" ) ) )
Expand Down

0 comments on commit 0685c5e

Please sign in to comment.