vcl/source/font/fontinstance.cxx   |    2 +-
 vcl/source/gdi/CommonSalLayout.cxx |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

New commits:
commit 3d0e482df81a28e6d0eb86cda71ac49d3363ae50
Author:     Khaled Hosny <kha...@aliftype.com>
AuthorDate: Fri Aug 12 02:51:50 2022 +0200
Commit:     Caolán McNamara <caol...@redhat.com>
CommitDate: Sun Aug 14 21:12:21 2022 +0200

    tdf#106653: Try harder not to return 0 for Kashida width
    
    The font in the bug document has a very small Kashida advance width and
    this gets rounded to zero at smaller zoom level. Try to round up the
    value to avoid returning zero too eagerly.
    
    Change-Id: I78c309d66a9e94812827c7c6724c67c4d09bcff9
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/138169
    Tested-by: Jenkins
    Reviewed-by: Caolán McNamara <caol...@redhat.com>

diff --git a/vcl/source/font/fontinstance.cxx b/vcl/source/font/fontinstance.cxx
index 0907d657ad02..44c2c8cc757d 100644
--- a/vcl/source/font/fontinstance.cxx
+++ b/vcl/source/font/fontinstance.cxx
@@ -73,7 +73,7 @@ int LogicalFontInstance::GetKashidaWidth() const
     {
         double nXScale = 0;
         GetScale(&nXScale, nullptr);
-        nWidth = hb_font_get_glyph_h_advance(pHbFont, nIndex) * nXScale;
+        nWidth = std::ceil(hb_font_get_glyph_h_advance(pHbFont, nIndex) * 
nXScale);
     }
 
     return nWidth;
diff --git a/vcl/source/gdi/CommonSalLayout.cxx 
b/vcl/source/gdi/CommonSalLayout.cxx
index b3d63dac30a0..0bea121896b4 100644
--- a/vcl/source/gdi/CommonSalLayout.cxx
+++ b/vcl/source/gdi/CommonSalLayout.cxx
@@ -761,7 +761,7 @@ void GenericSalLayout::ApplyDXArray(const DC* pDXArray, 
const sal_Bool* pKashida
 
     if (nKashidaWidth <= 0)
     {
-        SAL_WARN("vcl.gdi", "Asked to insert Kashidas in a font with 
zero-width Kashida");
+        SAL_WARN("vcl.gdi", "Asked to insert Kashidas in a font with bogus 
Kashida width");
         return;
     }
 

Reply via email to