From 9bd0bf1581afe4e917f037c0007dbcc21f5a2edd Mon Sep 17 00:00:00 2001 From: David Capello Date: Mon, 25 Mar 2024 11:59:25 -0300 Subject: [PATCH] New font selector (fix #4363) This new font selector list installed fonts with its proper name. It needs some extra work yet to select font set styles (regular, bold, italic, etc.) --- INSTALL.md | 4 +- data/pref.xml | 1 + data/strings/en.ini | 6 +- data/widgets/font_popup.xml | 4 +- data/widgets/paste_text.xml | 17 +- src/app/CMakeLists.txt | 5 +- src/app/commands/cmd_paste_text.cpp | 134 +++------- src/app/font_info.cpp | 142 +++++++++++ src/app/font_info.h | 86 +++++++ src/app/font_info_tests.cpp | 56 +++++ src/app/match_words.h | 4 +- src/app/ui/font_entry.cpp | 188 ++++++++++++++ src/app/ui/font_entry.h | 66 +++++ src/app/ui/font_popup.cpp | 364 ++++++++++++++++++++-------- src/app/ui/font_popup.h | 33 ++- src/app/ui/search_entry.h | 4 +- src/app/ui/skin/font_data.h | 3 + src/app/ui/skin/skin_theme.cpp | 9 + src/app/ui/skin/skin_theme.h | 6 +- src/app/util/freetype_utils.cpp | 107 -------- src/app/util/freetype_utils.h | 28 --- src/app/util/render_text.cpp | 105 ++++++++ src/app/util/render_text.h | 31 +++ src/app/util/shader_helpers.cpp | 25 +- src/app/util/shader_helpers.h | 1 + src/app/widget_loader.cpp | 5 + src/gen/ui_class.cpp | 3 + 27 files changed, 1069 insertions(+), 368 deletions(-) create mode 100644 src/app/font_info.cpp create mode 100644 src/app/font_info.h create mode 100644 src/app/font_info_tests.cpp create mode 100644 src/app/ui/font_entry.cpp create mode 100644 src/app/ui/font_entry.h delete mode 100644 src/app/util/freetype_utils.cpp delete mode 100644 src/app/util/freetype_utils.h create mode 100644 src/app/util/render_text.cpp create mode 100644 src/app/util/render_text.h diff --git a/INSTALL.md b/INSTALL.md index e7b538a949b..59e29e2bf24 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -51,7 +51,7 @@ To compile Aseprite you will need: * The latest version of [CMake](https://cmake.org) (3.16 or greater) * [Ninja](https://ninja-build.org) build system -* And a compiled version of the `aseprite-m102` branch of +* And a compiled version of the `aseprite-m124` branch of the [Skia library](https://github.com/aseprite/skia#readme). There are [pre-built packages available](https://github.com/aseprite/skia/releases). You can get some extra information in @@ -190,7 +190,7 @@ but it could be different in your Mac. ### Apple Silicon If you running macOS on an ARM64/AArch64/Apple Silicon Mac (e.g. M1), -you can compile a native ARM64 version of Aseprite following similar +you can compile a native ARM64 version of Aseprite following similar steps as above but when we call `cmake`, we have some differences: cd aseprite diff --git a/data/pref.xml b/data/pref.xml index dbc557525be..138a730ad6f 100644 --- a/data/pref.xml +++ b/data/pref.xml @@ -347,6 +347,7 @@