vcl/source/font/fontmetric.cxx |    2 ++
 1 file changed, 2 insertions(+)

New commits:
commit ad5005c3bfb6105e92e52111c3093312a6cb8ff2
Author:     Khaled Hosny <kha...@aliftype.com>
AuthorDate: Tue Feb 7 16:40:49 2023 +0200
Commit:     خالد حسني <kha...@aliftype.com>
CommitDate: Tue Feb 7 18:35:39 2023 +0000

    tdf#153376: Fix reading USE_TYPO_METRICS flag
    
    Font data is big endian while SvStream defaults to little endian.
    
    Regression from:
    
    commit fb417ee082afdd2e80a1f48aa420bb8d5cb97686
    Author: Khaled Hosny <kha...@aliftype.com>
    Date:   Fri Sep 30 12:35:10 2022 +0200
    
        vcl: Apply variations to font metrics
    
    Change-Id: I474ec2a76057baca93f350e23c3779985abdf9da
    Reviewed-on: https://gerrit.libreoffice.org/c/core/+/146611
    Tested-by: Jenkins
    Reviewed-by: خالد حسني <kha...@aliftype.com>

diff --git a/vcl/source/font/fontmetric.cxx b/vcl/source/font/fontmetric.cxx
index 805cbad9deab..3f87950d5314 100644
--- a/vcl/source/font/fontmetric.cxx
+++ b/vcl/source/font/fontmetric.cxx
@@ -523,6 +523,8 @@ void 
ImplFontMetricData::ImplCalcLineSpacing(LogicalFontInstance* pFontInstance)
                 auto aOS2(pFace->GetRawFontData(HB_TAG('O', 'S', '/', '2')));
                 SvMemoryStream aStream(const_cast<uint8_t*>(aOS2.data()), 
aOS2.size(),
                                        StreamMode::READ);
+                // Font data are big endian.
+                aStream.SetEndian(SvStreamEndian::BIG);
                 if (aStream.Seek(vcl::OS2_fsSelection_offset) == 
vcl::OS2_fsSelection_offset)
                     aStream.ReadUInt16(fsSelection);
                 bUseTypoMetrics = fsSelection & (1 << 7);

Reply via email to