[ooo-build-commit] .: canvas/source cppcanvas/inc cppcanvas/source
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Sep 30 08:14:47 PDT 2010
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 +++++++++-
5 files changed, 28 insertions(+), 1 deletion(-)
New commits:
commit c5e98b24dbca2ef6921efc5849c3286d25e83e09
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Sep 30 16:10:40 2010 +0100
#i64671# transfer VCL's FontPitch through DrawingLayer to Canvas
diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx
index 43a40fc..12c0c01 100644
--- a/canvas/source/cairo/cairo_canvasfont.cxx
+++ b/canvas/source/cairo/cairo_canvasfont.cxx
@@ -30,6 +30,8 @@
#include <canvas/debug.hxx>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
+
#include <rtl/math.hxx>
#include <basegfx/numeric/ftools.hxx>
@@ -83,6 +85,9 @@ namespace cairocanvas
// 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));
diff --git a/canvas/source/directx/dx_textlayout_drawhelper.cxx b/canvas/source/directx/dx_textlayout_drawhelper.cxx
index 88f5a5c..380a329 100755
--- a/canvas/source/directx/dx_textlayout_drawhelper.cxx
+++ b/canvas/source/directx/dx_textlayout_drawhelper.cxx
@@ -132,6 +132,9 @@ namespace dxcanvas
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));
@@ -264,6 +267,9 @@ namespace dxcanvas
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))
diff --git a/canvas/source/vcl/canvasfont.cxx b/canvas/source/vcl/canvasfont.cxx
index 2c17870..5fb370b 100644
--- a/canvas/source/vcl/canvasfont.cxx
+++ b/canvas/source/vcl/canvasfont.cxx
@@ -35,6 +35,8 @@
#include <i18npool/mslangid.hxx>
#include <vcl/metric.hxx>
+#include <com/sun/star/rendering/PanoseProportion.hpp>
+
#include "canvasfont.hxx"
#include "textlayout.hxx"
@@ -63,6 +65,9 @@ namespace vclcanvas
// 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));
diff --git a/cppcanvas/inc/cppcanvas/renderer.hxx b/cppcanvas/inc/cppcanvas/renderer.hxx
index 5cd31a1..0b25160 100644
--- a/cppcanvas/inc/cppcanvas/renderer.hxx
+++ b/cppcanvas/inc/cppcanvas/renderer.hxx
@@ -136,6 +136,9 @@ namespace cppcanvas
/// 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;
};
diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx
index 3343e7f..fca5147 100644
--- a/cppcanvas/source/mtfrenderer/implrenderer.cxx
+++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx
@@ -43,6 +43,7 @@
#include <com/sun/star/rendering/TexturingMode.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>
@@ -852,6 +853,12 @@ namespace cppcanvas
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);
@@ -2997,7 +3004,8 @@ namespace cppcanvas
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 );
More information about the ooo-build-commit
mailing list