[Libreoffice-commits] core.git: Branch 'libreoffice-6-3' - vcl/inc
Khaled Hosny (via logerrit)
logerrit at kemper.freedesktop.org
Sun Jun 16 19:04:25 UTC 2019
vcl/inc/fontinstance.hxx | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit cd7b82ecb9c7b96b29087e70b66210a3de5a4434
Author: Khaled Hosny <khaledhosny at eglug.org>
AuthorDate: Sun Jun 16 02:38:02 2019 +0200
Commit: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
CommitDate: Sun Jun 16 21:03:50 2019 +0200
tdf#121486: Correct scale of broken fonts on Windows
Some fonts have negative tmAveCharWidth which makes no sense (fonts can't have
negative glyph width, so the average can't be negative) and it would cause our
code to apply negative scale to the glyphs of these fonts making them drawn on
the flipped horizontally.
Fix this by using the absolute value so it is always positive.
Change-Id: I731e7aad80dae734847679a1b08c6ac78111e16c
Reviewed-on: https://gerrit.libreoffice.org/74109
Tested-by: Jenkins
Reviewed-by: Khaled Hosny <khaledhosny at eglug.org>
(cherry picked from commit 8fffb56940c6eb81674000cdb718edc79603a6c5)
Reviewed-on: https://gerrit.libreoffice.org/74122
Reviewed-by: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
diff --git a/vcl/inc/fontinstance.hxx b/vcl/inc/fontinstance.hxx
index a0f700c925fc..62e3677db7a4 100644
--- a/vcl/inc/fontinstance.hxx
+++ b/vcl/inc/fontinstance.hxx
@@ -64,7 +64,7 @@ public: // TODO: make data members private
void IgnoreFallbackForUnicode( sal_UCS4, FontWeight eWeight, const OUString& rFontName );
inline hb_font_t* GetHbFont();
- void SetAverageWidthFactor(double nFactor) { m_nAveWidthFactor = nFactor; }
+ void SetAverageWidthFactor(double nFactor) { m_nAveWidthFactor = std::abs(nFactor); }
double GetAverageWidthFactor() const { return m_nAveWidthFactor; }
const FontSelectPattern& GetFontSelectPattern() const { return m_aFontSelData; }
More information about the Libreoffice-commits
mailing list