[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - vcl/quartz

2018-07-09 Thread Bartosz Kosiorek
 vcl/quartz/salbmp.cxx |   12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

New commits:
commit 34bba6eaa404f5a081dcc28f9cca7fd55a10fe0c
Author: Bartosz Kosiorek 
Date:   Thu Jun 28 09:52:50 2018 +0200

tdf#117335 Fix displaying GIF images

To fix regression the sal_uInt16 was used instead of sal_uInt8.
Verified on macOS High Sierra 10.13.5.
I also checked if with this fix, there is no issue with displaying EMF 
(tdf#113197)
Sample document from tdf#113197 is displaying correctly.

Change-Id: I6504717d831a193b0a878ced2f335d34a993aed6
Reviewed-on: https://gerrit.libreoffice.org/56578
Tested-by: Jenkins
Reviewed-by: Armin Le Grand 
Reviewed-by: Bartosz Kosiorek 
(cherry picked from commit 054a3586bb4808728a5cd58ea8a867539c08e55c)
Reviewed-on: https://gerrit.libreoffice.org/56668
Reviewed-by: Thorsten Behrens 

diff --git a/vcl/quartz/salbmp.cxx b/vcl/quartz/salbmp.cxx
index a74f6096bf5a..60a16503f3d2 100644
--- a/vcl/quartz/salbmp.cxx
+++ b/vcl/quartz/salbmp.cxx
@@ -451,13 +451,13 @@ class ImplPixelFormat8 : public ImplPixelFormat
 private:
 sal_uInt8* pData;
 const BitmapPalette& mrPalette;
-const sal_uInt8 mnPaletteCount;
+const sal_uInt16 mnPaletteCount;
 
 public:
 explicit ImplPixelFormat8( const BitmapPalette& rPalette )
 : pData(nullptr)
 , mrPalette(rPalette)
-, mnPaletteCount(static_cast< sal_uInt8 >(rPalette.GetEntryCount()))
+, mnPaletteCount(rPalette.GetEntryCount())
 {
 }
 virtual void StartLine( sal_uInt8* pLine ) override { pData = pLine; }
@@ -489,7 +489,7 @@ class ImplPixelFormat4 : public ImplPixelFormat
 private:
 sal_uInt8* pData;
 const BitmapPalette& mrPalette;
-const sal_uInt8 mnPaletteCount;
+const sal_uInt16 mnPaletteCount;
 sal_uInt32 mnX;
 sal_uInt32 mnShift;
 
@@ -497,7 +497,7 @@ public:
 explicit ImplPixelFormat4( const BitmapPalette& rPalette )
 : pData(nullptr)
 , mrPalette(rPalette)
-, mnPaletteCount(static_cast< sal_uInt8 >(rPalette.GetEntryCount()))
+, mnPaletteCount(rPalette.GetEntryCount())
 , mnX(0)
 , mnShift(0)
 {
@@ -545,14 +545,14 @@ class ImplPixelFormat1 : public ImplPixelFormat
 private:
 sal_uInt8* pData;
 const BitmapPalette& mrPalette;
-const sal_uInt8 mnPaletteCount;
+const sal_uInt16 mnPaletteCount;
 sal_uInt32 mnX;
 
 public:
 explicit ImplPixelFormat1( const BitmapPalette& rPalette )
 : pData(nullptr)
 , mrPalette(rPalette)
-, mnPaletteCount(static_cast< sal_uInt8 >(rPalette.GetEntryCount()))
+, mnPaletteCount(rPalette.GetEntryCount())
 , mnX(0)
 {
 }
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - vcl/quartz

2018-02-23 Thread Tor Lillqvist
 vcl/quartz/ctfonts.cxx |   25 -
 1 file changed, 24 insertions(+), 1 deletion(-)

New commits:
commit e092effee32cfbade59fb68adddc9db96d3c3c88
Author: Tor Lillqvist 
Date:   Thu Feb 22 13:52:13 2018 +0200

tdf#67744, tdf#68889: Fix weight reported by the system for these fonts

A hack, but oh well. Let's hope there won't be a lot of these special
cases. Maybe some generic heuristic would be better. Like if a font's
GetStyleName() is "Medium", "Medium Oblique", or "Medium Italic" then
always force its weight to be WEIGHT_NORMAL?

Reviewed-on: https://gerrit.libreoffice.org/50172
Tested-by: Jenkins 
Reviewed-by: Tor Lillqvist 
(cherry picked from commit 1d7f96a324a4c2ab82a04513c6a38dc31fd061fa)

Change-Id: I13580d27acfb0cc200bdb0cc1911518675d3e32e
Reviewed-on: https://gerrit.libreoffice.org/50198
Tested-by: Jenkins 
Reviewed-by: Michael Stahl 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index ebb7066be9d8..ee556a1fd2ae 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -1,4 +1,4 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; 
fill-column: 100 -*- */
 /*
  * This file is part of the LibreOffice project.
  *
@@ -387,6 +387,29 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 CFNumberRef pWeightNum = static_cast(CFDictionaryGetValue( 
pAttrDict, kCTFontWeightTrait ));
 CFNumberGetValue( pWeightNum, kCFNumberDoubleType,  );
 int nInt = WEIGHT_NORMAL;
+
+// Special case fixes
+
+// tdf#67744: Courier Std Medium is always bold. We get a 
kCTFontWeightTrait of 0.23 which
+// surely must be wrong.
+if (rDFA.GetFamilyName() == "Courier Std" &&
+(rDFA.GetStyleName() == "Medium" || rDFA.GetStyleName() == "Medium 
Oblique") &&
+fWeight > 0.2)
+{
+fWeight = 0;
+}
+
+// tdf#68889: Ditto for Gill Sans MT Pro. Here I can kinda understand it, 
maybe the
+// kCTFontWeightTrait is intended to give a subjective "optical" 
impression of how the font
+// looks, and Gill Sans MT Pro Medium is kinda heavy. But with the way 
LibreOffice uses fonts,
+// we still should think of it as being "medium" weight.
+if (rDFA.GetFamilyName() == "Gill Sans MT Pro" &&
+(rDFA.GetStyleName() == "Medium" || rDFA.GetStyleName() == "Medium 
Italic") &&
+fWeight > 0.2)
+{
+fWeight = 0;
+}
+
 if( fWeight > 0 )
 {
 nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_BLACK - 
WEIGHT_NORMAL)/0.68));
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits


[Libreoffice-commits] core.git: Branch 'libreoffice-6-0' - vcl/quartz

2018-01-24 Thread Tor Lillqvist
 vcl/quartz/ctfonts.cxx |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
commit 3aeda82b09253d20d234d50b39e76977031f2102
Author: Tor Lillqvist 
Date:   Tue Jan 23 15:04:00 2018 +0200

tdf#69254: Tweak mapping from CoreText weight to our FontWeight a bit

Make the mapping of light weights more likely to hit different enum
values for slightly different weights.

We want to be able to distinguish between for instance Overpass Light
(with weight -0.4) and Overpass ExtraLight (with weight -0.5).

Change-Id: If83fbce68149b267a49ef9bcb6624d8790de7c56
Reviewed-on: https://gerrit.libreoffice.org/48426
Tested-by: Jenkins 
Reviewed-by: Christian Lohmaier 

diff --git a/vcl/quartz/ctfonts.cxx b/vcl/quartz/ctfonts.cxx
index c31dcc329e2b..ebb7066be9d8 100644
--- a/vcl/quartz/ctfonts.cxx
+++ b/vcl/quartz/ctfonts.cxx
@@ -397,7 +397,7 @@ FontAttributes DevFontFromCTFontDescriptor( 
CTFontDescriptorRef pFD, bool* bFont
 }
 else if( fWeight < 0 )
 {
-nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_NORMAL - 
WEIGHT_THIN)/0.9));
+nInt = rint(WEIGHT_NORMAL + fWeight * ((WEIGHT_NORMAL - 
WEIGHT_THIN)/0.8));
 if( nInt < WEIGHT_THIN )
 {
 nInt = WEIGHT_THIN;
___
Libreoffice-commits mailing list
libreoffice-comm...@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits