Cinder  0.9.1
Classes | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Friends | List of all members
cinder::svg::TextSpan Class Reference

#include <Svg.h>

Inherits cinder::svg::Node.

Classes

class  Attributes
 

Public Member Functions

 TextSpan (const Node *parent, const XmlTree &xml)
 
 TextSpan (const Node *parent, const std::string &spanString)
 
const std::string & getString () const
 
const std::shared_ptr< FontgetFont () const
 
std::vector< std::pair< uint16_t, vec2 > > getGlyphMeasures () const
 
vec2 getTextPen () const
 
float getRotation () const
 
class DocgetDoc () const
 
const NodegetParent () const
 
const std::string & getId () const
 
std::string getDomPath () const
 
const StylegetStyle () const
 
void setStyle (const Style &style)
 
Style calcInheritedStyle () const
 
virtual bool containsPoint (const vec2 &pt) const
 
void render (Renderer &renderer) const
 
virtual const NodefindInAncestors (const std::string &elementId) const
 
Paint findPaintInAncestors (const std::string &paintName) const
 
bool specifiesTransform () const
 
mat3 getTransform () const
 
void setTransform (const mat3 &transform)
 
void unspecifyTransform ()
 
mat3 getTransformInverse () const
 
mat3 getTransformAbsolute () const
 
mat3 getTransformAbsoluteInverse () const
 
Rectf getBoundingBox () const
 
Rectf getBoundingBoxAbsolute () const
 
virtual Shape2d getShape () const
 
Shape2d getShapeAbsolute () const
 
const PaintgetFill () const
 
const PaintgetStroke () const
 
float getOpacity () const
 
float getFillOpacity () const
 
float getStrokeOpacity () const
 
FillRule getFillRule () const
 
LineCap getLineCap () const
 
LineJoin getLineJoin () const
 
float getStrokeWidth () const
 
const std::vector< std::string > & getFontFamilies () const
 
Value getFontSize () const
 
bool isVisible () const
 
bool isDisplayNone () const
 

Protected Member Functions

virtual void renderSelf (Renderer &renderer) const
 
virtual bool isDrawable () const
 
void startRender (Renderer &renderer, const Style &style) const
 
void finishRender (Renderer &renderer, const Style &style) const
 
virtual Rectf calcBoundingBox () const
 
void parseStyle (const std::string &value)
 

Static Protected Member Functions

static Paint parsePaint (const char *value, bool *specified, const Node *parentNode)
 
static mat3 parseTransform (const std::string &value)
 
static bool parseTransformComponent (const char **c, mat3 *result)
 
static std::string findStyleValue (const std::string &styleString, const std::string &key)
 

Protected Attributes

bool mIgnoreAttributes
 
Attributes mAttributes
 
std::string mString
 
std::shared_ptr< FontmFont
 
std::shared_ptr< std::vector< std::pair< uint16_t, vec2 > > > mGlyphMeasures
 
std::shared_ptr< Shape2dmShape
 
std::vector< TextSpanRefmSpans
 
const NodemParent
 
std::string mId
 
Style mStyle
 
bool mSpecifiesTransform
 
mat3 mTransform
 
bool mBoundingBoxCached
 
Rectf mBoundingBox
 

Friends

class Text
 

Detailed Description

SVG tspan Element. Generally owned by a svg::Text Node. http://www.w3.org/TR/SVG/text.html#TSpanElement.

Constructor & Destructor Documentation

cinder::svg::TextSpan::TextSpan ( const Node parent,
const XmlTree xml 
)
cinder::svg::TextSpan::TextSpan ( const Node parent,
const std::string &  spanString 
)

Member Function Documentation

const std::string& cinder::svg::TextSpan::getString ( ) const
const std::shared_ptr< Font > cinder::svg::TextSpan::getFont ( ) const
std::vector< std::pair< uint16_t, vec2 > > cinder::svg::TextSpan::getGlyphMeasures ( ) const

Returns a vector of glyph IDs and positions for the string, ignoring rotation. Cached and lazily calculated.

vec2 cinder::svg::TextSpan::getTextPen ( ) const
float cinder::svg::TextSpan::getRotation ( ) const
void cinder::svg::TextSpan::renderSelf ( Renderer renderer) const
protectedvirtual

Implements cinder::svg::Node.

Doc * cinder::svg::Node::getDoc ( ) const
inherited

Returns the svg::Doc this Node is an element of.

const Node* cinder::svg::Node::getParent ( ) const
inherited

Returns the immediate parent of this node.

const std::string& cinder::svg::Node::getId ( ) const
inherited

Returns the ID of this Node when present.

string cinder::svg::Node::getDomPath ( ) const
inherited

Returns a DOM-style path to this node.

const Style& cinder::svg::Node::getStyle ( ) const
inherited

Returns the style elements defined on this Node but not inherited from ancestors.

void cinder::svg::Node::setStyle ( const Style style)
inherited

Sets the style defined on this Node but not inherited from ancestors.

Style cinder::svg::Node::calcInheritedStyle ( ) const
inherited

Returns the node's Style, including attributes inherited from its ancestors for attributes it does not specify.

virtual bool cinder::svg::Node::containsPoint ( const vec2 &  pt) const
virtualinherited

Returns whether the point pt is inside of the Node's shape.

Reimplemented in cinder::svg::Image, cinder::svg::Polyline, cinder::svg::Polygon, cinder::svg::Rect, cinder::svg::Path, cinder::svg::Ellipse, and cinder::svg::Circle.

void cinder::svg::Node::render ( Renderer renderer) const
inherited

Renders the node and its descendants.

const Node * cinder::svg::Node::findInAncestors ( const std::string &  elementId) const
virtualinherited

Finds the node with ID elementId amongst this Node's ancestors. Returns NULL on failure.

Reimplemented in cinder::svg::Group.

Paint cinder::svg::Node::findPaintInAncestors ( const std::string &  paintName) const
inherited

Finds the svg::Paint node with ID elementId amongst this Node's ancestors. Returns a default svg::Paint instance on failure.

bool cinder::svg::Node::specifiesTransform ( ) const
inherited

Returns whether this Node specifies a transformation.

mat3 cinder::svg::Node::getTransform ( ) const
inherited

Returns the local transformation of this node. Returns identity if the Node's transform isn't specified.

void cinder::svg::Node::setTransform ( const mat3 &  transform)
inherited

Sets the local transformation of this node.

void cinder::svg::Node::unspecifyTransform ( )
inherited

Removes the local transformation of this node, effectively making it the identity matrix.

mat3 cinder::svg::Node::getTransformInverse ( ) const
inherited

Returns the inverse of the local transformation of this node. Returns identity if the Node's transform isn't specified.

mat3 cinder::svg::Node::getTransformAbsolute ( ) const
inherited

Returns the absolute transformation of this node, which includes inherited transformations.

mat3 cinder::svg::Node::getTransformAbsoluteInverse ( ) const
inherited

Returns the inverse of the absolute transformation of this node, which includes inherited transformations.

Rectf cinder::svg::Node::getBoundingBox ( ) const
inherited

Returns the local bounding box of the Node. Calculated and cached the first time it is requested.

Rectf cinder::svg::Node::getBoundingBoxAbsolute ( ) const
inherited

Returns the absolute bounding box of the Node. Calculated and cached the first time it is requested.

virtual Shape2d cinder::svg::Node::getShape ( ) const
virtualinherited
Shape2d cinder::svg::Node::getShapeAbsolute ( ) const
inherited

Returns a Shape2d representing the node in absolute coordinates. Not supported for Text.

const Paint & cinder::svg::Node::getFill ( ) const
inherited

Returns node's fill, or the first among its ancestors when it has none.

const Paint & cinder::svg::Node::getStroke ( ) const
inherited

Returns node's stroke, or the first among its ancestors when it has none.

float cinder::svg::Node::getOpacity ( ) const
inherited

Returns node's opacity, or the first among its ancestors when it has none.

float cinder::svg::Node::getFillOpacity ( ) const
inherited

Returns node's fill opacity, or the first among its ancestors when it has none.

float cinder::svg::Node::getStrokeOpacity ( ) const
inherited

Returns node's stroke opacity, or the first among its ancestors when it has none.

FillRule cinder::svg::Node::getFillRule ( ) const
inherited

Returns node's fill rule, or the first among its ancestors when it has none.

LineCap cinder::svg::Node::getLineCap ( ) const
inherited

Returns node's line cap, or the first among its ancestors when it has none.

LineJoin cinder::svg::Node::getLineJoin ( ) const
inherited

Returns node's line join, or the first among its ancestors when it has none.

float cinder::svg::Node::getStrokeWidth ( ) const
inherited

Returns node's stroke width, or the first among its ancestors when it has none.

const vector< string > & cinder::svg::Node::getFontFamilies ( ) const
inherited

Returns node's font families, or the first among its ancestors when it has none.

Value cinder::svg::Node::getFontSize ( ) const
inherited

Returns node's font size, or the first among its ancestors when it has none.

bool cinder::svg::Node::isVisible ( ) const
inherited

Returns whether this Node is visible, or the first among its ancestors when unspecified.

bool cinder::svg::Node::isDisplayNone ( ) const
inherited

Returns whether the Display property of this Node is set to 'None', preventing rendering of the node and its children.

virtual bool cinder::svg::Node::isDrawable ( ) const
protectedvirtualinherited
void cinder::svg::Node::startRender ( Renderer renderer,
const Style style 
) const
protectedinherited
void cinder::svg::Node::finishRender ( Renderer renderer,
const Style style 
) const
protectedinherited
virtual Rectf cinder::svg::Node::calcBoundingBox ( ) const
protectedvirtualinherited
Paint cinder::svg::Node::parsePaint ( const char *  value,
bool *  specified,
const Node parentNode 
)
staticprotectedinherited
mat3 cinder::svg::Node::parseTransform ( const std::string &  value)
staticprotectedinherited
bool cinder::svg::Node::parseTransformComponent ( const char **  c,
mat3 *  result 
)
staticprotectedinherited
std::string cinder::svg::Node::findStyleValue ( const std::string &  styleString,
const std::string &  key 
)
staticprotectedinherited
void cinder::svg::Node::parseStyle ( const std::string &  value)
protectedinherited

Friends And Related Function Documentation

friend class Text
friend

Member Data Documentation

bool cinder::svg::TextSpan::mIgnoreAttributes
protected
Attributes cinder::svg::TextSpan::mAttributes
protected
std::string cinder::svg::TextSpan::mString
protected
std::shared_ptr<Font> cinder::svg::TextSpan::mFont
mutableprotected
std::shared_ptr<std::vector<std::pair<uint16_t,vec2> > > cinder::svg::TextSpan::mGlyphMeasures
mutableprotected
std::shared_ptr<Shape2d> cinder::svg::TextSpan::mShape
mutableprotected
std::vector<TextSpanRef> cinder::svg::TextSpan::mSpans
protected
const Node* cinder::svg::Node::mParent
protectedinherited
std::string cinder::svg::Node::mId
protectedinherited
Style cinder::svg::Node::mStyle
protectedinherited
bool cinder::svg::Node::mSpecifiesTransform
protectedinherited
mat3 cinder::svg::Node::mTransform
protectedinherited
bool cinder::svg::Node::mBoundingBoxCached
mutableprotectedinherited
Rectf cinder::svg::Node::mBoundingBox
mutableprotectedinherited

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