summaryrefslogtreecommitdiff
path: root/canvas/source
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2010-09-30 16:10:40 +0100
committerCaolán McNamara <caolanm@redhat.com>2010-09-30 16:10:40 +0100
commit4361349144bc061e9045fe66f14a78c7cd20621a (patch)
treefbfd13bbe357a62ca30e3d25c8be6a2fd1069caf /canvas/source
parent79279751c2808294b9421c62376f5898ae0aa356 (diff)
#i64671# transfer VCL's FontPitch through DrawingLayer to Canvas
Diffstat (limited to 'canvas/source')
-rw-r--r--canvas/source/cairo/cairo_canvasfont.cxx5
-rwxr-xr-xcanvas/source/directx/dx_textlayout_drawhelper.cxx6
-rw-r--r--canvas/source/vcl/canvasfont.cxx5
3 files changed, 16 insertions, 0 deletions
diff --git a/canvas/source/cairo/cairo_canvasfont.cxx b/canvas/source/cairo/cairo_canvasfont.cxx
index 452280728151..a083d2d4a82f 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 56ec00e9a648..d81a47d14384 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 e95a3f79f2b5..302254acdcab 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));