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/source | |
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/source')
-rw-r--r-- | emfio/source/reader/mtftools.cxx | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx index b4973f6e51ab..f829788dbd1b 100644 --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -179,7 +179,7 @@ namespace emfio aFont.SetCharSet( eCharSet ); aFont.SetFamilyName( rFont.alfFaceName ); FontFamily eFamily; - switch ( rFont.lfPitchAndFamily & 0xf0 ) + switch ( rFont.lfPitchAndFamily >> 4 & 0x0f ) { case FamilyFont::FF_ROMAN: eFamily = FAMILY_ROMAN; |