You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-18 14:21:41 +00:00
Use system fonts as fallback and improve system font handling.
Add support for font weight and stretch selection when using system fonts. Add function to get system fallback font from a font name, style, text, and language code. Implement system font support for Android. Use system fonts as a last resort fallback.
This commit is contained in:
@@ -40,11 +40,17 @@
|
||||
#include "joypad_linux.h"
|
||||
#include "servers/audio_server.h"
|
||||
|
||||
#ifdef FONTCONFIG_ENABLED
|
||||
#include "fontconfig-so_wrap.h"
|
||||
#endif
|
||||
|
||||
class OS_LinuxBSD : public OS_Unix {
|
||||
virtual void delete_main_loop() override;
|
||||
|
||||
#ifdef FONTCONFIG_ENABLED
|
||||
bool font_config_initialized = false;
|
||||
FcConfig *config = nullptr;
|
||||
FcObjectSet *object_set = nullptr;
|
||||
#endif
|
||||
|
||||
#ifdef JOYDEV_ENABLED
|
||||
@@ -67,6 +73,9 @@ class OS_LinuxBSD : public OS_Unix {
|
||||
|
||||
MainLoop *main_loop = nullptr;
|
||||
|
||||
int _weight_to_fc(int p_weight) const;
|
||||
int _stretch_to_fc(int p_stretch) const;
|
||||
|
||||
String get_systemd_os_release_info_value(const String &key) const;
|
||||
|
||||
Vector<String> lspci_device_filter(Vector<String> vendor_device_id_mapping, String class_suffix, String check_column, String whitelist) const;
|
||||
@@ -94,7 +103,8 @@ public:
|
||||
virtual uint64_t get_embedded_pck_offset() const override;
|
||||
|
||||
virtual Vector<String> get_system_fonts() const override;
|
||||
virtual String get_system_font_path(const String &p_font_name, bool p_bold = false, bool p_italic = false) const override;
|
||||
virtual String get_system_font_path(const String &p_font_name, int p_weight = 400, int p_stretch = 100, bool p_italic = false) const override;
|
||||
virtual Vector<String> get_system_font_path_for_text(const String &p_font_name, const String &p_text, const String &p_locale = String(), const String &p_script = String(), int p_weight = 400, int p_stretch = 100, bool p_italic = false) const override;
|
||||
|
||||
virtual String get_config_path() const override;
|
||||
virtual String get_data_path() const override;
|
||||
@@ -119,6 +129,7 @@ public:
|
||||
virtual Error move_to_trash(const String &p_path) override;
|
||||
|
||||
OS_LinuxBSD();
|
||||
~OS_LinuxBSD();
|
||||
};
|
||||
|
||||
#endif // OS_LINUXBSD_H
|
||||
|
||||
Reference in New Issue
Block a user