Add initial font metrics and equation rendering.

This commit is contained in:
jmsgrogan 2023-01-25 16:51:36 +00:00
parent c2027801be
commit 5ddd54dd6d
24 changed files with 868 additions and 63 deletions

View file

@ -68,12 +68,23 @@ bool TestCaseRunner::run(const std::vector<std::string>& args)
sLastTestFailed = false;
std::cout << "TestFramework: Running Test - " << test_case->getName() << std::endl;
try{
try
{
test_case->run();
}
catch (const std::runtime_error& re)
{
std::cout << "Failed with runtime error: " << re.what() << std::endl;
mFailingTests.push_back(test_case->getName());
}
catch (const std::exception& e)
{
std::cout << "Failed with exception: " << e.what() << std::endl;
mFailingTests.push_back(test_case->getName());
}
catch(...)
{
std::cout << "Failed with exception" << std::endl;
std::cout << "Failed with unknown exception" << std::endl;
mFailingTests.push_back(test_case->getName());
};

View file

@ -12,6 +12,8 @@
#include "Image.h"
#include "PngWriter.h"
#include "FontsManager.h"
#include "File.h"
class TestRenderer
@ -19,10 +21,14 @@ class TestRenderer
public:
TestRenderer(unsigned width = 1000, unsigned height = 1000)
{
mFontsManager = std::make_unique<FontsManager>();
mSurface = std::make_unique<DrawingSurface>();
mSurface->setSize(width, height);
mDrawingContext = std::make_unique<DrawingContext>(mSurface.get());
getScene()->setFontsManager(mFontsManager.get());
}
Scene* getScene() const
@ -60,4 +66,6 @@ public:
private:
std::unique_ptr<DrawingSurface> mSurface;
std::unique_ptr<DrawingContext> mDrawingContext;
std::unique_ptr<FontsManager> mFontsManager;
};