diff options
-rw-r--r-- | vcl/source/font/LogicalFontInstance.cxx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/vcl/source/font/LogicalFontInstance.cxx b/vcl/source/font/LogicalFontInstance.cxx index 0c21cba47548..94e1e72353fb 100644 --- a/vcl/source/font/LogicalFontInstance.cxx +++ b/vcl/source/font/LogicalFontInstance.cxx @@ -113,19 +113,20 @@ double LogicalFontInstance::GetKashidaWidth() const void LogicalFontInstance::GetScale(double* nXScale, double* nYScale) const { double nUPEM = GetFontFace()->UnitsPerEm(); - double nHeight(m_aFontSelData.mnHeight); - - // On Windows, mnWidth is relative to average char width not font height, - // and we need to keep it that way for GDI to correctly scale the glyphs. - // Here we compensate for this so that HarfBuzz gives us the correct glyph - // positions. - double nWidth(m_aFontSelData.mnWidth ? m_aFontSelData.mnWidth * m_nAveWidthFactor : nHeight); if (nYScale) - *nYScale = nHeight / nUPEM; + *nYScale = m_aFontSelData.mnHeight / nUPEM; if (nXScale) + { + // On Windows, mnWidth is relative to average char width not font height, + // and we need to keep it that way for GDI to correctly scale the glyphs. + // Here we compensate for this so that HarfBuzz gives us the correct glyph + // positions. + double nWidth(m_aFontSelData.mnWidth ? m_aFontSelData.mnWidth * GetAverageWidthFactor() + : m_aFontSelData.mnHeight); *nXScale = nWidth / nUPEM; + } } void LogicalFontInstance::AddFallbackForUnicode(sal_UCS4 cChar, FontWeight eWeight, |