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

@ -23,6 +23,7 @@ endif()
set(UNIT_TEST_FILES
TestRasterizer.cpp
TestTextRendering.cpp
${PLATFORM_UNIT_TEST_FILES}
)

View file

@ -0,0 +1,22 @@
#include "TestFramework.h"
#include "TestUtils.h"
#include "TestRenderUtils.h"
#include "TextNode.h"
TEST_CASE(TestTextRendeing_WithBoundingBoxes, "graphics")
{
TestRenderer renderer(800, 800);
auto loc = Point(10, 10);
TextNode text_node("abcdefgh", Transform(loc));
text_node.setRenderNodeBounds(true);
text_node.setRenderTextBounds(true);
auto scene = renderer.getScene();
scene->addNode(&text_node);
renderer.writeSvg(TestUtils::getTestOutputDir(__FILE__) / "text_with_bounding_box.svg");
renderer.write(TestUtils::getTestOutputDir(__FILE__) / "text_with_bounding_box.png");
};