diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-05 00:05:49 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-12-05 00:05:49 +0100 |
commit | a0365c140a932895805f3c475a5bb3e02f5df4ad (patch) | |
tree | 2f5e4619e929f484b69ba6d41d32a87615321794 /platform/linuxbsd/os_linuxbsd.h | |
parent | 5efa25496480aa521f4803821e215bfc9a24149a (diff) | |
parent | ecec415988de5b016c70512bbb6a7cfc04ccd0a2 (diff) |
Merge pull request #68995 from bruvzg/sys_font_for_text
Use system fonts as fallback.
Diffstat (limited to 'platform/linuxbsd/os_linuxbsd.h')
-rw-r--r-- | platform/linuxbsd/os_linuxbsd.h | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/platform/linuxbsd/os_linuxbsd.h b/platform/linuxbsd/os_linuxbsd.h index aa7af92aa1..ef830a069b 100644 --- a/platform/linuxbsd/os_linuxbsd.h +++ b/platform/linuxbsd/os_linuxbsd.h @@ -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 |