summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorKhaled Hosny <khaled@aliftype.com>2023-02-07 16:40:49 +0200
committerخالد حسني <khaled@aliftype.com>2023-02-07 18:35:39 +0000
commitad5005c3bfb6105e92e52111c3093312a6cb8ff2 (patch)
tree5ef5a582540750cf4b22f21e25439b73a2855388 /vcl
parent345f23474845da0defa4a9276228f54b5ded5736 (diff)
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 <khaled@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: خالد حسني <khaled@aliftype.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/source/font/fontmetric.cxx2
1 files changed, 2 insertions, 0 deletions
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);