stuff-from-scratch/test/publishing/TestLatexConverter.cpp
2023-01-12 10:58:43 +00:00

29 lines
No EOL
721 B
C++

#include "TestFramework.h"
#include "TestUtils.h"
#include "TestRenderUtils.h"
#include "StringUtils.h"
#include "FontItem.h"
#include "TextNode.h"
#include "LatexSymbols.h"
TEST_CASE(TestLatexConverter, "publishing")
{
FontItem font("Cambria Math", 14);
auto psi = LatexSymbolLookup::getSymbolUtf8("psi");
auto alpha = LatexSymbolLookup::getSymbolUtf8("alpha");
auto beta = LatexSymbolLookup::getSymbolUtf8("beta");
auto content = *psi + " " + *alpha + " " + *beta + " ";
TestRenderer renderer(800, 800);
auto text = std::make_unique<TextNode>(content, Point(10, 10));
text->setFont(font);
renderer.getScene()->addNode(text.get());
renderer.write(TestUtils::getTestOutputDir(__FILE__) / "out.png");
};