|
Board
0.9.5
|
A piece of text. More...
#include <Text.h>
Public Member Functions | |
| Text (double x, double y, const std::string &text, const Fonts::Font font, double size, Color color=Color::Black) | |
| Text (Point p, const std::string &text, const Fonts::Font font, double size, Color color=Color::Black) | |
| Text (double x, double y, const std::string &text, const Fonts::Font font, const std::string &svgFont, double size, Color color=Color::Black) | |
| Text (Point p, const std::string &text, const Fonts::Font font, const std::string &svgFont, double size, Color color=Color::Black) | |
| const std::string & | name () const override |
| Point | center (LineWidthFlag lineWidthFlag=IgnoreLineWidth) const override |
| Text & | rotate (double angle, const Point ¢er) override |
| Text | rotated (double angle, const Point ¢er) const |
| Text & | rotate (double angle) override |
| Text | rotated (double angle) const |
| Text & | translate (double dx, double dy) override |
| Text | translated (double dx, double dy) const |
| Text & | scale (double sx, double sy) override |
| Text & | scale (double s) override |
| Text | scaled (double sx, double sy) const |
| Text | scaled (double s) const |
| void | scaleAll (double s) override |
| void | flushPostscript (std::ostream &stream, const TransformEPS &transform) const override |
| void | flushFIG (std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const override |
| void | flushSVG (std::ostream &stream, const TransformSVG &transform) const override |
| void | flushTikZ (std::ostream &stream, const TransformTikZ &transform) const override |
| virtual void | accept (ShapeVisitor &visitor) override |
| Accepts a visitor object. More... | |
| virtual void | accept (const ShapeVisitor &visitor) override |
| Accepts a visitor object. More... | |
| virtual void | accept (ConstShapeVisitor &visitor) const override |
| Accepts a const-shape visitor object. More... | |
| virtual void | accept (const ConstShapeVisitor &visitor) const override |
| Accepts a const-shape visitor object. More... | |
| virtual Shape * | accept (CompositeShapeTransform &transform) const override |
| Accept a composite shape transform. More... | |
| virtual Shape * | accept (const CompositeShapeTransform &transform) const override |
| Accept a constant composite shape transform. More... | |
| Rect | boundingBox (LineWidthFlag) const override |
| Text * | clone () const override |
| Text (const Text &)=default | |
| Text (Text &&)=default | |
| Text & | operator= (Text &&)=default |
| Text & | operator= (const Text &)=default |
Public Member Functions inherited from LibBoard::ShapeWithStyle | |
| ShapeWithStyle (Color penColor, Color fillColor, double lineWidth, LineStyle style, const LineCap cap, const LineJoin join) | |
| ShapeWithStyle (const Style &style) | |
| ShapeWithStyle (const ShapeWithStyle &other) | |
| ShapeWithStyle & | operator= (const ShapeWithStyle &other) |
| ~ShapeWithStyle () | |
| const Color & | penColor () const |
| ShapeWithStyle & | setPenColor (const Color &) |
| const Color & | fillColor () const |
| ShapeWithStyle & | setFillColor (const Color &) |
| double | lineWidth () const |
| ShapeWithStyle & | setLineWidth (double) |
| LineStyle | lineStyle () const |
| ShapeWithStyle & | setLineStyle (LineStyle) |
| LineCap | lineCap () const |
| ShapeWithStyle & | setLineCap (LineCap) |
| LineJoin | lineJoin () const |
| ShapeWithStyle & | setLineJoin (LineJoin) |
| Style | style () const |
| ShapeWithStyle & | setStyle (const Style &) |
| bool | filled () const |
Public Member Functions inherited from LibBoard::Shape | |
| Shape () | |
| virtual | ~Shape () |
| Shape & | rotateDeg (double angle, const Point ¢er) |
| Shape & | rotateDeg (double angle) |
| Shape & | moveCenter (double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
| Shape & | moveCenter (Point p, LineWidthFlag lineWidthFlag=IgnoreLineWidth) |
| Shape & | resize (double width, double height, LineWidthFlag lineWidthFlag) |
| Shape & | scaleToWidth (double w, LineWidthFlag lineWidthFlag) |
| Shape & | scaleToHeight (double h, LineWidthFlag lineWidthFlag) |
| Rect | bbox (LineWidthFlag) const |
| Shape (const Shape &other) | |
Protected Attributes | |
| std::string | _text |
| Fonts::Font | _font |
| std::string | _svgFont |
| double | _size |
| double | _xScale |
| double | _yScale |
| Path | _box |
Protected Attributes inherited from LibBoard::ShapeWithStyle | |
| Style | _style |
Additional Inherited Members | |
Static Public Member Functions inherited from LibBoard::ShapeWithStyle | |
| static void | setLineWidthScaling (bool) |
Protected Member Functions inherited from LibBoard::ShapeWithStyle | |
| void | updateLineWidth (double s) |
A piece of text.
The text structure.
| LibBoard::Text::Text | ( | double | x, |
| double | y, | ||
| const std::string & | text, | ||
| const Fonts::Font | font, | ||
| double | size, | ||
| Color | color = Color::Black |
||
| ) |
Create a Text sctucture.
| x | x-coordinate of the bottom-left corner. |
| y | y-coordinate of the bottom-left corner. |
| text | |
| font | |
| size | |
| color |
Referenced by clone(), scaled(), and translated().
| LibBoard::Text::Text | ( | Point | p, |
| const std::string & | text, | ||
| const Fonts::Font | font, | ||
| double | size, | ||
| Color | color = Color::Black |
||
| ) |
Create a Text sctucture.
| p | Position of the bottom-left corner. |
| text | |
| font | |
| size | |
| color |
| LibBoard::Text::Text | ( | double | x, |
| double | y, | ||
| const std::string & | text, | ||
| const Fonts::Font | font, | ||
| const std::string & | svgFont, | ||
| double | size, | ||
| Color | color = Color::Black |
||
| ) |
Create a Text sctucture.
| x | x-coordinate of the bottom-left corner. |
| y | y-coordinate of the bottom-left corner. |
| text | |
| font | |
| svgFont | The font family for an SVG file. (E.g. "Verdana, Arial" or "'Time New Roman', Serif" ) |
| size | |
| color |
| LibBoard::Text::Text | ( | Point | p, |
| const std::string & | text, | ||
| const Fonts::Font | font, | ||
| const std::string & | svgFont, | ||
| double | size, | ||
| Color | color = Color::Black |
||
| ) |
Create a Text sctucture.
| p | Position of the bottom-left corner. |
| text | |
| font | |
| svgFont | The font family for an SVG file. (E.g. "Verdana, Arial" or "'Time New Roman', Serif" ) |
| size | |
| color |
|
overridevirtual |
Accept a composite shape transform.
| transform | A composite shape transform object. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
Accept a constant composite shape transform.
| transform | A constant composite shape transform object.. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
Accepts a const-shape visitor object.
| visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
|
overridevirtual |
Accepts a const-shape visitor object.
| visitor | A const-shape visitor object. |
Reimplemented from LibBoard::Shape.
|
overridevirtual |
|
overridevirtual |
Compute the bounding box of the figure.
Implements LibBoard::Shape.
References LibBoard::Path::boundingBox().
|
overridevirtual |
Returns the center of the shape.
| lineWidthFlag | Should the line width be considered when computing bounding boxes. |
Reimplemented from LibBoard::Shape.
References LibBoard::Path::center().
Referenced by rotate().
|
overridevirtual |
Return a copy of the shape.
Implements LibBoard::ShapeWithStyle.
References Text().
|
overridevirtual |
Write the FIG code of the shape in a stream according to a transform.
| stream | The output stream. |
| transform | A 2D transform to be applied. |
| colormap |
Implements LibBoard::Shape.
|
overridevirtual |
Write the EPS code of the shape in a stream according to a transform.
| stream | The output stream. |
| transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
|
overridevirtual |
Write the SVG code of the shape in a stream according to a transform.
| stream | The output stream. |
| transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
|
overridevirtual |
Write the TikZ code of the shape in a stream according to a transform.
| stream | The output stream. |
| transform | A 2D transform to be applied. |
Implements LibBoard::Shape.
References LibBoard::Style::tikzProperties().
|
overridevirtual |
Returns the generic name of the shape (e.g., Circle, Rectangle, etc.)
Reimplemented from LibBoard::ShapeWithStyle.
|
overridevirtual |
Rotate the shape around its center.
| angle | The rotation angle in radian. |
Implements LibBoard::Shape.
References LibBoard::Path::rotate().
Rotate the shape around a given center of rotation.
| angle | The rotation angle in radian. |
| center | The center of rotation. |
Implements LibBoard::Shape.
References center(), and LibBoard::Path::rotate().
|
overridevirtual |
Scale the text, given a scaling factor.
| s | Scaling factor. |
Implements LibBoard::Shape.
References LibBoard::Path::scale().
|
overridevirtual |
Scale the text, given two scaling factors.
| sx | Scaling factor along the x axis. |
| sy | Scaling factor along the y axis. |
Implements LibBoard::Shape.
References LibBoard::Path::scale().
|
overridevirtual |
Scales all the values (positions, dimensions, etc.) associated with the shape.
| s | The scaling factor. |
Implements LibBoard::Shape.
References LibBoard::Path::scaleAll().
| Text LibBoard::Text::scaled | ( | double | s | ) | const |
Returns a scaled copy of the text.
| s | The scaling factor. |
References Text().
| Text LibBoard::Text::scaled | ( | double | sx, |
| double | sy | ||
| ) | const |
Returns a scaled copy of the text.
| sx | The scaling factor along the x axis. |
| sy | The scaling factor along the y axis. |
References Text().
|
overridevirtual |
Translate the text by a given offset.
| dx | The x offset. |
| dy | The y offset. |
Implements LibBoard::Shape.
References LibBoard::Path::translate().
| Text LibBoard::Text::translated | ( | double | dx, |
| double | dy | ||
| ) | const |
Returns a translated copy of the text.
| dx | Shift of the first coordinate. |
| dy | Shift of the second coordinate. |
References Text().
1.8.17