3#include "gtest/gtest.h"
5#include "../RenderingLibrary/Include/image_data.hpp"
6#include "../RenderingLibrary/Include/text_renderer.hpp"
8using ::testing::EmptyTestEventListener;
9using ::testing::InitGoogleTest;
11using ::testing::TestEventListeners;
12using ::testing::TestInfo;
13using ::testing::TestPartResult;
14using ::testing::TestSuite;
15using ::testing::UnitTest;
19TEST(ImageDataTest, CreateGlyphBitmapStatic)
21 std::string
const pathToFont{
"../Content/Fonts/Exo/Exo-Medium.otf" };
23 auto imageData = std::make_shared<ImageData>(TextRenderer::CreateGlyphBitmap(pathToFont,
'7' ));
24 imageData->WritePngFile(
"testGlyphStatic.png");
26 EXPECT_NE( imageData,
nullptr );
29TEST(ImageDataTest, CreateGlyphBitmap)
31 std::string
const pathToFont{
"../Content/Fonts/Exo/Exo-Medium.otf" };
35 auto imageData = std::make_shared<ImageData>( textRenderer.CreateGlyphBitmap(
'4') );
36 imageData->WritePngFile(
"testGlyphBitmap.png");
38 EXPECT_NE(imageData,
nullptr);
41TEST(ImageDataTest, CreateTextBitmap1)
43 std::string
const pathToFont{
"../Content/Fonts/Pirulen/pirulen_rg.otf" };
47 std::string testText{
"This is Pirulen font test text 123 string"};
48 auto imageData = std::make_shared<ImageData>( textRenderer.CreateStringBitmap(testText) );
49 imageData->WritePngFile(
"testPirulenFontTextString.png");
51 EXPECT_NE(imageData,
nullptr);
54TEST(ImageDataTest, CreateTextBitmap2)
56 std::string
const pathToFont{
"../Content/Fonts/DigitalDream/DIGITALDREAM.ttf" };
60 std::string testText{
"This_is_DIGITAL-DREAM_font_test_text_123_string" };
61 auto imageData = std::make_shared<ImageData>( textRenderer.CreateStringBitmap(testText) );
62 imageData->WritePngFile(
"testDigitalDreamFontTextString.png");
64 EXPECT_NE(imageData,
nullptr);
Central text system manager and font resource registry.
TEST(ImageDataTest, CreateGlyphBitmapStatic)