62 lines
1.2 KiB
C++
62 lines
1.2 KiB
C++
#include "TextElement.h"
|
|
|
|
#include "Color.h"
|
|
|
|
TextElement::TextElement(const std::string& content, const DiscretePoint& loc)
|
|
: mContent(content),
|
|
mLocation(loc),
|
|
mFontLabel("fixed"),
|
|
mFillColor(Color::Create(255, 255, 255)),
|
|
mStrokeColor(Color::Create(0, 0, 0))
|
|
{
|
|
// https://en.wikipedia.org/wiki/Fixed_(typeface)#:~:text=misc%2Dfixed%20is%20a%20collection,to%20a%20single%20font%20family.
|
|
}
|
|
|
|
TextElement::~TextElement()
|
|
{
|
|
|
|
}
|
|
|
|
std::unique_ptr<TextElement> TextElement::Create(const std::string& content, const DiscretePoint& loc)
|
|
{
|
|
return std::make_unique<TextElement>(content, loc);
|
|
}
|
|
|
|
Color* TextElement::GetFillColor() const
|
|
{
|
|
return mFillColor.get();
|
|
}
|
|
Color* TextElement::GetStrokeColor() const
|
|
{
|
|
return mStrokeColor.get();
|
|
}
|
|
|
|
DiscretePoint TextElement::GetLocation() const
|
|
{
|
|
return mLocation;
|
|
}
|
|
|
|
std::string TextElement::GetFontLabel() const
|
|
{
|
|
return mFontLabel;
|
|
}
|
|
|
|
std::string TextElement::GetContent() const
|
|
{
|
|
return mContent;
|
|
}
|
|
|
|
void TextElement::SetContent(const std::string& content)
|
|
{
|
|
mContent = content;
|
|
}
|
|
|
|
void TextElement::SetFillColor(ColorUPtr color)
|
|
{
|
|
mFillColor = std::move(color);
|
|
}
|
|
|
|
void TextElement::SetStrokeColor(ColorUPtr color)
|
|
{
|
|
mStrokeColor = std::move(color);
|
|
}
|