rpms/openoffice.org/devel openoffice.org-3.1.1.ooo64671.canvas.add-support-for-font-pitch.patch, NONE, 1.1 openoffice.org.spec, 1.2006, 1.2007

David Tardon dtardon at fedoraproject.org
Tue Sep 15 08:19:36 UTC 2009


Author: dtardon

Update of /cvs/extras/rpms/openoffice.org/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv11763

Modified Files:
	openoffice.org.spec 
Added Files:
	openoffice.org-3.1.1.ooo64671.canvas.add-support-for-font-pitch.patch 
Log Message:
Resolves: 522056 - wrong match of fonts (non-)proportional

openoffice.org-3.1.1.ooo64671.canvas.add-support-for-font-pitch.patch:
 canvas/source/cairo/cairo_canvasfont.cxx                      |    5 +++++
 canvas/source/directx/dx_textlayout_drawhelper.cxx            |    6 ++++++
 canvas/source/vcl/canvasfont.cxx                              |    5 +++++
 cppcanvas/inc/cppcanvas/renderer.hxx                          |    3 +++
 cppcanvas/source/mtfrenderer/implrenderer.cxx                 |   10 +++++++++-
 drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx |    6 +++++-
 drawinglayer/source/primitive2d/textlayoutdevice.cxx          |    2 ++
 drawinglayer/source/primitive2d/textprimitive2d.cxx           |    3 ++-
 drawinglayer/source/processor2d/canvasprocessor.cxx           |    5 +++++
 9 files changed, 42 insertions(+), 3 deletions(-)

--- NEW FILE openoffice.org-3.1.1.ooo64671.canvas.add-support-for-font-pitch.patch ---
Index: cppcanvas/source/mtfrenderer/implrenderer.cxx
===================================================================
--- cppcanvas/source/mtfrenderer/implrenderer.cxx	(revision 276100)
+++ cppcanvas/source/mtfrenderer/implrenderer.cxx	(working copy)
@@ -52,6 +52,7 @@
 #include <com/sun/star/rendering/XParametricPolyPolygon2DFactory.hpp>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/geometry/RealPoint2D.hpp>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
 #include <com/sun/star/rendering/ViewState.hpp>
 #include <com/sun/star/rendering/RenderState.hpp>
 #include <com/sun/star/rendering/XCanvasFont.hpp>
@@ -956,6 +957,12 @@
                 rParms.mrParms.maFontLetterForm.isValid() ?
                 rParms.mrParms.maFontLetterForm.getValue() :
                 (rFont.GetItalic() == ITALIC_NONE) ? 0 : 9;
+            aFontRequest.FontDescription.FontDescription.Proportion = 
+                rParms.mrParms.maFontProportion.isValid() ?
+                rParms.mrParms.maFontProportion.getValue() :
+                (rFont.GetPitch() == PITCH_FIXED)
+                    ? rendering::PanoseProportion::MONO_SPACED
+                    : rendering::PanoseProportion::ANYTHING;
 
             LanguageType aLang = rFont.GetLanguage();
             aFontRequest.Locale = MsLangId::convertLanguageToLocale(aLang, false);
@@ -3073,7 +3080,8 @@
             if( rParams.maFontName.isValid() ||
                 rParams.maFontWeight.isValid() ||
                 rParams.maFontLetterForm.isValid() ||
-                rParams.maFontUnderline.isValid() )
+                rParams.maFontUnderline.isValid() ||
+                rParams.maFontProportion.isValid() )
             {
                 ::cppcanvas::internal::OutDevState& rState = getState( aStateStack );
                     
Index: cppcanvas/inc/cppcanvas/renderer.hxx
===================================================================
--- cppcanvas/inc/cppcanvas/renderer.hxx	(revision 276100)
+++ cppcanvas/inc/cppcanvas/renderer.hxx	(working copy)
@@ -139,6 +139,9 @@
             /// Optionally forces the given font letter form (italics etc.) for all text actions
             ::comphelper::OptionalValue< sal_Int8 >					maFontLetterForm;
 
+            /// Optionally forces the given font proportion (condensed, monospaced etc.) for all text actions
+            ::comphelper::OptionalValue< sal_Int8 >					maFontProportion;
+
             /// Optionally forces underlining for all text actions
             ::comphelper::OptionalValue< bool >						maFontUnderline;
         };
Index: canvas/source/directx/dx_textlayout_drawhelper.cxx
===================================================================
--- canvas/source/directx/dx_textlayout_drawhelper.cxx	(revision 276100)
+++ canvas/source/directx/dx_textlayout_drawhelper.cxx	(working copy)
@@ -135,6 +135,9 @@
             aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
             aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
             aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
+            aFont.SetPitch(
+                    rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
+                    ? PITCH_FIXED : PITCH_VARIABLE);
 
             aFont.SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
 
@@ -267,6 +270,9 @@
         aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
         aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
         aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
+        aFont.SetPitch(
+                rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
+                ? PITCH_FIXED : PITCH_VARIABLE);
 
         // adjust to stretched font
         if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
Index: canvas/source/vcl/canvasfont.cxx
===================================================================
--- canvas/source/vcl/canvasfont.cxx	(revision 276100)
+++ canvas/source/vcl/canvasfont.cxx	(working copy)
@@ -33,6 +33,8 @@
 
 #include <canvas/debug.hxx>
 
+#include <com/sun/star/rendering/PanoseProportion.hpp>
+
 #include <rtl/math.hxx>
 #include <basegfx/numeric/ftools.hxx>
 #include <i18npool/mslangid.hxx>
@@ -66,6 +68,9 @@
         // TODO(F2): improve panose->vclenum conversion
         maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
         maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
+        maFont->SetPitch(
+                rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
+                    ? PITCH_FIXED : PITCH_VARIABLE);
 
 		maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
 
Index: canvas/source/cairo/cairo_canvasfont.cxx
===================================================================
--- canvas/source/cairo/cairo_canvasfont.cxx	(revision 276100)
+++ canvas/source/cairo/cairo_canvasfont.cxx	(working copy)
@@ -36,6 +36,8 @@
 #include <rtl/math.hxx>
 #include <basegfx/numeric/ftools.hxx>
 
+#include <com/sun/star/rendering/PanoseProportion.hpp>
+
 #include <vcl/metric.hxx>
 #include <i18npool/mslangid.hxx>
 
@@ -86,6 +88,9 @@
         // TODO(F2): improve panose->vclenum conversion
         maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
         maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
+        maFont->SetPitch(
+                rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
+                    ? PITCH_FIXED : PITCH_VARIABLE);
 
         maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
 
Index: drawinglayer/source/processor2d/canvasprocessor.cxx
===================================================================
--- drawinglayer/source/processor2d/canvasprocessor.cxx	(revision 276100)
+++ drawinglayer/source/processor2d/canvasprocessor.cxx	(working copy)
@@ -64,6 +64,7 @@
 #include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
 #include <basegfx/tuple/b2i64tuple.hxx>
 #include <basegfx/range/b2irange.hxx>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
 #include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
 #include <com/sun/star/rendering/CompositeOperation.hpp>
 #include <com/sun/star/rendering/StrokeAttributes.hpp>
@@ -1526,6 +1527,10 @@
                     aFontRequest.FontDescription.IsVertical = rFontAttrs.getVertical() ? util::TriState_YES : util::TriState_NO;
                     // TODO(F2): improve vclenum->panose conversion
                     aFontRequest.FontDescription.FontDescription.Weight = static_cast< sal_uInt8 >(rFontAttrs.getWeight());
+                    aFontRequest.FontDescription.FontDescription.Proportion =
+                        rFontAttrs.getMonospaced()
+                            ? rendering::PanoseProportion::MONO_SPACED
+                            : rendering::PanoseProportion::ANYTHING;
                     aFontRequest.FontDescription.FontDescription.Letterform = rFontAttrs.getItalic() ? 9 : 0;
 
                     // init CellSize to 1.0, else a default font height will be used
Index: drawinglayer/source/primitive2d/textlayoutdevice.cxx
===================================================================
--- drawinglayer/source/primitive2d/textlayoutdevice.cxx	(revision 276100)
+++ drawinglayer/source/primitive2d/textlayoutdevice.cxx	(working copy)
@@ -346,6 +346,7 @@
 			aRetval.SetWeight(static_cast<FontWeight>(rFontAttributes.getWeight()));
 			aRetval.SetItalic(rFontAttributes.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
 			aRetval.SetOutline(rFontAttributes.getOutline());
+            aRetval.SetPitch(rFontAttributes.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
 
 #ifdef WIN32
 			// #100424# use higher precision
@@ -392,6 +393,7 @@
                 RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
 			    rFont.IsVertical(),
 			    ITALIC_NONE != rFont.GetItalic(),
+                PITCH_FIXED == rFont.GetPitch(),
 			    rFont.IsOutline(),
                 bRTL,
                 bBiDiStrong);
Index: drawinglayer/source/primitive2d/textprimitive2d.cxx
===================================================================
--- drawinglayer/source/primitive2d/textprimitive2d.cxx	(revision 276100)
+++ drawinglayer/source/primitive2d/textprimitive2d.cxx	(working copy)
@@ -63,7 +63,8 @@
 				&& getItalic() == rCompare.getItalic()
 				&& getOutline() == rCompare.getOutline()
 				&& getRTL() == rCompare.getRTL()
-				&& getBiDiStrong() == rCompare.getBiDiStrong());
+				&& getBiDiStrong() == rCompare.getBiDiStrong()
+                && getMonospaced() == rCompare.getMonospaced());
 		}
 	} // end of namespace primitive2d
 } // end of namespace drawinglayer
Index: drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
===================================================================
--- drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx	(revision 276100)
+++ drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx	(working copy)
@@ -75,6 +75,7 @@
 			unsigned									mbOutline : 1;      // Outline Flag
             unsigned                                    mbRTL : 1;          // RTL Flag
             unsigned                                    mbBiDiStrong : 1;   // BiDi Flag
+            unsigned mbMonospaced : 1;
 			// TODO: pair kerning and CJK kerning
 
         public:
@@ -85,6 +86,7 @@
                 bool bSymbol = false,
                 bool bVertical = false,
                 bool bItalic = false,
+                bool bMonospaced = false,
                 bool bOutline = false,
                 bool bRTL = false,
                 bool bBiDiStrong = false)
@@ -96,7 +98,8 @@
 			    mbItalic(bItalic),
 			    mbOutline(bOutline),
                 mbRTL(bRTL),
-                mbBiDiStrong(bBiDiStrong)
+                mbBiDiStrong(bBiDiStrong),
+                mbMonospaced(bMonospaced)
             {
             }
 
@@ -113,6 +116,7 @@
             bool getOutline() const { return mbOutline; }
             bool getRTL() const { return mbRTL; }
             bool getBiDiStrong() const { return mbBiDiStrong; }
+            bool getMonospaced() const { return mbMonospaced; }
 		};
 	} // end of namespace primitive2d
 } // end of namespace drawinglayer


Index: openoffice.org.spec
===================================================================
RCS file: /cvs/extras/rpms/openoffice.org/devel/openoffice.org.spec,v
retrieving revision 1.2006
retrieving revision 1.2007
diff -u -p -r1.2006 -r1.2007
--- openoffice.org.spec	14 Sep 2009 10:42:22 -0000	1.2006
+++ openoffice.org.spec	15 Sep 2009 08:19:35 -0000	1.2007
@@ -159,6 +159,7 @@ Patch81: workspace.os131.patch
 Patch82: workspace.vcl102.patch
 Patch83: openoffice.org-3.1.1.ooo104157.svx.crashonencryptparse.patch
 Patch84: workspace.dr69.patch
+Patch85: openoffice.org-3.1.1.ooo64671.canvas.add-support-for-font-pitch.patch
 
 %define python_py_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(0)")
 %define instdir %{_libdir}
@@ -1703,6 +1704,7 @@ cat %{PATCH11} >> svtools/source/dialogs
 %patch82 -p0 -b .workspace.vcl102.patch
 %patch83 -p0 -b .ooo104157.svx.crashonencryptparse.patch
 %patch84 -p0 -b .workspace.dr69.patch
+%patch85 -p0 -b .ooo64671.canvas.add-support-for-font-pitch.patch
 
 %build
 echo build start time is `date`, diskspace: `df -h . | tail -n 1`
@@ -4245,8 +4247,9 @@ fi
     unopkg list --shared > /dev/null 2>&1 || :
 
 %changelog
-* Mon Sep 14 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.1.1-19.8
+* Tue Sep 15 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.1.1-19.8-UNBUILT
 - disable NumberFormatRecognition from default writer configuration
+- Resolves: 522056 - wrong match of fonts (non-)proportional
 
 * Mon Sep 14 2009 Caolán McNamara <caolanm at redhat.com> - 1:3.1.1-19.7
 - make oo.o buildable without langpacks again




More information about the scm-commits mailing list