Tweak the default font's fake italic to better match Open Sans Italic

This commit is contained in:
Hugo Locurcio 2022-05-20 01:31:25 +02:00
parent 920ca62528
commit 383a27e930
No known key found for this signature in database
GPG key ID: 39E8F8BE30B0A49C

View file

@ -1069,6 +1069,7 @@ void make_default_theme(float p_scale, Ref<Font> p_font, TextServer::SubpixelPos
bold_font.instantiate();
for (int i = 0; i < default_font->get_data_count(); i++) {
Ref<FontData> data = default_font->get_data(i)->duplicate();
// Try to match OpenSans ExtraBold.
data->set_embolden(1.2);
bold_font->add_data(data);
}
@ -1076,15 +1077,17 @@ void make_default_theme(float p_scale, Ref<Font> p_font, TextServer::SubpixelPos
bold_italics_font.instantiate();
for (int i = 0; i < default_font->get_data_count(); i++) {
Ref<FontData> data = default_font->get_data(i)->duplicate();
// Try to match OpenSans ExtraBold Italic.
data->set_embolden(1.2);
data->set_transform(Transform2D(1.0, 0.4, 0.0, 1.0, 0.0, 0.0));
data->set_transform(Transform2D(1.0, 0.2, 0.0, 1.0, 0.0, 0.0));
bold_italics_font->add_data(data);
}
italics_font.instantiate();
for (int i = 0; i < default_font->get_data_count(); i++) {
Ref<FontData> data = default_font->get_data(i)->duplicate();
data->set_transform(Transform2D(1.0, 0.4, 0.0, 1.0, 0.0, 0.0));
// Try to match OpenSans Italic.
data->set_transform(Transform2D(1.0, 0.2, 0.0, 1.0, 0.0, 0.0));
italics_font->add_data(data);
}
}