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