/**************************************************************************/ /* dynamic_font_import_settings.cpp */ /**************************************************************************/ /* This file is part of: */ /* GODOT ENGINE */ /* https://godotengine.org */ /**************************************************************************/ /* Copyright (c) 2014-present Godot Engine contributors (see AUTHORS.md). */ /* Copyright (c) 2007-2014 Juan Linietsky, Ariel Manzur. */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ /* "Software"), to deal in the Software without restriction, including */ /* without limitation the rights to use, copy, modify, merge, publish, */ /* distribute, sublicense, and/or sell copies of the Software, and to */ /* permit persons to whom the Software is furnished to do so, subject to */ /* the following conditions: */ /* */ /* The above copyright notice and this permission notice shall be */ /* included in all copies or substantial portions of the Software. */ /* */ /* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, */ /* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF */ /* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. */ /* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY */ /* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, */ /* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE */ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ #include "dynamic_font_import_settings.h" #include "core/config/project_settings.h" #include "core/string/translation_server.h" #include "editor/editor_file_system.h" #include "editor/editor_inspector.h" #include "editor/editor_locale_dialog.h" #include "editor/editor_node.h" #include "editor/editor_property_name_processor.h" #include "editor/editor_settings.h" #include "editor/editor_string_names.h" #include "editor/gui/editor_file_dialog.h" #include "editor/themes/editor_scale.h" /*************************************************************************/ /* Settings data */ /*************************************************************************/ bool DynamicFontImportSettingsData::_set(const StringName &p_name, const Variant &p_value) { … } bool DynamicFontImportSettingsData::_get(const StringName &p_name, Variant &r_ret) const { … } void DynamicFontImportSettingsData::_get_property_list(List<PropertyInfo> *p_list) const { … } Ref<FontFile> DynamicFontImportSettingsData::get_font() const { … } /*************************************************************************/ /* Glyph ranges */ /*************************************************************************/ struct UniRange { … }; // Unicode Character Blocks // Source: https://www.unicode.org/Public/16.0.0/ucd/Blocks.txt static UniRange unicode_ranges[] = …; void DynamicFontImportSettingsDialog::_add_glyph_range_item(int32_t p_start, int32_t p_end, const String &p_name) { … } /*************************************************************************/ /* Page 1 callbacks: Rendering Options */ /*************************************************************************/ void DynamicFontImportSettingsDialog::_main_prop_changed(const String &p_edited_property) { … } /*************************************************************************/ /* Page 2 callbacks: Configurations */ /*************************************************************************/ void DynamicFontImportSettingsDialog::_variation_add() { … } void DynamicFontImportSettingsDialog::_variation_selected() { … } void DynamicFontImportSettingsDialog::_variation_remove(Object *p_item, int p_column, int p_id, MouseButton p_button) { … } void DynamicFontImportSettingsDialog::_variation_changed(const String &p_edited_property) { … } void DynamicFontImportSettingsDialog::_variations_validate() { … } /*************************************************************************/ /* Page 2.1 callbacks: Text to select glyphs */ /*************************************************************************/ void DynamicFontImportSettingsDialog::_change_text_opts() { … } void DynamicFontImportSettingsDialog::_glyph_update_lbl() { … } void DynamicFontImportSettingsDialog::_glyph_clear() { … } void DynamicFontImportSettingsDialog::_glyph_text_selected() { … } /*************************************************************************/ /* Page 2.2 callbacks: Character map */ /*************************************************************************/ void DynamicFontImportSettingsDialog::_glyph_selected() { … } void DynamicFontImportSettingsDialog::_range_edited() { … } void DynamicFontImportSettingsDialog::_range_selected() { … } void DynamicFontImportSettingsDialog::_edit_range(int32_t p_start, int32_t p_end) { … } bool DynamicFontImportSettingsDialog::_char_update(int32_t p_char) { … } void DynamicFontImportSettingsDialog::_range_update(int32_t p_start, int32_t p_end) { … } /*************************************************************************/ /* Common */ /*************************************************************************/ DynamicFontImportSettingsDialog *DynamicFontImportSettingsDialog::singleton = …; String DynamicFontImportSettingsDialog::_pad_zeros(const String &p_hex) const { … } void DynamicFontImportSettingsDialog::_notification(int p_what) { … } void DynamicFontImportSettingsDialog::_re_import() { … } void DynamicFontImportSettingsDialog::_locale_edited() { … } void DynamicFontImportSettingsDialog::_process_locales() { … } void DynamicFontImportSettingsDialog::open_settings(const String &p_path) { … } DynamicFontImportSettingsDialog *DynamicFontImportSettingsDialog::get_singleton() { … } DynamicFontImportSettingsDialog::DynamicFontImportSettingsDialog() { … }