Skip to content
Permalink
Browse files

Improve mapbox ems to character count conversion ratio

  • Loading branch information
nyalldawson committed Sep 14, 2020
1 parent 9cb7493 commit 0685c5e0d6c1a6b1b7a543e5c23fb9dbddf45505
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/core/vectortile/qgsmapboxglstyleconverter.cpp
@@ -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" ) ) )

0 comments on commit 0685c5e

Please sign in to comment.
You can’t perform that action at this time.