LibreOffice Module drawinglayer (master) 1
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
drawinglayer::primitive2d::TextSimplePortionPrimitive2D Class Reference

TextSimplePortionPrimitive2D class. More...

#include <textprimitive2d.hxx>

Inheritance diagram for drawinglayer::primitive2d::TextSimplePortionPrimitive2D:
[legend]
Collaboration diagram for drawinglayer::primitive2d::TextSimplePortionPrimitive2D:
[legend]

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::B2DHomMatrixgetTextTransform () 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::FontAttributegetFontAttribute () const
 
const css::lang::Locale & getLocale () const
 
const basegfx::BColorgetFontColor () const
 
const ColorgetTextFillColor () 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 Primitive2DContainergetBuffered2DDecomposition () 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_BoolmaKashidaArray
 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
 

Detailed Description

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.

Parameters
maTextTransformThe 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.
rTextThe 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)
aTextPositionThe index to the first character to use from rText
aTextLengthThe number of characters to use from rText
rDXArrayThe 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
rKashidaArrayThe Kashida insertion positions.
rFontAttributeThe font definition
rLocaleThe locale to use
rFontColorThe font color to use
bFilled
nWidthToFill
rTextFillColorText background color (has nothing to do with bFilled and nWidthToFill)

Definition at line 95 of file textprimitive2d.hxx.

Constructor & Destructor Documentation

◆ TextSimplePortionPrimitive2D()

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 
)

Member Function Documentation

◆ create2DDecomposition()

void drawinglayer::primitive2d::TextSimplePortionPrimitive2D::create2DDecomposition ( Primitive2DContainer rContainer,
const geometry::ViewInformation2D rViewInformation 
) const
overrideprotectedvirtual

◆ getB2DRange()

basegfx::B2DRange drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getB2DRange ( const geometry::ViewInformation2D rViewInformation) const
overridevirtual

◆ getDXArray()

const ::std::vector< double > & drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getDXArray ( ) const
inline

◆ getFontAttribute()

const attribute::FontAttribute & drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getFontAttribute ( ) const
inline

◆ getFontColor()

const basegfx::BColor & drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getFontColor ( ) const
inline

◆ getKashidaArray()

const ::std::vector< sal_Bool > & drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getKashidaArray ( ) const
inline

◆ getLocale()

const css::lang::Locale & drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getLocale ( ) const
inline

◆ getPrimitive2DID()

sal_uInt32 drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getPrimitive2DID ( ) const
overridevirtual

◆ getText()

const OUString & drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getText ( ) const
inline

◆ getTextFillColor()

const Color & drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getTextFillColor ( ) const
inline

◆ getTextLength()

sal_Int32 drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getTextLength ( ) const
inline

◆ getTextOutlinesAndTransformation()

void drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getTextOutlinesAndTransformation ( basegfx::B2DPolyPolygonVector rTarget,
basegfx::B2DHomMatrix rTransformation 
) const

◆ getTextPosition()

sal_Int32 drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getTextPosition ( ) const
inline

◆ getTextTransform()

const basegfx::B2DHomMatrix & drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getTextTransform ( ) const
inline

◆ getWidthToFill()

tools::Long drawinglayer::primitive2d::TextSimplePortionPrimitive2D::getWidthToFill ( ) const
inline

◆ isFilled()

bool drawinglayer::primitive2d::TextSimplePortionPrimitive2D::isFilled ( ) const
inline

◆ operator==()

bool drawinglayer::primitive2d::TextSimplePortionPrimitive2D::operator== ( const BasePrimitive2D rPrimitive) const
overridevirtual

Member Data Documentation

◆ maB2DRange

basegfx::B2DRange drawinglayer::primitive2d::TextSimplePortionPrimitive2D::maB2DRange
private

#i96669# internal: add simple range buffering for this primitive

Definition at line 135 of file textprimitive2d.hxx.

Referenced by getB2DRange().

◆ maDXArray

std::vector<double> drawinglayer::primitive2d::TextSimplePortionPrimitive2D::maDXArray
private

The DX array in logic units.

Definition at line 111 of file textprimitive2d.hxx.

◆ maFontAttribute

attribute::FontAttribute drawinglayer::primitive2d::TextSimplePortionPrimitive2D::maFontAttribute
private

The font definition.

Definition at line 117 of file textprimitive2d.hxx.

◆ maFontColor

basegfx::BColor drawinglayer::primitive2d::TextSimplePortionPrimitive2D::maFontColor
private

font color

Definition at line 123 of file textprimitive2d.hxx.

◆ maKashidaArray

std::vector<sal_Bool> drawinglayer::primitive2d::TextSimplePortionPrimitive2D::maKashidaArray
private

The Kashida array.

Definition at line 114 of file textprimitive2d.hxx.

◆ maLocale

css::lang::Locale drawinglayer::primitive2d::TextSimplePortionPrimitive2D::maLocale
private

The Locale for the text.

Definition at line 120 of file textprimitive2d.hxx.

◆ maText

OUString drawinglayer::primitive2d::TextSimplePortionPrimitive2D::maText
private

The text, used from maTextPosition up to maTextPosition + maTextLength.

Definition at line 102 of file textprimitive2d.hxx.

◆ maTextFillColor

Color drawinglayer::primitive2d::TextSimplePortionPrimitive2D::maTextFillColor
private

The fill color of the text.

Definition at line 132 of file textprimitive2d.hxx.

Referenced by operator==().

◆ maTextTransform

basegfx::B2DHomMatrix drawinglayer::primitive2d::TextSimplePortionPrimitive2D::maTextTransform
private

text transformation (FontCoordinateSystem)

Definition at line 99 of file textprimitive2d.hxx.

◆ mbFilled

bool drawinglayer::primitive2d::TextSimplePortionPrimitive2D::mbFilled
private

Definition at line 126 of file textprimitive2d.hxx.

Referenced by operator==().

◆ mnTextLength

sal_Int32 drawinglayer::primitive2d::TextSimplePortionPrimitive2D::mnTextLength
private

The length for maText usage, starting from maTextPosition.

Definition at line 108 of file textprimitive2d.hxx.

◆ mnTextPosition

sal_Int32 drawinglayer::primitive2d::TextSimplePortionPrimitive2D::mnTextPosition
private

The index from where on maText is used.

Definition at line 105 of file textprimitive2d.hxx.

◆ mnWidthToFill

tools::Long drawinglayer::primitive2d::TextSimplePortionPrimitive2D::mnWidthToFill
private

Definition at line 129 of file textprimitive2d.hxx.

Referenced by operator==().


The documentation for this class was generated from the following files: