LibreOffice Module drawinglayer (master) 1
|
TextSimplePortionPrimitive2D class. More...
#include <textprimitive2d.hxx>
Public Member Functions | |
TextSimplePortionPrimitive2D (basegfx::B2DHomMatrix aNewTransform, OUString aText, sal_Int32 nTextPosition, sal_Int32 nTextLength, std::vector< double > &&rDXArray, std::vector< sal_Bool > &&rKashidaArray, attribute::FontAttribute aFontAttribute, css::lang::Locale aLocale, const basegfx::BColor &rFontColor, bool bFilled=false, tools::Long nWidthToFill=0, const Color &rTextFillColor=COL_TRANSPARENT) | |
constructor More... | |
void | getTextOutlinesAndTransformation (basegfx::B2DPolyPolygonVector &rTarget, basegfx::B2DHomMatrix &rTransformation) const |
get text outlines as polygons and their according ObjectTransformation. More... | |
const basegfx::B2DHomMatrix & | getTextTransform () const |
data read access More... | |
const OUString & | getText () const |
sal_Int32 | getTextPosition () const |
sal_Int32 | getTextLength () const |
const ::std::vector< double > & | getDXArray () const |
const ::std::vector< sal_Bool > & | getKashidaArray () const |
const attribute::FontAttribute & | getFontAttribute () const |
const css::lang::Locale & | getLocale () const |
const basegfx::BColor & | getFontColor () const |
const Color & | getTextFillColor () const |
bool | isFilled () const |
tools::Long | getWidthToFill () const |
virtual bool | operator== (const BasePrimitive2D &rPrimitive) const override |
compare operator More... | |
virtual basegfx::B2DRange | getB2DRange (const geometry::ViewInformation2D &rViewInformation) const override |
get range More... | |
virtual sal_uInt32 | getPrimitive2DID () const override |
provide unique ID More... | |
Public Member Functions inherited from drawinglayer::primitive2d::BufferedDecompositionPrimitive2D | |
BufferedDecompositionPrimitive2D () | |
virtual void | get2DDecomposition (Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const override |
The getDecomposition default implementation will on demand use create2DDecomposition() if maBuffered2DDecomposition is empty. More... | |
void | setTransparenceForShadow (sal_uInt16 nTransparenceForShadow) |
sal_uInt16 | getTransparenceForShadow () const |
Public Member Functions inherited from drawinglayer::primitive2d::BasePrimitive2D | |
BasePrimitive2D () | |
virtual | ~BasePrimitive2D () override |
virtual bool | operator== (const BasePrimitive2D &rPrimitive) const |
the ==operator is mainly needed to allow testing newly-created primitives against their last incarnation which buffers/holds the made decompositions. More... | |
bool | operator!= (const BasePrimitive2D &rPrimitive) const |
virtual basegfx::B2DRange | getB2DRange (const geometry::ViewInformation2D &rViewInformation) const |
The default implementation will use getDecomposition results to create the range. More... | |
virtual sal_uInt32 | getPrimitive2DID () const =0 |
provide unique ID for fast identifying of known primitive implementations in renderers. More... | |
virtual void | get2DDecomposition (Primitive2DDecompositionVisitor &rVisitor, const geometry::ViewInformation2D &rViewInformation) const |
The default implementation will return an empty sequence. More... | |
Primitive2DContainer | getDecomposition (const css::uno::Sequence< css::beans::PropertyValue > &rViewParameters) |
The getDecomposition implementation for UNO API will use getDecomposition from this implementation. More... | |
css::geometry::RealRectangle2D | getRange (const css::uno::Sequence< css::beans::PropertyValue > &rViewParameters) |
The getRange implementation for UNO API will use getRange from this implementation. More... | |
virtual sal_Int64 | estimateUsage () |
Public Member Functions inherited from salhelper::SimpleReferenceObject | |
SimpleReferenceObject () | |
void | acquire () |
void | release () |
Protected Member Functions | |
virtual void | create2DDecomposition (Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const override |
local decomposition. More... | |
Protected Member Functions inherited from drawinglayer::primitive2d::BufferedDecompositionPrimitive2D | |
const Primitive2DContainer & | getBuffered2DDecomposition () const |
access methods to maBuffered2DDecomposition. More... | |
void | setBuffered2DDecomposition (Primitive2DContainer &&rNew) |
virtual void | create2DDecomposition (Primitive2DContainer &rContainer, const geometry::ViewInformation2D &rViewInformation) const =0 |
method which is to be used to implement the local decomposition of a 2D primitive. More... | |
Protected Member Functions inherited from salhelper::SimpleReferenceObject | |
virtual | ~SimpleReferenceObject () COVERITY_NOEXCEPT_FALSE |
Private Attributes | |
basegfx::B2DHomMatrix | maTextTransform |
text transformation (FontCoordinateSystem) More... | |
OUString | maText |
The text, used from maTextPosition up to maTextPosition + maTextLength. More... | |
sal_Int32 | mnTextPosition |
The index from where on maText is used. More... | |
sal_Int32 | mnTextLength |
The length for maText usage, starting from maTextPosition. More... | |
std::vector< double > | maDXArray |
The DX array in logic units. More... | |
std::vector< sal_Bool > | maKashidaArray |
The Kashida array. More... | |
attribute::FontAttribute | maFontAttribute |
The font definition. More... | |
css::lang::Locale | maLocale |
The Locale for the text. More... | |
basegfx::BColor | maFontColor |
font color More... | |
bool | mbFilled |
tools::Long | mnWidthToFill |
Color | maTextFillColor |
The fill color of the text. More... | |
basegfx::B2DRange | maB2DRange |
#i96669# internal: add simple range buffering for this primitive More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from salhelper::SimpleReferenceObject | |
static void * | operator new (std::size_t nSize) |
static void * | operator new (std::size_t nSize, std::nothrow_t const &rNothrow) |
static void | operator delete (void *pPtr) |
static void | operator delete (void *pPtr, std::nothrow_t const &rNothrow) |
Protected Attributes inherited from salhelper::SimpleReferenceObject | |
oslInterlockedCount | m_nCount |
TextSimplePortionPrimitive2D class.
This is the basic primitive for representing a text portion. It contains all needed information. If it is not handled by a renderer, its decomposition will provide the text tools::PolyPolygon outlines as filled polygons, correctly transformed.
To get better text quality, it is suggested to handle this primitive directly in a renderer. In that case, e.g. hintings on the system can be supported.
maTextTransform | The text transformation contains the text start position (always baselined) as translation, the FontSize as scale (where width relative to height defines font scaling and width == height means no font scaling) and the font rotation and shear. When shear is used and a renderer does not support it, it may be better to use the decomposition which will do everything correctly. Same is true for mirroring which would be expressed as negative scalings. |
rText | The text to be used. Only a part may be used, but a bigger part of the string may be necessary for correct layouting (e.g. international) |
aTextPosition | The index to the first character to use from rText |
aTextLength | The number of characters to use from rText |
rDXArray | The distances between the characters. This parameter may be empty, in that case the renderer is responsible to do something useful. If it is given, it has to be of the size aTextLength. Its values are in logical coordinates and describe the distance for each character to use. This is independent from the font width which is given with maTextTransform. The first value is the offset to use from the start point in FontCoordinateSystem X-Direction (given by maTextTransform) to the start point of the second character |
rKashidaArray | The Kashida insertion positions. |
rFontAttribute | The font definition |
rLocale | The locale to use |
rFontColor | The font color to use |
bFilled | |
nWidthToFill | |
rTextFillColor | Text background color (has nothing to do with bFilled and nWidthToFill) |
Definition at line 95 of file textprimitive2d.hxx.
drawinglayer::primitive2d::TextSimplePortionPrimitive2D::TextSimplePortionPrimitive2D | ( | basegfx::B2DHomMatrix | aNewTransform, |
OUString | aText, | ||
sal_Int32 | nTextPosition, | ||
sal_Int32 | nTextLength, | ||
std::vector< double > && | rDXArray, | ||
std::vector< sal_Bool > && | rKashidaArray, | ||
attribute::FontAttribute | aFontAttribute, | ||
css::lang::Locale | aLocale, | ||
const basegfx::BColor & | rFontColor, | ||
bool | bFilled = false , |
||
tools::Long | nWidthToFill = 0 , |
||
const Color & | rTextFillColor = COL_TRANSPARENT |
||
) |
constructor
Definition at line 203 of file textprimitive2d.cxx.
References getLength(), getText(), getTextLength(), getTextPosition(), maText, and maTextFillColor.
Referenced by drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::impCreateGeometryContent().
|
overrideprotectedvirtual |
local decomposition.
Implements drawinglayer::primitive2d::BufferedDecompositionPrimitive2D.
Reimplemented in drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D.
Definition at line 155 of file textprimitive2d.cxx.
References a, drawinglayer::primitive2d::Primitive2DContainer::append(), basegfx::B2DHomMatrix::decompose(), getFontAttribute(), getFontColor(), getTextLength(), getTextOutlinesAndTransformation(), nCount, drawinglayer::primitive2d::Outline, and basegfx::B2DPolyPolygon::transform().
|
overridevirtual |
get range
Reimplemented from drawinglayer::primitive2d::BasePrimitive2D.
Reimplemented in drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D.
Definition at line 257 of file textprimitive2d.cxx.
References basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix(), decompose(), getFontAttribute(), getLocale(), getText(), drawinglayer::primitive2d::TextLayouterDevice::getTextBoundRect(), getTextLength(), getTextPosition(), getTextTransform(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), basegfx::Range2D< typename TYPE, typename TRAITS >::isEmpty(), maB2DRange, drawinglayer::primitive2d::TextLayouterDevice::setFontAttribute(), and basegfx::B2DRange::transform().
Referenced by drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::getB2DRange().
|
inline |
Definition at line 165 of file textprimitive2d.hxx.
Referenced by drawinglayer::primitive2d::TextBreakupHelper::breakupPortion(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::create2DDecomposition(), drawinglayer::Primitive2dXmlDump::decomposeAndWrite(), getTextOutlinesAndTransformation(), operator==(), drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(), and drawinglayer::primitive2d::TextBreakupHelper::TextBreakupHelper().
|
inline |
Definition at line 167 of file textprimitive2d.hxx.
Referenced by drawinglayer::primitive2d::TextBreakupHelper::breakupPortion(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::create2DDecomposition(), create2DDecomposition(), drawinglayer::Primitive2dXmlDump::decomposeAndWrite(), getB2DRange(), getTextOutlinesAndTransformation(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::impCreateGeometryContent(), operator==(), drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(), and drawinglayer::primitive2d::TextBreakupHelper::TextBreakupHelper().
|
inline |
Definition at line 169 of file textprimitive2d.hxx.
Referenced by drawinglayer::primitive2d::TextBreakupHelper::breakupPortion(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::create2DDecomposition(), create2DDecomposition(), drawinglayer::Primitive2dXmlDump::decomposeAndWrite(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::impCreateGeometryContent(), operator==(), and drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D().
|
inline |
Definition at line 166 of file textprimitive2d.hxx.
Referenced by drawinglayer::primitive2d::TextBreakupHelper::breakupPortion(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::create2DDecomposition(), getTextOutlinesAndTransformation(), operator==(), and drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D().
|
inline |
Definition at line 168 of file textprimitive2d.hxx.
Referenced by drawinglayer::primitive2d::TextBreakupHelper::breakup(), drawinglayer::primitive2d::TextBreakupHelper::breakupPortion(), getB2DRange(), getTextOutlinesAndTransformation(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::impCreateGeometryContent(), operator==(), drawinglayer::processor2d::VclMetafileProcessor2D::processTextSimplePortionPrimitive2D(), drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(), and drawinglayer::primitive2d::TextBreakupHelper::TextBreakupHelper().
|
overridevirtual |
provide unique ID
Implements drawinglayer::primitive2d::BasePrimitive2D.
Reimplemented in drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D.
Definition at line 305 of file textprimitive2d.cxx.
References PRIMITIVE2D_ID_TEXTSIMPLEPORTIONPRIMITIVE2D.
Referenced by drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D().
|
inline |
Definition at line 162 of file textprimitive2d.hxx.
References maText.
Referenced by drawinglayer::primitive2d::TextBreakupHelper::breakup(), drawinglayer::primitive2d::TextBreakupHelper::breakupPortion(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::create2DDecomposition(), drawinglayer::Primitive2dXmlDump::decomposeAndWrite(), getB2DRange(), getTextOutlinesAndTransformation(), operator==(), drawinglayer::processor2d::VclMetafileProcessor2D::processTextSimplePortionPrimitive2D(), drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(), and TextSimplePortionPrimitive2D().
|
inline |
Definition at line 170 of file textprimitive2d.hxx.
References maTextFillColor.
Referenced by drawinglayer::primitive2d::TextBreakupHelper::breakupPortion(), and drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D().
|
inline |
Definition at line 164 of file textprimitive2d.hxx.
Referenced by drawinglayer::primitive2d::TextBreakupHelper::breakup(), drawinglayer::primitive2d::TextBreakupHelper::breakupPortion(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::create2DDecomposition(), create2DDecomposition(), getB2DRange(), getTextOutlinesAndTransformation(), operator==(), drawinglayer::processor2d::VclMetafileProcessor2D::processTextSimplePortionPrimitive2D(), drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(), and TextSimplePortionPrimitive2D().
void drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation | ( | basegfx::B2DPolyPolygonVector & | rTarget, |
basegfx::B2DHomMatrix & | rTransformation | ||
) | const |
get text outlines as polygons and their according ObjectTransformation.
Handles all the necessary VCL outline extractions, scaling adaptations and other stuff.
Definition at line 85 of file textprimitive2d.cxx.
References a, basegfx::absolute(), basegfx::utils::createScaleShearXRotateTranslateB2DHomMatrix(), decompose(), basegfx::fTools::equal(), getDXArray(), getFontAttribute(), getKashidaArray(), getLocale(), getText(), getTextLength(), drawinglayer::primitive2d::TextLayouterDevice::getTextOutlines(), getTextPosition(), getTextTransform(), basegfx::Tuple2D< typename TYPE >::getX(), basegfx::Tuple2D< typename TYPE >::getY(), basegfx::fTools::less(), nCount, rTarget, and drawinglayer::primitive2d::TextLayouterDevice::setFontAttribute().
Referenced by create2DDecomposition().
|
inline |
Definition at line 163 of file textprimitive2d.hxx.
Referenced by drawinglayer::primitive2d::TextBreakupHelper::breakup(), drawinglayer::primitive2d::TextBreakupHelper::breakupPortion(), drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::create2DDecomposition(), getB2DRange(), getTextOutlinesAndTransformation(), operator==(), drawinglayer::processor2d::VclMetafileProcessor2D::processTextSimplePortionPrimitive2D(), drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(), and TextSimplePortionPrimitive2D().
|
inline |
data read access
Definition at line 161 of file textprimitive2d.hxx.
Referenced by drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D::create2DDecomposition(), drawinglayer::Primitive2dXmlDump::decomposeAndWrite(), getB2DRange(), getTextOutlinesAndTransformation(), operator==(), drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D(), and drawinglayer::primitive2d::TextBreakupHelper::TextBreakupHelper().
|
inline |
Definition at line 172 of file textprimitive2d.hxx.
Referenced by drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D().
|
inline |
Definition at line 171 of file textprimitive2d.hxx.
Referenced by drawinglayer::processor2d::VclProcessor2D::RenderTextSimpleOrDecoratedPortionPrimitive2D().
|
overridevirtual |
compare operator
Reimplemented from drawinglayer::primitive2d::BasePrimitive2D.
Reimplemented in drawinglayer::primitive2d::TextDecoratedPortionPrimitive2D.
Definition at line 235 of file textprimitive2d.cxx.
References getDXArray(), getFontAttribute(), getFontColor(), getKashidaArray(), getLocale(), getText(), getTextLength(), getTextPosition(), getTextTransform(), drawinglayer::primitive2d::LocalesAreEqual(), maTextFillColor, mbFilled, and mnWidthToFill.
|
private |
#i96669# internal: add simple range buffering for this primitive
Definition at line 135 of file textprimitive2d.hxx.
Referenced by getB2DRange().
|
private |
The DX array in logic units.
Definition at line 111 of file textprimitive2d.hxx.
|
private |
The font definition.
Definition at line 117 of file textprimitive2d.hxx.
|
private |
font color
Definition at line 123 of file textprimitive2d.hxx.
|
private |
The Kashida array.
Definition at line 114 of file textprimitive2d.hxx.
|
private |
The Locale for the text.
Definition at line 120 of file textprimitive2d.hxx.
|
private |
The text, used from maTextPosition up to maTextPosition + maTextLength.
Definition at line 102 of file textprimitive2d.hxx.
|
private |
The fill color of the text.
Definition at line 132 of file textprimitive2d.hxx.
Referenced by operator==().
|
private |
text transformation (FontCoordinateSystem)
Definition at line 99 of file textprimitive2d.hxx.
|
private |
Definition at line 126 of file textprimitive2d.hxx.
Referenced by operator==().
|
private |
The length for maText usage, starting from maTextPosition.
Definition at line 108 of file textprimitive2d.hxx.
|
private |
The index from where on maText is used.
Definition at line 105 of file textprimitive2d.hxx.
|
private |
Definition at line 129 of file textprimitive2d.hxx.
Referenced by operator==().