| 1 |
Index: cppcanvas/source/mtfrenderer/implrenderer.cxx
|
| 2 |
===================================================================
|
| 3 |
--- cppcanvas/source/mtfrenderer/implrenderer.cxx (revision 276100)
|
| 4 |
+++ cppcanvas/source/mtfrenderer/implrenderer.cxx (working copy)
|
| 5 |
@@ -52,6 +52,7 @@
|
| 6 |
#include <com/sun/star/rendering/XParametricPolyPolygon2DFactory.hpp>
|
| 7 |
#include <com/sun/star/uno/Sequence.hxx>
|
| 8 |
#include <com/sun/star/geometry/RealPoint2D.hpp>
|
| 9 |
+#include <com/sun/star/rendering/PanoseProportion.hpp>
|
| 10 |
#include <com/sun/star/rendering/ViewState.hpp>
|
| 11 |
#include <com/sun/star/rendering/RenderState.hpp>
|
| 12 |
#include <com/sun/star/rendering/XCanvasFont.hpp>
|
| 13 |
@@ -956,6 +957,12 @@
|
| 14 |
rParms.mrParms.maFontLetterForm.isValid() ?
|
| 15 |
rParms.mrParms.maFontLetterForm.getValue() :
|
| 16 |
(rFont.GetItalic() == ITALIC_NONE) ? 0 : 9;
|
| 17 |
+ aFontRequest.FontDescription.FontDescription.Proportion =
|
| 18 |
+ rParms.mrParms.maFontProportion.isValid() ?
|
| 19 |
+ rParms.mrParms.maFontProportion.getValue() :
|
| 20 |
+ (rFont.GetPitch() == PITCH_FIXED)
|
| 21 |
+ ? rendering::PanoseProportion::MONO_SPACED
|
| 22 |
+ : rendering::PanoseProportion::ANYTHING;
|
| 23 |
|
| 24 |
LanguageType aLang = rFont.GetLanguage();
|
| 25 |
aFontRequest.Locale = MsLangId::convertLanguageToLocale(aLang, false);
|
| 26 |
@@ -3073,7 +3080,8 @@
|
| 27 |
if( rParams.maFontName.isValid() ||
|
| 28 |
rParams.maFontWeight.isValid() ||
|
| 29 |
rParams.maFontLetterForm.isValid() ||
|
| 30 |
- rParams.maFontUnderline.isValid() )
|
| 31 |
+ rParams.maFontUnderline.isValid() ||
|
| 32 |
+ rParams.maFontProportion.isValid() )
|
| 33 |
{
|
| 34 |
::cppcanvas::internal::OutDevState& rState = getState( aStateStack );
|
| 35 |
|
| 36 |
Index: cppcanvas/inc/cppcanvas/renderer.hxx
|
| 37 |
===================================================================
|
| 38 |
--- cppcanvas/inc/cppcanvas/renderer.hxx (revision 276100)
|
| 39 |
+++ cppcanvas/inc/cppcanvas/renderer.hxx (working copy)
|
| 40 |
@@ -139,6 +139,9 @@
|
| 41 |
/// Optionally forces the given font letter form (italics etc.) for all text actions
|
| 42 |
::comphelper::OptionalValue< sal_Int8 > maFontLetterForm;
|
| 43 |
|
| 44 |
+ /// Optionally forces the given font proportion (condensed, monospaced etc.) for all text actions
|
| 45 |
+ ::comphelper::OptionalValue< sal_Int8 > maFontProportion;
|
| 46 |
+
|
| 47 |
/// Optionally forces underlining for all text actions
|
| 48 |
::comphelper::OptionalValue< bool > maFontUnderline;
|
| 49 |
};
|
| 50 |
Index: canvas/source/directx/dx_textlayout_drawhelper.cxx
|
| 51 |
===================================================================
|
| 52 |
--- canvas/source/directx/dx_textlayout_drawhelper.cxx (revision 276100)
|
| 53 |
+++ canvas/source/directx/dx_textlayout_drawhelper.cxx (working copy)
|
| 54 |
@@ -135,6 +135,9 @@
|
| 55 |
aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
|
| 56 |
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
|
| 57 |
aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
|
| 58 |
+ aFont.SetPitch(
|
| 59 |
+ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
|
| 60 |
+ ? PITCH_FIXED : PITCH_VARIABLE);
|
| 61 |
|
| 62 |
aFont.SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
|
| 63 |
|
| 64 |
@@ -267,6 +270,9 @@
|
| 65 |
aFont.SetVertical( (rFontRequest.FontDescription.IsVertical==com::sun::star::util::TriState_YES) ? TRUE : FALSE );
|
| 66 |
aFont.SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
|
| 67 |
aFont.SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
|
| 68 |
+ aFont.SetPitch(
|
| 69 |
+ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
|
| 70 |
+ ? PITCH_FIXED : PITCH_VARIABLE);
|
| 71 |
|
| 72 |
// adjust to stretched font
|
| 73 |
if(!::rtl::math::approxEqual(rFontMatrix.m00, rFontMatrix.m11))
|
| 74 |
Index: canvas/source/vcl/canvasfont.cxx
|
| 75 |
===================================================================
|
| 76 |
--- canvas/source/vcl/canvasfont.cxx (revision 276100)
|
| 77 |
+++ canvas/source/vcl/canvasfont.cxx (working copy)
|
| 78 |
@@ -38,6 +38,8 @@
|
| 79 |
#include <i18npool/mslangid.hxx>
|
| 80 |
#include <vcl/metric.hxx>
|
| 81 |
|
| 82 |
+#include <com/sun/star/rendering/PanoseProportion.hpp>
|
| 83 |
+
|
| 84 |
#include "canvasfont.hxx"
|
| 85 |
#include "textlayout.hxx"
|
| 86 |
|
| 87 |
@@ -66,6 +68,9 @@
|
| 88 |
// TODO(F2): improve panose->vclenum conversion
|
| 89 |
maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
|
| 90 |
maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
|
| 91 |
+ maFont->SetPitch(
|
| 92 |
+ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
|
| 93 |
+ ? PITCH_FIXED : PITCH_VARIABLE);
|
| 94 |
|
| 95 |
maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
|
| 96 |
|
| 97 |
Index: canvas/source/cairo/cairo_canvasfont.cxx
|
| 98 |
===================================================================
|
| 99 |
--- canvas/source/cairo/cairo_canvasfont.cxx (revision 276100)
|
| 100 |
+++ canvas/source/cairo/cairo_canvasfont.cxx (working copy)
|
| 101 |
@@ -33,6 +33,8 @@
|
| 102 |
|
| 103 |
#include <canvas/debug.hxx>
|
| 104 |
|
| 105 |
+#include <com/sun/star/rendering/PanoseProportion.hpp>
|
| 106 |
+
|
| 107 |
#include <rtl/math.hxx>
|
| 108 |
#include <basegfx/numeric/ftools.hxx>
|
| 109 |
|
| 110 |
@@ -86,6 +88,9 @@
|
| 111 |
// TODO(F2): improve panose->vclenum conversion
|
| 112 |
maFont->SetWeight( static_cast<FontWeight>(rFontRequest.FontDescription.FontDescription.Weight) );
|
| 113 |
maFont->SetItalic( (rFontRequest.FontDescription.FontDescription.Letterform<=8) ? ITALIC_NONE : ITALIC_NORMAL );
|
| 114 |
+ maFont->SetPitch(
|
| 115 |
+ rFontRequest.FontDescription.FontDescription.Proportion == rendering::PanoseProportion::MONO_SPACED
|
| 116 |
+ ? PITCH_FIXED : PITCH_VARIABLE);
|
| 117 |
|
| 118 |
maFont->SetLanguage(MsLangId::convertLocaleToLanguage(rFontRequest.Locale));
|
| 119 |
|
| 120 |
Index: drawinglayer/source/processor2d/canvasprocessor.cxx
|
| 121 |
===================================================================
|
| 122 |
--- drawinglayer/source/processor2d/canvasprocessor.cxx (revision 276100)
|
| 123 |
+++ drawinglayer/source/processor2d/canvasprocessor.cxx (working copy)
|
| 124 |
@@ -64,6 +64,7 @@
|
| 125 |
#include <drawinglayer/primitive2d/alphaprimitive2d.hxx>
|
| 126 |
#include <basegfx/tuple/b2i64tuple.hxx>
|
| 127 |
#include <basegfx/range/b2irange.hxx>
|
| 128 |
+#include <com/sun/star/rendering/PanoseProportion.hpp>
|
| 129 |
#include <com/sun/star/rendering/XIntegerReadOnlyBitmap.hpp>
|
| 130 |
#include <com/sun/star/rendering/CompositeOperation.hpp>
|
| 131 |
#include <com/sun/star/rendering/StrokeAttributes.hpp>
|
| 132 |
@@ -1526,6 +1527,10 @@
|
| 133 |
aFontRequest.FontDescription.IsVertical = rFontAttrs.getVertical() ? util::TriState_YES : util::TriState_NO;
|
| 134 |
// TODO(F2): improve vclenum->panose conversion
|
| 135 |
aFontRequest.FontDescription.FontDescription.Weight = static_cast< sal_uInt8 >(rFontAttrs.getWeight());
|
| 136 |
+ aFontRequest.FontDescription.FontDescription.Proportion =
|
| 137 |
+ rFontAttrs.getMonospaced()
|
| 138 |
+ ? rendering::PanoseProportion::MONO_SPACED
|
| 139 |
+ : rendering::PanoseProportion::ANYTHING;
|
| 140 |
aFontRequest.FontDescription.FontDescription.Letterform = rFontAttrs.getItalic() ? 9 : 0;
|
| 141 |
|
| 142 |
// init CellSize to 1.0, else a default font height will be used
|
| 143 |
Index: drawinglayer/source/primitive2d/textlayoutdevice.cxx
|
| 144 |
===================================================================
|
| 145 |
--- drawinglayer/source/primitive2d/textlayoutdevice.cxx (revision 276100)
|
| 146 |
+++ drawinglayer/source/primitive2d/textlayoutdevice.cxx (working copy)
|
| 147 |
@@ -345,6 +345,7 @@
|
| 148 |
aRetval.SetWeight(static_cast<FontWeight>(rFontAttributes.getWeight()));
|
| 149 |
aRetval.SetItalic(rFontAttributes.getItalic() ? ITALIC_NORMAL : ITALIC_NONE);
|
| 150 |
aRetval.SetOutline(rFontAttributes.getOutline());
|
| 151 |
+ aRetval.SetPitch(rFontAttributes.getMonospaced() ? PITCH_FIXED : PITCH_VARIABLE);
|
| 152 |
aRetval.SetLanguage(MsLangId::convertLocaleToLanguage(rLocale));
|
| 153 |
|
| 154 |
#ifdef WIN32
|
| 155 |
@@ -384,6 +385,7 @@
|
| 156 |
RTL_TEXTENCODING_SYMBOL == rFont.GetCharSet(),
|
| 157 |
rFont.IsVertical(),
|
| 158 |
ITALIC_NONE != rFont.GetItalic(),
|
| 159 |
+ PITCH_FIXED == rFont.GetPitch(),
|
| 160 |
rFont.IsOutline(),
|
| 161 |
bRTL,
|
| 162 |
bBiDiStrong);
|
| 163 |
Index: drawinglayer/source/primitive2d/textprimitive2d.cxx
|
| 164 |
===================================================================
|
| 165 |
--- drawinglayer/source/primitive2d/textprimitive2d.cxx (revision 276100)
|
| 166 |
+++ drawinglayer/source/primitive2d/textprimitive2d.cxx (working copy)
|
| 167 |
@@ -63,7 +63,8 @@
|
| 168 |
&& getItalic() == rCompare.getItalic()
|
| 169 |
&& getOutline() == rCompare.getOutline()
|
| 170 |
&& getRTL() == rCompare.getRTL()
|
| 171 |
- && getBiDiStrong() == rCompare.getBiDiStrong());
|
| 172 |
+ && getBiDiStrong() == rCompare.getBiDiStrong()
|
| 173 |
+ && getMonospaced() == rCompare.getMonospaced());
|
| 174 |
}
|
| 175 |
} // end of namespace primitive2d
|
| 176 |
} // end of namespace drawinglayer
|
| 177 |
Index: drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx
|
| 178 |
===================================================================
|
| 179 |
--- drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx (revision 276100)
|
| 180 |
+++ drawinglayer/inc/drawinglayer/primitive2d/textprimitive2d.hxx (working copy)
|
| 181 |
@@ -75,6 +75,7 @@
|
| 182 |
unsigned mbOutline : 1; // Outline Flag
|
| 183 |
unsigned mbRTL : 1; // RTL Flag
|
| 184 |
unsigned mbBiDiStrong : 1; // BiDi Flag
|
| 185 |
+ unsigned mbMonospaced : 1;
|
| 186 |
// TODO: pair kerning and CJK kerning
|
| 187 |
|
| 188 |
public:
|
| 189 |
@@ -85,6 +86,7 @@
|
| 190 |
bool bSymbol = false,
|
| 191 |
bool bVertical = false,
|
| 192 |
bool bItalic = false,
|
| 193 |
+ bool bMonospaced = false,
|
| 194 |
bool bOutline = false,
|
| 195 |
bool bRTL = false,
|
| 196 |
bool bBiDiStrong = false)
|
| 197 |
@@ -96,7 +98,8 @@
|
| 198 |
mbItalic(bItalic),
|
| 199 |
mbOutline(bOutline),
|
| 200 |
mbRTL(bRTL),
|
| 201 |
- mbBiDiStrong(bBiDiStrong)
|
| 202 |
+ mbBiDiStrong(bBiDiStrong),
|
| 203 |
+ mbMonospaced(bMonospaced)
|
| 204 |
{
|
| 205 |
}
|
| 206 |
|
| 207 |
@@ -113,6 +116,7 @@
|
| 208 |
bool getOutline() const { return mbOutline; }
|
| 209 |
bool getRTL() const { return mbRTL; }
|
| 210 |
bool getBiDiStrong() const { return mbBiDiStrong; }
|
| 211 |
+ bool getMonospaced() const { return mbMonospaced; }
|
| 212 |
};
|
| 213 |
} // end of namespace primitive2d
|
| 214 |
} // end of namespace drawinglayer
|