Skip to content

Commit 09ea7bc

Browse files
committed
Merge pull request godotengine#105400 from bruvzg/ov_cleanup
Remove old oversampling property from font importers.
2 parents 03a44c4 + 92e7a6f commit 09ea7bc

4 files changed

+1
-16
lines changed

doc/classes/ResourceImporterDynamicFont.xml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,6 @@
6666
<member name="opentype_features" type="Dictionary" setter="" getter="" default="{}">
6767
The OpenType features to enable, disable or set a value for this font. This can be used to enable optional features provided by the font, such as ligatures or alternative glyphs. The list of supported OpenType features varies on a per-font basis.
6868
</member>
69-
<member name="oversampling" type="float" setter="" getter="" default="0.0">
70-
Deprecated. This property does nothing.
71-
</member>
7269
<member name="preload" type="Array" setter="" getter="" default="[]">
7370
The glyph ranges to prerender. This can avoid stuttering during gameplay when new characters need to be rendered, especially if [member subpixel_positioning] is enabled. The downside of using preloading is that initial project load times will increase, as well as memory usage.
7471
</member>

editor/import/dynamic_font_import_settings.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ bool DynamicFontImportSettingsData::_get(const StringName &p_name, Variant &r_re
6969
void DynamicFontImportSettingsData::_get_property_list(List<PropertyInfo> *p_list) const {
7070
for (const List<ResourceImporter::ImportOption>::Element *E = options.front(); E; E = E->next()) {
7171
if (owner && owner->import_settings_data.is_valid()) {
72-
if (owner->import_settings_data->get("multichannel_signed_distance_field") && (E->get().option.name == "size" || E->get().option.name == "outline_size" || E->get().option.name == "oversampling")) {
72+
if (owner->import_settings_data->get("multichannel_signed_distance_field") && (E->get().option.name == "size" || E->get().option.name == "outline_size")) {
7373
continue;
7474
}
7575
if (!owner->import_settings_data->get("multichannel_signed_distance_field") && (E->get().option.name == "msdf_pixel_range" || E->get().option.name == "msdf_size")) {
@@ -507,8 +507,6 @@ void DynamicFontImportSettingsDialog::_main_prop_changed(const String &p_edited_
507507
_variations_validate();
508508
} else if (p_edited_property == "keep_rounding_remainders") {
509509
font_preview->set_keep_rounding_remainders(import_settings_data->get("keep_rounding_remainders"));
510-
} else if (p_edited_property == "oversampling") {
511-
font_preview->set_oversampling(import_settings_data->get("oversampling"));
512510
}
513511
}
514512

@@ -983,7 +981,6 @@ void DynamicFontImportSettingsDialog::_re_import() {
983981
main_settings["hinting"] = import_settings_data->get("hinting");
984982
main_settings["subpixel_positioning"] = import_settings_data->get("subpixel_positioning");
985983
main_settings["keep_rounding_remainders"] = import_settings_data->get("keep_rounding_remainders");
986-
main_settings["oversampling"] = import_settings_data->get("oversampling");
987984
main_settings["fallbacks"] = import_settings_data->get("fallbacks");
988985
main_settings["compress"] = import_settings_data->get("compress");
989986

@@ -1296,7 +1293,6 @@ void DynamicFontImportSettingsDialog::open_settings(const String &p_path) {
12961293
}
12971294
font_preview->set_subpixel_positioning((TextServer::SubpixelPositioning)font_subpixel_positioning);
12981295
font_preview->set_keep_rounding_remainders(import_settings_data->get("keep_rounding_remainders"));
1299-
font_preview->set_oversampling(import_settings_data->get("oversampling"));
13001296
}
13011297
font_preview_label->add_theme_font_override(SceneStringName(font), font_preview);
13021298
font_preview_label->add_theme_font_size_override(SceneStringName(font_size), 200 * EDSCALE);
@@ -1330,7 +1326,6 @@ DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() {
13301326
options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "hinting", PROPERTY_HINT_ENUM, "None,Light,Normal"), 1));
13311327
options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::INT, "subpixel_positioning", PROPERTY_HINT_ENUM, "Disabled,Auto,One Half of a Pixel,One Quarter of a Pixel,Auto (Except Pixel Fonts)"), 4));
13321328
options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::BOOL, "keep_rounding_remainders"), true));
1333-
options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::FLOAT, "oversampling", PROPERTY_HINT_RANGE, "0,10,0.1"), 0.0));
13341329

13351330
options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::NIL, "Metadata Overrides", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant()));
13361331
options_general.push_back(ResourceImporter::ImportOption(PropertyInfo(Variant::DICTIONARY, "language_support"), Dictionary()));

editor/import/resource_importer_dynamic_font.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,9 +75,6 @@ bool ResourceImporterDynamicFont::get_option_visibility(const String &p_path, co
7575
if (p_option == "antialiasing" && bool(p_options["multichannel_signed_distance_field"])) {
7676
return false;
7777
}
78-
if (p_option == "oversampling" && bool(p_options["multichannel_signed_distance_field"])) {
79-
return false;
80-
}
8178
if (p_option == "subpixel_positioning" && bool(p_options["multichannel_signed_distance_field"])) {
8279
return false;
8380
}
@@ -120,7 +117,6 @@ void ResourceImporterDynamicFont::get_import_options(const String &p_path, List<
120117
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "hinting", PROPERTY_HINT_ENUM, "None,Light,Normal"), 1));
121118
r_options->push_back(ImportOption(PropertyInfo(Variant::INT, "subpixel_positioning", PROPERTY_HINT_ENUM, "Disabled,Auto,One Half of a Pixel,One Quarter of a Pixel,Auto (Except Pixel Fonts)"), 4));
122119
r_options->push_back(ImportOption(PropertyInfo(Variant::BOOL, "keep_rounding_remainders"), true));
123-
r_options->push_back(ImportOption(PropertyInfo(Variant::FLOAT, "oversampling", PROPERTY_HINT_RANGE, "0,10,0.1"), 0.0));
124120

125121
r_options->push_back(ImportOption(PropertyInfo(Variant::NIL, "Fallbacks", PROPERTY_HINT_NONE, "", PROPERTY_USAGE_GROUP), Variant()));
126122
r_options->push_back(ImportOption(PropertyInfo(Variant::ARRAY, "fallbacks", PROPERTY_HINT_ARRAY_TYPE, MAKE_RESOURCE_TYPE_HINT("Font")), Array()));
@@ -159,7 +155,6 @@ Error ResourceImporterDynamicFont::import(ResourceUID::ID p_source_id, const Str
159155
int hinting = p_options["hinting"];
160156
int subpixel_positioning = p_options["subpixel_positioning"];
161157
bool keep_rounding_remainders = p_options["keep_rounding_remainders"];
162-
real_t oversampling = p_options["oversampling"];
163158
Array fallbacks = p_options["fallbacks"];
164159

165160
// Load base font data.
@@ -181,7 +176,6 @@ Error ResourceImporterDynamicFont::import(ResourceUID::ID p_source_id, const Str
181176
font->set_modulate_color_glyphs(modulate_color_glyphs);
182177
font->set_allow_system_fallback(allow_system_fallback);
183178
font->set_hinting((TextServer::Hinting)hinting);
184-
font->set_oversampling(oversampling);
185179
font->set_fallbacks(fallbacks);
186180

187181
if (subpixel_positioning == 4 /* Auto (Except Pixel Fonts) */) {

editor/import/resource_importer_imagefont.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,6 @@ Error ResourceImporterImageFont::import(ResourceUID::ID p_source_id, const Strin
117117
font->set_modulate_color_glyphs(false);
118118
font->set_allow_system_fallback(false);
119119
font->set_hinting(TextServer::HINTING_NONE);
120-
font->set_oversampling(1.0f);
121120
font->set_fallbacks(fallbacks);
122121
font->set_texture_image(0, Vector2i(chr_height, 0), 0, img);
123122
font->set_fixed_size_scale_mode(smode);

0 commit comments

Comments
 (0)