Cumulia Illustrator Rendering Engine v1.0.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
textengine.h
1//##################################################################################################
2//
3// Copyright (c) 2024 Beijing Qiongqi Tech Co.,Ltd. All rights reserved.
4
5// This source code is confidential and proprietary to Beijing Qiongqi Tech Co.,Ltd(The Holder).
6// Any unauthorized use, copying, modification, or distribution of the code is strictly prohibited.
7// Any user shall obtain authorizaition from the Holder before modifying the source code. And the user shall not
8// sublicense, sell, distribute, or transfer the source code, whether in original or modified form, to any third party
9// without the prior written consent of the Holder.
10
11// This copyright notice and permission grant shall be included in all copies or substantial portions of the source code.
12
13// Author Cumulia Illustrator
14// Date 2024-05-01
15// Version V1.0.0
16//##################################################################################################
17
18#pragma once
19
20#include <cilcore.h>
21
22#include <memory>
23#include <vector>
24#include <string>
25
26namespace cil
27{
28 class Glyph;
29 class Font;
30
32 {
33 private:
34 static TextEngine* s_instance;
35 std::vector<std::shared_ptr<Font>> m_fonts;
36 std::shared_ptr<Font> m_current;
37
38 public:
40 void set(const int fontSize, const std::shared_ptr<Color3f>& fontColor, const std::string& fontFile);
41 std::shared_ptr<Glyph> getGlyph(wchar_t character);
43 std::shared_ptr<Vector2i> textExtent(const std::wstring& text);
44
45 private:
46 TextEngine();
48
49 std::shared_ptr<Font> getFont(const int fontSize, const std::shared_ptr<Color3f>& fontColor, const std::string& fontFile);
50 };
51}
Definition textengine.h:32
std::shared_ptr< Vector2i > textExtent(const std::wstring &text)
std::shared_ptr< Glyph > getGlyph(wchar_t character)
static TextEngine * getInstance()
void set(const int fontSize, const std::shared_ptr< Color3f > &fontColor, const std::string &fontFile)
Definition decal.h:23