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