Makes FontData importable resource.
Adds multi-channel SDF font texture generation and rendering support. Adds per-font oversampling support. Adds FontData import plugins (for dynamic fonts, BMFonts and monospaced image fonts), font texture cache pre-generation and loading. Adds BMFont binary format and outline support.
This commit is contained in:
parent
00268e37a0
commit
4c3f7d1290
130 changed files with 17847 additions and 6893 deletions
|
|
@ -55,7 +55,8 @@ TEST_SUITE("[[TextServer]") {
|
|||
for (int i = 0; i < TextServerManager::get_interface_count(); i++) {
|
||||
TextServer *ts = TextServerManager::initialize(i, err);
|
||||
|
||||
RID font = ts->create_font_memory(_font_NotoSans_Regular, _font_NotoSans_Regular_size, "ttf");
|
||||
RID font = ts->create_font();
|
||||
ts->font_set_data_ptr(font, _font_NotoSans_Regular, _font_NotoSans_Regular_size);
|
||||
TEST_FAIL_COND(font == RID(), "Loading font failed.");
|
||||
ts->free(font);
|
||||
}
|
||||
|
|
@ -65,9 +66,14 @@ TEST_SUITE("[[TextServer]") {
|
|||
for (int i = 0; i < TextServerManager::get_interface_count(); i++) {
|
||||
TextServer *ts = TextServerManager::initialize(i, err);
|
||||
|
||||
RID font1 = ts->create_font();
|
||||
ts->font_set_data_ptr(font1, _font_NotoSans_Regular, _font_NotoSans_Regular_size);
|
||||
RID font2 = ts->create_font();
|
||||
ts->font_set_data_ptr(font2, _font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size);
|
||||
|
||||
Vector<RID> font;
|
||||
font.push_back(ts->create_font_memory(_font_NotoSans_Regular, _font_NotoSans_Regular_size, "ttf"));
|
||||
font.push_back(ts->create_font_memory(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size, "ttf"));
|
||||
font.push_back(font1);
|
||||
font.push_back(font2);
|
||||
|
||||
String test = U"คนอ้วน khon uan ראה";
|
||||
// 6^ 17^
|
||||
|
|
@ -111,9 +117,14 @@ TEST_SUITE("[[TextServer]") {
|
|||
continue;
|
||||
}
|
||||
|
||||
RID font1 = ts->create_font();
|
||||
ts->font_set_data_ptr(font1, _font_NotoSans_Regular, _font_NotoSans_Regular_size);
|
||||
RID font2 = ts->create_font();
|
||||
ts->font_set_data_ptr(font2, _font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size);
|
||||
|
||||
Vector<RID> font;
|
||||
font.push_back(ts->create_font_memory(_font_NotoSans_Regular, _font_NotoSans_Regular_size, "ttf"));
|
||||
font.push_back(ts->create_font_memory(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size, "ttf"));
|
||||
font.push_back(font1);
|
||||
font.push_back(font2);
|
||||
|
||||
String test = U"Arabic (اَلْعَرَبِيَّةُ, al-ʿarabiyyah)";
|
||||
// 7^ 26^
|
||||
|
|
@ -155,9 +166,14 @@ TEST_SUITE("[[TextServer]") {
|
|||
String test_1 = U"test test test";
|
||||
// 5^ 10^
|
||||
|
||||
RID font1 = ts->create_font();
|
||||
ts->font_set_data_ptr(font1, _font_NotoSans_Regular, _font_NotoSans_Regular_size);
|
||||
RID font2 = ts->create_font();
|
||||
ts->font_set_data_ptr(font2, _font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size);
|
||||
|
||||
Vector<RID> font;
|
||||
font.push_back(ts->create_font_memory(_font_NotoSans_Regular, _font_NotoSans_Regular_size, "ttf"));
|
||||
font.push_back(ts->create_font_memory(_font_NotoSansThaiUI_Regular, _font_NotoSansThaiUI_Regular_size, "ttf"));
|
||||
font.push_back(font1);
|
||||
font.push_back(font2);
|
||||
|
||||
RID ctx = ts->create_shaped_text();
|
||||
TEST_FAIL_COND(ctx == RID(), "Creating text buffer failed.");
|
||||
|
|
@ -185,9 +201,14 @@ TEST_SUITE("[[TextServer]") {
|
|||
for (int i = 0; i < TextServerManager::get_interface_count(); i++) {
|
||||
TextServer *ts = TextServerManager::initialize(i, err);
|
||||
|
||||
RID font1 = ts->create_font();
|
||||
ts->font_set_data_ptr(font1, _font_NotoSans_Regular, _font_NotoSans_Regular_size);
|
||||
RID font2 = ts->create_font();
|
||||
ts->font_set_data_ptr(font2, _font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size);
|
||||
|
||||
Vector<RID> font;
|
||||
font.push_back(ts->create_font_memory(_font_NotoSans_Regular, _font_NotoSans_Regular_size, "ttf"));
|
||||
font.push_back(ts->create_font_memory(_font_NotoNaskhArabicUI_Regular, _font_NotoNaskhArabicUI_Regular_size, "ttf"));
|
||||
font.push_back(font1);
|
||||
font.push_back(font2);
|
||||
|
||||
String test_1 = U"الحمد";
|
||||
String test_2 = U"الحمد test";
|
||||
|
|
@ -242,7 +263,6 @@ TEST_SUITE("[[TextServer]") {
|
|||
font.clear();
|
||||
}
|
||||
}
|
||||
|
||||
memdelete(tsman);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue