summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Kaganski <mike.kaganski@collabora.com>2024-03-29 08:55:24 +0500
committerMike Kaganski <mike.kaganski@collabora.com>2024-03-29 06:11:11 +0100
commit291c90811ada39ed079d458887a59fc8977494f6 (patch)
tree9c42f5ee6809da2b3b487a2c1b0b3d212ea6d8c9
parentff7a6711277bda28711cc92540fbd62ebaaf8db7 (diff)
Simplify a bit
Change-Id: I2a5b870516d8b597ebf476c7c1da7549a27571ac Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165503 Tested-by: Jenkins Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
-rw-r--r--vcl/source/font/LogicalFontInstance.cxx17
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,