Go to the documentation of this file.
52 Text(
double x,
double y,
const std::string & text,
const Fonts::Font font,
double size,
Color color = Color::Black);
63 Text(
Point p,
const std::string & text,
const Fonts::Font font,
double size,
Color color = Color::Black);
76 Text(
double x,
double y,
const std::string & text,
const Fonts::Font font,
const std::string & svgFont,
double size,
Color color = Color::Black);
88 Text(
Point p,
const std::string & text,
const Fonts::Font font,
const std::string & svgFont,
double size,
Color color = Color::Black);
95 const std::string &
name()
const override;
97 Point center(LineWidthFlag lineWidthFlag = IgnoreLineWidth)
const override;
105 Text rotated(
double angle)
const;
135 Text &
scale(
double sx,
double sy)
override;
175 void flushFIG(std::ostream & stream,
const TransformFIG & transform, std::map<Color, int> & colormap)
const override;
228 Text & operator=(
Text &&) =
default;
229 Text & operator=(
const Text &) =
default;
230 ~
Text()
override =
default;
233 static const std::string _name;
235 double boxHeight(
const Transform &)
const;
236 double boxLength(
const Transform &)
const;
238 double angle()
const;
240 Point position()
const;
245 std::string _svgFont;
@copyright This source code is part of the Board project, a C++ library whose purpose is to allow sim...
virtual void accept(ShapeVisitor &visitor) override
Accepts a visitor object.
Definition: Text.cpp:325
Rect boundingBox(LineWidthFlag) const override
Definition: Text.cpp:355
Struct representing a rectangle on the plane.
Definition: Rect.h:39
Text & translate(double dx, double dy) override
Definition: Text.cpp:147
Text(double x, double y, const std::string &text, const Fonts::Font font, double size, Color color=Color::Black)
Definition: Text.cpp:52
void flushSVG(std::ostream &stream, const TransformSVG &transform) const override
Definition: Text.cpp:256
Text translated(double dx, double dy) const
Definition: Text.cpp:153
void flushFIG(std::ostream &stream, const TransformFIG &transform, std::map< Color, int > &colormap) const override
Definition: Text.cpp:237
void scaleAll(double s) override
Definition: Text.cpp:185
A piece of text.
Definition: Text.h:40
Struct representing a 2D point.
Definition: Point.h:42
Abstract structure for a 2D shape.
Definition: Shape.h:63
void flushTikZ(std::ostream &stream, const TransformTikZ &transform) const override
Definition: Text.cpp:275
A ConstShapeVisitor may visit const shapes of a composite shape tree in back-to-front order.
Definition: ShapeVisitor.h:78
A path, according to Postscript and SVG definition.
Definition: Path.h:45
Point center(LineWidthFlag lineWidthFlag=IgnoreLineWidth) const override
Definition: Text.cpp:105
Text & scale(double sx, double sy) override
Definition: Text.cpp:158
const std::string & name() const override
Definition: Text.cpp:100
void flushPostscript(std::ostream &stream, const TransformEPS &transform) const override
Definition: Text.cpp:224
Text * clone() const override
Definition: Text.cpp:190
A ShapeVisitor visits all shapes in a composite shape tree in back-to-front order.
Definition: ShapeVisitor.h:53
Text & rotate(double angle, const Point ¢er) override
Definition: Text.cpp:110
Text scaled(double sx, double sy) const
Definition: Text.cpp:175
Structure representing an RGB triple.
Definition: Color.h:43
Abstract structure for a 2D shape.
Definition: ShapeWithStyle.h:38