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