diff options
author | Hossein <hossein@libreoffice.org> | 2022-04-06 04:41:07 +0200 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2022-04-06 10:52:50 +0200 |
commit | 51431559bda9a81293d502328982452caeeba6c6 (patch) | |
tree | 34571c0972862cd5dbd2bec5f06edbb8c74d2c62 /emfio/qa/cppunit/wmf | |
parent | cedf0b23542a06cd31440dd1deb450d03191a1b9 (diff) |
Fix type, calculation of FamilyFont PitchAndFamily
This patch fixes problems caused by the cleanup commit
3e7dd04dd8ca1baea4b7918eb7a7080c595c4625 for type and calculation of
FamilyFont and PitchAndFamily enumerations.
FamilyFont enumeration is described in [MS-WMF] v20210625 page 33:
"In a Font Object, when a FamilyFont value is packed into a byte
with a PitchFont Enumeration value, the result is a PitchAndFamily
Object".
Thus, we will use sal_uInt8 as the underlying type for FamilyFont.
The PitchAndFamily is created as shown in [MS-WMF] v20210625 page 96:
[0 1 2 3] 4 5 [6 7]
Family 0 0 Pitch
The values for FamilyFont enumeration are created according to the
[MS-WMF], and the calculations are changed to use '<< 4' and '>> 4'
instead of applying the same shift to the enumeration values.
Change-Id: I4f6df33ed6405589acf89ba2c9223a571cb510b5
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/132614
Tested-by: Jenkins
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'emfio/qa/cppunit/wmf')
-rw-r--r-- | emfio/qa/cppunit/wmf/wmfimporttest.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/emfio/qa/cppunit/wmf/wmfimporttest.cxx b/emfio/qa/cppunit/wmf/wmfimporttest.cxx index 1ae7416521aa..b8c2218fdec2 100644 --- a/emfio/qa/cppunit/wmf/wmfimporttest.cxx +++ b/emfio/qa/cppunit/wmf/wmfimporttest.cxx @@ -336,7 +336,7 @@ void WmfTest::testTdf99402() logfontw.lfUnderline = 0; logfontw.lfStrikeOut = 0; logfontw.lfCharSet = emfio::CharacterSet::OEM_CHARSET; - logfontw.lfPitchAndFamily = +emfio::FamilyFont::FF_ROMAN | +emfio::PitchFont::DEFAULT_PITCH; + logfontw.lfPitchAndFamily = emfio::FamilyFont::FF_ROMAN << 4 | emfio::PitchFont::DEFAULT_PITCH; logfontw.alfFaceName = "Symbol"; emfio::WinMtfFontStyle fontStyle(logfontw); |