|
|
@@ -93,6 +93,7 @@ public:
|
|
|
ImageWriter& SetBgColor(long);
|
|
|
ImageWriter& SetFgColor(long);
|
|
|
ImageWriter& SetFontSize(char);
|
|
|
+ ImageWriter& SetOffsetTop(long);
|
|
|
ImageWriter& SetFontPath(const Anope::string &);
|
|
|
|
|
|
bool Build(User* u);
|
|
|
@@ -103,6 +104,7 @@ protected:
|
|
|
Anope::string outputName;
|
|
|
ARGB bgColor;
|
|
|
RGB fgColor;
|
|
|
+ long offsetTop;
|
|
|
size_t top;
|
|
|
size_t left;
|
|
|
size_t bottom;
|
|
|
@@ -163,6 +165,14 @@ ImageWriter& ImageWriter::SetFgColor(long value)
|
|
|
return *this;
|
|
|
}
|
|
|
|
|
|
+ImageWriter& ImageWriter::SetOffsetTop(long value)
|
|
|
+{
|
|
|
+ Log(LOG_DEBUG) << "Offset Top: " << value;
|
|
|
+ offsetTop = value;
|
|
|
+ return *this;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
ImageWriter& ImageWriter::SetQuotePosition(size_t top, size_t left, size_t right, size_t bottom)
|
|
|
{
|
|
|
Log(LOG_DEBUG) << "Position: " << top << ',' << left << ',' << right << ',' << bottom;
|
|
|
@@ -226,7 +236,7 @@ bool ImageWriter::Build(User *u)
|
|
|
TextLines lines(fontSize * 0.55);
|
|
|
for (const Anope::string& str: text)
|
|
|
WriteDryRun(writer, font, fontSize, str, lines, fgColor);
|
|
|
- int offsetY = -((top -bottom -lines.getHeight() -lines.getLineSpacing()) /2);
|
|
|
+ int offsetY = -((top +offsetTop -bottom -lines.getHeight() -lines.getLineSpacing()) /2);
|
|
|
if (offsetY > 0)
|
|
|
offsetY = 0;
|
|
|
for (const TextItem& line: lines.lines)
|
|
|
@@ -374,6 +384,7 @@ void InstaMessageBufferImpl::OnEndBuffer()
|
|
|
builder.SetBackground(config->Get<Anope::string>("background", ""))
|
|
|
.SetText(lines)
|
|
|
.SetOutputPath(path)
|
|
|
+ .SetOffsetTop(config->Get<long>("offsetTop", "0"))
|
|
|
.SetQuotePosition(
|
|
|
config->Get<unsigned>("quoteTop", "0"),
|
|
|
config->Get<unsigned>("quoteLeft", "0"),
|