#include <cstdlib>
{
const double TEXT_SIZE = 4.0;
Style::setDefaultLineWidth(0.8);
const double TEXT_LINEWIDTH = 0.33 * Style::defaultLineWidth();
g <<
Line(0, 0, 150, 0, Color::Black);
g <<
Line(0, 0, 0, 100, Color::Black);
g <<
Line(103, 80, 142, 5,
Color(
"#1f77b4"));
board << framed(makeRough(g), 10, Color::Black, Color::Null, 0.5);
pointText << boardFontText(
Point(),
"THE DAY I REALIZED", TEXT_SIZE, Color::Black, TEXT_LINEWIDTH);
pointText.
append(boardFontText(
Point(),
"I COULD COOK BACON", TEXT_SIZE, Color::Black, TEXT_LINEWIDTH), Direction::Bottom, Alignment::Left, 2.0);
pointText.
append(boardFontText(
Point(),
"WHENEVER I WANTED", TEXT_SIZE, Color::Black, TEXT_LINEWIDTH), Direction::Bottom, Alignment::Left, 2.0);
board << pointText;
board << makeRough(
Arrow(pointText.
boundingBox(UseLineWidth).
topRight(),
Point(101, 77), Arrow::ExtremityType::Stick, Color::Black, Color::Null, 0.5 * Style::defaultLineWidth()));
Group time = boardFontText(
Point(),
"TIME", TEXT_SIZE, Color::Black, TEXT_LINEWIDTH);
board << time;
Group health = boardFontText(
Point(),
"MY OVERALL HEALTH", TEXT_SIZE, Color::Black, TEXT_LINEWIDTH);
board << health;
Group title = boardFontText(
Point(),
"\"STOVE OWNERSHIP\" FROM XKCD BY RUNDALL MUNROE", TEXT_SIZE, Color::Black, TEXT_LINEWIDTH);
board.
append(title, Direction::Bottom, Alignment::Center, 5.0);
}
Declaration of the Board class.
int main(int argc, char *argv[])
Definition arithmetic.cpp:16
Structure representing an RGB triple.
Definition Color.h:43
A line between two points with an arrow at one extremity.
Definition Arrow.h:38
Class for EPS, FIG or SVG drawings.
Definition Board.h:61
void saveSVG(const char *filename, PageSize size=PageSize::BoundingBox, double margin=0.0, Unit unit=Unit::Millimeter) const
Definition Board.cpp:765
A group of shapes. A group is basically a ShapeList except that when rendered in either an SVG of a F...
Definition Group.h:40
Rect boundingBox(LineWidthFlag) const override
Definition Group.cpp:212
Group & translate(double dx, double dy) override
Definition Group.cpp:70
A line between two points.
Definition Line.h:38
Struct representing a 2D point.
Definition Point.h:42
double y
Definition Point.h:44
double x
Definition Point.h:43
Point topRight() const
topRight Top-right point of the rectangle
Definition Rect.h:83
ShapeList & append(const Shape &shape, Direction direction=Direction::Right, Alignment alignment=Alignment::Center, double margin=0.0, LineWidthFlag lineWidthFlag=UseLineWidth)
Definition ShapeList.cpp:232
Shape & moveCenter(double x, double y, LineWidthFlag lineWidthFlag=IgnoreLineWidth)
Definition Shape.cpp:64
Shape & rotateDeg(double angle, const Point ¢er)
Definition Shape.h:337