Add initial font metrics and equation rendering.
This commit is contained in:
parent
c2027801be
commit
5ddd54dd6d
24 changed files with 868 additions and 63 deletions
|
@ -23,6 +23,7 @@ endif()
|
|||
|
||||
set(UNIT_TEST_FILES
|
||||
TestRasterizer.cpp
|
||||
TestTextRendering.cpp
|
||||
${PLATFORM_UNIT_TEST_FILES}
|
||||
)
|
||||
|
||||
|
|
22
test/graphics/TestTextRendering.cpp
Normal file
22
test/graphics/TestTextRendering.cpp
Normal 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");
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue