Cumulia Illustrator Rendering Engine v1.0.0
A Rendering engine for industrial CAD/CAE model and optimized for greatest performance
 
Loading...
Searching...
No Matches
font.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 <string>
24#include <map>
25
26class FT_LibraryRec_;
27class FT_FaceRec_;
28
29namespace cil
30{
31 class Glyph;
32
33 class Font
34 {
35 private:
36 FT_LibraryRec_* m_lib;
37 FT_FaceRec_* m_face;
38 int m_size;
39 std::shared_ptr<Color3f> m_color;
40 std::string m_file;
41 std::map<wchar_t, std::shared_ptr<Glyph>> m_map;
42
43 public:
44 Font(const int size, const std::shared_ptr<Color3f>& color, const std::string& file);
46
47 std::shared_ptr<Glyph> getGlyph(wchar_t character);
48 int size() const;
49 std::shared_ptr<Color3f> color() const;
50 std::string file() const;
52 std::shared_ptr<Vector2i> textExtent(const std::wstring& text);
53
54 private:
55 std::shared_ptr<Glyph> createGlyph(wchar_t character);
56 };
57}
Definition font.h:34
std::string file() const
std::shared_ptr< Color3f > color() const
int size() const
std::shared_ptr< Glyph > getGlyph(wchar_t character)
Font(const int size, const std::shared_ptr< Color3f > &color, const std::string &file)
std::shared_ptr< Vector2i > textExtent(const std::wstring &text)
int lineSpacing()
Definition decal.h:23