summaryrefslogtreecommitdiff
path: root/drawinglayer/source/processor2d/vclprocessor2d.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'drawinglayer/source/processor2d/vclprocessor2d.cxx')
-rw-r--r--drawinglayer/source/processor2d/vclprocessor2d.cxx75
1 files changed, 14 insertions, 61 deletions
diff --git a/drawinglayer/source/processor2d/vclprocessor2d.cxx b/drawinglayer/source/processor2d/vclprocessor2d.cxx
index daf8ce5d525f..e5a88812dd10 100644
--- a/drawinglayer/source/processor2d/vclprocessor2d.cxx
+++ b/drawinglayer/source/processor2d/vclprocessor2d.cxx
@@ -138,79 +138,31 @@ namespace drawinglayer
{
// decompose matrix to have position and size of text
basegfx::B2DHomMatrix aLocalTransform(maCurrentTransformation * rTextCandidate.getTextTransform());
- basegfx::B2DVector aScale, aTranslate;
+ basegfx::B2DVector aFontScaling, aTranslate;
double fRotate, fShearX;
- aLocalTransform.decompose(aScale, aTranslate, fRotate, fShearX);
+ aLocalTransform.decompose(aFontScaling, aTranslate, fRotate, fShearX);
bool bPrimitiveAccepted(false);
if(basegfx::fTools::equalZero(fShearX))
{
- if(basegfx::fTools::less(aScale.getX(), 0.0) && basegfx::fTools::less(aScale.getY(), 0.0))
+ if(basegfx::fTools::less(aFontScaling.getX(), 0.0) && basegfx::fTools::less(aFontScaling.getY(), 0.0))
{
// handle special case: If scale is negative in (x,y) (3rd quadrant), it can
- // be expressed as rotation by PI
- aScale = basegfx::absolute(aScale);
+ // be expressed as rotation by PI. Use this since the Font rendering will not
+ // apply the negative scales in any form
+ aFontScaling = basegfx::absolute(aFontScaling);
fRotate += F_PI;
}
- if(basegfx::fTools::more(aScale.getX(), 0.0) && basegfx::fTools::more(aScale.getY(), 0.0))
+ if(basegfx::fTools::more(aFontScaling.getX(), 0.0) && basegfx::fTools::more(aFontScaling.getY(), 0.0))
{
- // #i96581# Get the font forced without FontStretching (use FontHeight as FontWidth)
+ // Get the VCL font (use FontHeight as FontWidth)
Font aFont(primitive2d::getVclFontFromFontAttributes(
rTextCandidate.getFontAttributes(),
-
- // #i100373# FontScaling
- //
- // There are two different definitions for unscaled fonts, (1) 0==width and
- // (2) height==width where (2) is the more modern one supported on all non-WIN32
- // systems and (1) is the old one coming from WIN16-VCL definitions where
- // that ominous FontWidth (available over FontMetric) is involved. While
- // WIN32 only supports (1), all other systems support (2). When on WIN32, the
- // support for (1) is ensured inside getVclFontFromFontAttributes.
- //
- // The former usage of (2) leads to problems when it is used on non-WIN32 systems
- // and exported to MetaFile FontActions where the scale is taken over unseen. When
- // such a MetaFile is imported on a WIN32-System supporting (1), all fonts are
- // seen as scaled an look wrong.
- //
- // The simplest and fastest solution is to fallback to (1) independent from the
- // system we are running on.
- //
- // The best solution would be a system-independent Y-value just expressing the
- // font scaling, e.g. when (2) is used and width == height, use 1.0 as Y-Value,
- // which would also solve the involved ominous FontWidth value for WIN32-systems.
- // This is a region which needs redesign urgently.
- //
- 0, // aScale.getY(),
-
- aScale.getY(),
+ aFontScaling.getX(),
+ aFontScaling.getY(),
fRotate,
- rTextCandidate.getLocale(),
- *mpOutputDevice));
-
- if(!basegfx::fTools::equal(aScale.getX(), aScale.getY()))
- {
- // #100424# We have a hint on FontScaling here. To decide a look
- // at the pure font's scale is needed, since e.g. SC uses unequally scaled
- // MapModes (was: #i96581#, but use available full precision from primitive
- // now). aTranslate and fShearX can be reused since no longer needed.
- basegfx::B2DVector aFontScale;
- double fFontRotate;
- rTextCandidate.getTextTransform().decompose(aFontScale, aTranslate, fFontRotate, fShearX);
-
- if(!basegfx::fTools::equal(aFontScale.getX(), aFontScale.getY()))
- {
- // indeed a FontScaling. Set at Font. Use the combined scale
- // and rotate here
- aFont = primitive2d::getVclFontFromFontAttributes(
- rTextCandidate.getFontAttributes(),
- aScale.getX(),
- aScale.getY(),
- fRotate,
- rTextCandidate.getLocale(),
- *mpOutputDevice);
- }
- }
+ rTextCandidate.getLocale()));
// handle additional font attributes
const primitive2d::TextDecoratedPortionPrimitive2D* pTCPP =
@@ -314,10 +266,11 @@ namespace drawinglayer
if(rTextCandidate.getDXArray().size())
{
aTransformedDXArray.reserve(rTextCandidate.getDXArray().size());
- const basegfx::B2DVector aPixelVector(aLocalTransform * basegfx::B2DVector(1.0, 0.0));
+ const basegfx::B2DVector aPixelVector(maCurrentTransformation * basegfx::B2DVector(1.0, 0.0));
const double fPixelVectorFactor(aPixelVector.getLength());
- for(::std::vector< double >::const_iterator aStart(rTextCandidate.getDXArray().begin()); aStart != rTextCandidate.getDXArray().end(); aStart++)
+ for(::std::vector< double >::const_iterator aStart(rTextCandidate.getDXArray().begin());
+ aStart != rTextCandidate.getDXArray().end(); aStart++)
{
aTransformedDXArray.push_back(basegfx::fround((*aStart) * fPixelVectorFactor));
}