]> git.sesse.net Git - casparcg/blob - core/producer/text/utils/texture_font.h
* Merged MIXER CROP, MIXER ANCHOR, MIXER ROTATION and MIXER PERSPECTIVE from 2.0
[casparcg] / core / producer / text / utils / texture_font.h
1 #pragma once
2
3 #include <string>
4 #include <vector>
5 #include <common/memory.h>
6
7 #include "string_metrics.h"
8 #include "text_info.h"
9 #include "../../../frame/geometry.h"
10
11 namespace caspar { namespace core { namespace text {
12
13 class texture_atlas;
14 enum class unicode_block;
15
16 class texture_font
17 {
18         texture_font();
19         texture_font(const texture_font&);
20         const texture_font& operator=(const texture_font&);
21
22 public:
23         texture_font(texture_atlas&, const text_info&, bool normalize_coordinates);
24         void load_glyphs(unicode_block block, const color<double>& col);
25         void set_tracking(int tracking);
26         std::vector<frame_geometry::coord> create_vertex_stream(const std::wstring& str, int x, int y, int parent_width, int parent_height, string_metrics* metrics);
27         string_metrics measure_string(const std::wstring& str);
28
29 private:
30         struct impl;
31         spl::shared_ptr<impl> impl_;
32 };
33
34 enum class unicode_block
35 {
36         Basic_Latin,
37         Latin_1_Supplement,
38         Latin_Extended_A,
39         Latin_Extended_B,
40         IPA_Extensions,
41         Spacing_Modifier_Letters,
42         Combining_Diacritical_Marks,
43         Greek_and_Coptic,
44         Cyrillic,
45         Cyrillic_Supplement,
46         Armenian,
47         Hebrew,
48         Arabic,
49         Syriac,
50         Arabic_Supplement,
51         Thaana,
52         NKo,
53         Samaritan,
54         Mandaic,
55         Arabic_Extended_A,
56         Devanagari,
57         Bengali,
58         Gurmukhi,
59         Gujarati,
60         Oriya,
61         Tamil,
62         Telugu,
63         Kannada,
64         Malayalam,
65         Sinhala,
66         Thai,
67         Lao,
68         Tibetan,
69         Myanmar,
70         Georgian,
71         Hangul_Jamo,
72         Ethiopic,
73         Ethiopic_Supplement,
74         Cherokee,
75         Unified_Canadian_Aboriginal_Syllabics,
76         Ogham,
77         Runic,
78         Tagalog,
79         Hanunoo,
80         Buhid,
81         Tagbanwa,
82         Khmer,
83         Mongolian,
84         Unified_Canadian_Aboriginal_Syllabics_Extended,
85         Limbu,
86         Tai_Le,
87         New_Tai_Lue,
88         Khmer_Symbols,
89         Buginese,
90         Tai_Tham,
91         Balinese,
92         Sundanese,
93         Batak,
94         Lepcha,
95         Ol_Chiki,
96         Sundanese_Supplement,
97         Vedic_Extensions,
98         Phonetic_Extensions,
99         Phonetic_Extensions_Supplement,
100         Combining_Diacritical_Marks_Supplement,
101         Latin_Extended_Additional,
102         Greek_Extended,
103         General_Punctuation,
104         Superscripts_and_Subscripts,
105         Currency_Symbols,
106         Combining_Diacritical_Marks_for_Symbols,
107         Letterlike_Symbols,
108         Number_Forms,
109         Arrows,
110         Mathematical_Operators,
111         Miscellaneous_Technical,
112         Control_Pictures,
113         Optical_Character_Recognition,
114         Enclosed_Alphanumerics,
115         Box_Drawing,
116         Block_Elements,
117         Geometric_Shapes,
118         Miscellaneous_Symbols,
119         Dingbats,
120         Miscellaneous_Mathematical_Symbols_A,
121         Supplemental_Arrows_A,
122         Braille_Patterns,
123         Supplemental_Arrows_B,
124         Miscellaneous_Mathematical_Symbols_B,
125         Supplemental_Mathematical_Operators,
126         Miscellaneous_Symbols_and_Arrows,
127         Glagolitic,
128         Latin_Extended_C,
129         Coptic,
130         Georgian_Supplement,
131         Tifinagh,
132         Ethiopic_Extended,
133         Cyrillic_Extended_A,
134         Supplemental_Punctuation,
135         CJK_Radicals_Supplement,
136         Kangxi_Radicals,
137         Ideographic_Description_Characters,
138         CJK_Symbols_and_Punctuation,
139         Hiragana,
140         Katakana,
141         Bopomofo,
142         Hangul_Compatibility_Jamo,
143         Kanbun,
144         Bopomofo_Extended,
145         CJK_Strokes,
146         Katakana_Phonetic_Extensions,
147         Enclosed_CJK_Letters_and_Months,
148         CJK_Compatibility,
149         CJK_Unified_Ideographs_Extension_A,
150         Yijing_Hexagram_Symbols,
151         CJK_Unified_Ideographs,
152         Yi_Syllables,
153         Yi_Radicals,
154         Lisu,
155         Vai,
156         Cyrillic_Extended_B,
157         Bamum,
158         Modifier_Tone_Letters,
159         Latin_Extended_D,
160         Syloti_Nagri,
161         Common_Indic_Number_Forms,
162         Phags_pa,
163         Saurashtra,
164         Devanagari_Extended,
165         Kayah_Li,
166         Rejang,
167         Hangul_Jamo_Extended_A,
168         Javanese,
169         Cham,
170         Myanmar_Extended_A,
171         Tai_Viet,
172         Meetei_Mayek_Extensions,
173         Ethiopic_Extended_A,
174         Meetei_Mayek,
175         Hangul_Syllables,
176         Hangul_Jamo_Extended_B,
177         High_Surrogates,
178         High_Private_Use_Surrogates,
179         Low_Surrogates,
180         Private_Use_Area,
181         CJK_Compatibility_Ideographs,
182         Alphabetic_Presentation_Forms,
183         Arabic_Presentation_Forms_A,
184         Variation_Selectors,
185         Vertical_Forms,
186         Combining_Half_Marks,
187         CJK_Compatibility_Forms,
188         Small_Form_Variants,
189         Arabic_Presentation_Forms_B,
190         Halfwidth_and_Fullwidth_Forms,
191         Specials,
192         Linear_B_Syllabary,
193         Linear_B_Ideograms,
194         Aegean_Numbers,
195         Ancient_Greek_Numbers,
196         Ancient_Symbols,
197         Phaistos_Disc,
198         Lycian,
199         Carian,
200         Old_Italic,
201         Gothic,
202         Ugaritic,
203         Old_Persian,
204         Deseret,
205         Shavian,
206         Osmanya,
207         Cypriot_Syllabary,
208         Imperial_Aramaic,
209         Phoenician,
210         Lydian,
211         Meroitic_Hieroglyphs,
212         Meroitic_Cursive,
213         Kharoshthi,
214         Old_South_Arabian,
215         Avestan,
216         Inscriptional_Parthian,
217         Inscriptional_Pahlavi,
218         Old_Turkic,
219         Rumi_Numeral_Symbols,
220         Brahmi,
221         Kaithi,
222         Sora_Sompeng,
223         Chakma,
224         Sharada,
225         Takri,
226         Cuneiform,
227         Cuneiform_Numbers_and_Punctuation,
228         Egyptian_Hieroglyphs,
229         Bamum_Supplement,
230         Miao,
231         Kana_Supplement,
232         Byzantine_Musical_Symbols,
233         Musical_Symbols,
234         Ancient_Greek_Musical_Notation,
235         Tai_Xuan_Jing_Symbols,
236         Counting_Rod_Numerals,
237         Mathematical_Alphanumeric_Symbols,
238         Arabic_Mathematical_Alphabetic_Symbols,
239         Mahjong_Tiles,
240         Domino_Tiles,
241         Playing_Cards,
242         Enclosed_Alphanumeric_Supplement,
243         Enclosed_Ideographic_Supplement,
244         Miscellaneous_Symbols_And_Pictographs,
245         Emoticons,
246         Transport_And_Map_Symbols,
247         Alchemical_Symbols,
248         CJK_Unified_Ideographs_Extension_B,
249         CJK_Unified_Ideographs_Extension_C,
250         CJK_Unified_Ideographs_Extension_D,
251         CJK_Compatibility_Ideographs_Supplement,
252         Tags,
253         Variation_Selectors_Supplement,
254         Supplementary_Private_Use_Area_A,
255         Supplementary_Private_Use_Area_B
256 };
257
258 }}}