Update to the latest SDL2 version (2.32.2).

Fix user manually set fallback-font (default fallback font will be always loaded).
This commit is contained in:
Martín Lucas Golini
2025-03-28 15:38:43 -03:00
parent f721ef92df
commit bce702bf9f
6 changed files with 23 additions and 12 deletions

View File

@@ -325,8 +325,8 @@ jobs:
- name: Install Dependencies
run: |
brew install bash create-dmg premake p7zip
curl -OL https://github.com/libsdl-org/SDL/releases/download/release-2.30.9/SDL2-2.30.9.dmg
hdiutil attach SDL2-2.30.9.dmg
curl -OL https://github.com/libsdl-org/SDL/releases/download/release-2.32.2/SDL2-2.32.2.dmg
hdiutil attach SDL2-2.32.2.dmg
sudo cp -r /Volumes/SDL2/SDL2.framework /Library/Frameworks/
hdiutil detach /Volumes/SDL2
- name: Build

View File

@@ -344,7 +344,7 @@ os_links = { }
backends = { }
static_backends = { }
backend_selected = false
remote_sdl2_version = "SDL2-2.30.3"
remote_sdl2_version = "SDL2-2.32.2"
function build_arch_configuration()
if os.is_real("mingw32") or os.is_real("mingw64") then

View File

@@ -152,10 +152,12 @@ os_links = { }
backends = { }
static_backends = { }
backend_selected = false
remote_sdl2_version = "SDL2-2.30.9"
remote_sdl2_devel_src_url = "https://libsdl.org/release/SDL2-2.30.9.zip"
remote_sdl2_devel_vc_url = "https://www.libsdl.org/release/SDL2-devel-2.30.9-VC.zip"
remote_sdl2_devel_mingw_url = "https://www.libsdl.org/release/SDL2-devel-2.30.9-mingw.zip"
remote_sdl2_version_number = "2.32.2"
remote_sdl2_version = "SDL2-" .. remote_sdl2_version_number
remote_sdl2_devel_src_url = "https://libsdl.org/release/" .. remote_sdl2_version .. ".zip"
remote_sdl2_devel_vc_url = "https://www.libsdl.org/release/SDL2-devel-" .. remote_sdl2_version_number .. "-VC.zip"
remote_sdl2_devel_mingw_url = "https://www.libsdl.org/release/SDL2-devel-" .. remote_sdl2_version_number .. "-mingw.zip"
remote_sdl2_arm64_cross_tools_path = "/usr/local/cross-tools/aarch64-w64-mingw32"
function incdirs( dirs )

View File

@@ -1,7 +1,7 @@
#!/bin/bash
# Define SDL version and download URL
SDL_VERSION="2.30.9"
SDL_VERSION="2.32.2"
SDL_URL="https://libsdl.org/release/SDL2-${SDL_VERSION}.zip"
ARCH="x86_64" # Default architecture for host
@@ -30,7 +30,8 @@ install_dependencies() {
libxss-dev \
libxt-dev \
libxv-dev \
libxxf86vm-dev || exit
libxxf86vm-dev \
libdecor-0-dev || exit
}
# Function to install cross-compile dependencies for aarch64
@@ -57,7 +58,8 @@ install_cross_dependencies() {
libxss-dev:arm64 \
libxt-dev:arm64 \
libxv-dev:arm64 \
libxxf86vm-dev:arm64 || exit
libxxf86vm-dev:arm64 \
libdecor-0-dev:arm64 || exit
}
# Function to configure for cross-compilation
@@ -67,7 +69,7 @@ configure_for_aarch64() {
export AR=aarch64-linux-gnu-ar
export RANLIB=aarch64-linux-gnu-ranlib
export STRIP=aarch64-linux-gnu-strip
./configure --host=aarch64-linux-gnu --prefix=/usr --enable-video-x11 --enable-video-wayland --enable-wayland-shared || exit
./configure --host=aarch64-linux-gnu --prefix=/usr --enable-video-x11 --enable-video-wayland --enable-wayland-shared --enable-libdecor --enable-libdecor-shared || exit
}
# Parse options
@@ -100,7 +102,7 @@ if [ "$ARCH" == "aarch64" ]; then
configure_for_aarch64
else
echo "Configuring SDL2 for host system..."
./configure --enable-video-x11 --enable-video-wayland --enable-wayland-shared || exit
./configure --enable-video-x11 --enable-video-wayland --enable-wayland-shared --enable-libdecor --enable-libdecor-shared || exit
fi
# Build and install SDL2

View File

@@ -3609,6 +3609,12 @@ void App::init( const LogLevel& logLevel, std::string file, const Float& pidelDe
if ( mFallbackFont )
FontManager::instance()->addFallbackFont( mFallbackFont );
if ( mConfig.ui.fallbackFont != "fonts/DroidSansFallbackFull.ttf" ) {
mUserFallbackFont = loadFont( "fallback-font", mConfig.ui.fallbackFont );
if ( mUserFallbackFont )
FontManager::instance()->addFallbackFont( mUserFallbackFont );
}
Log::info( "Fonts loaded in: %s", fontsClock.getElapsedTime().toString() );
mAsyncResourcesLoaded = true;

View File

@@ -550,6 +550,7 @@ class App : public UICodeEditorSplitter::Client, public PluginContextProvider {
FontTrueType* mFontMono{ nullptr };
FontTrueType* mTerminalFont{ nullptr };
FontTrueType* mFallbackFont{ nullptr };
FontTrueType* mUserFallbackFont{ nullptr };
FontTrueType* mRemixIconFont{ nullptr };
FontTrueType* mNoniconsFont{ nullptr };
FontTrueType* mCodIconFont{ nullptr };