diff options
Diffstat (limited to 'svx/source/customshapes/EnhancedCustomShapeFontWork.cxx')
-rw-r--r-- | svx/source/customshapes/EnhancedCustomShapeFontWork.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 70fff24c9ba0..9f212299c512 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -240,10 +240,15 @@ static void CalculateHorizontalScalingFactor( { // if we have a very large font that will require scaling down to a very small value then // skip directly to a small font size - if (nFontSize > 128 && fScalingFactor * nFontSize < 1.0) + if (nFontSize > 128) { - nFontSize = 16; - SAL_WARN("svx", "CalculateHorizontalScalingFactor skipping direct to: " << nFontSize << " from " << rFontHeight.GetHeight()); + int nEstimatedFinalFontSize = std::ceil(nFontSize * fScalingFactor); + int nFontThth = nFontSize / 1000; + if (nEstimatedFinalFontSize < nFontThth) + { + nFontSize = std::max(16, nFontThth); + SAL_WARN("svx", "CalculateHorizontalScalingFactor skipping direct to: " << nFontSize << " from " << rFontHeight.GetHeight()); + } } nFontSize--; aFont.SetFontHeight( nFontSize ); |