diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f7135777..a6b24c21 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -15,7 +15,7 @@ jobs: fail-fast: false matrix: platform: - - { name: Windows (MSVC+CMake), os: windows-latest, shell: sh, cmake: '-DSDL3TTF_VENDORED=ON -GNinja', msvc: 1, shared: 1, static: 0 } + - { name: Windows (MSVC+CMake), os: windows-latest, shell: sh, cmake: '-DPerl_ROOT=C:/Strawberry/perl/bin/ -DSDL3TTF_VENDORED=ON -GNinja', msvc: 1, shared: 1, static: 0 } - { name: Windows (mingw64+CMake), os: windows-latest, shell: 'msys2 {0}', msystem: mingw64, msys-env: mingw-w64-x86_64, shared: 1, static: 0, cmake: '-DSDL3TTF_VENDORED=OFF -G "Ninja Multi-Config"' } - { name: Linux, os: ubuntu-20.04, shell: sh, cmake: '-DSDL3TTF_VENDORED=ON -GNinja', shared: 1, static: 0 } @@ -43,6 +43,7 @@ jobs: ${{ matrix.platform.msys-env }}-freetype ${{ matrix.platform.msys-env }}-harfbuzz ${{ matrix.platform.msys-env }}-ninja + ${{ matrix.platform.msys-env }}-perl ${{ matrix.platform.msys-env }}-pkg-config ${{ matrix.platform.msys-env }}-zlib - name: Set up SDL diff --git a/.gitmodules b/.gitmodules index 1703282f..519c3c27 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,4 +9,4 @@ [submodule "external/harfbuzz"] path = external/harfbuzz url = https://github.com/libsdl-org/harfbuzz.git - branch = 2.9.1-SDL + branch = 8.1.1-SDL diff --git a/.wikiheaders-options b/.wikiheaders-options index 3053eb27..ad214089 100644 --- a/.wikiheaders-options +++ b/.wikiheaders-options @@ -12,5 +12,5 @@ selectheaderregex = \ASDL_ttf\.h\Z projecturl = https://libsdl.org/projects/SDL_ttf wikiurl = https://wiki.libsdl.org/SDL_ttf bugreporturl = https://github.com/libsdl-org/sdlwiki/issues/new -warn_about_missing = 1 +warn_about_missing = 0 wikipreamble = (This function is part of SDL_ttf, a separate library from SDL.) diff --git a/Android.mk b/Android.mk index edfa4c70..bb55acc2 100644 --- a/Android.mk +++ b/Android.mk @@ -44,7 +44,7 @@ endif LOCAL_SHARED_LIBRARIES := SDL3 -LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/include $(LOCAL_PATH)/include/SDL3 +LOCAL_EXPORT_C_INCLUDES += $(LOCAL_PATH)/include include $(BUILD_SHARED_LIBRARY) diff --git a/CMakeLists.txt b/CMakeLists.txt index 49cf0832..ba35b284 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ set(MINOR_VERSION 0) set(MICRO_VERSION 0) set(SDL_REQUIRED_VERSION 3.0.0) -if(CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR) +if(CMAKE_CURRENT_SOURCE_DIR STREQUAL CMAKE_CURRENT_BINARY_DIR) message(FATAL_ERROR "Prevented in-tree built. Please create a build directory outside of the SDL_ttf source code and call cmake from there") endif() @@ -17,8 +17,9 @@ project(SDL3_ttf VERSION "${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}" ) -include(PrivateSdlFunctions) -include(sdlmanpages) +include("${SDL3_ttf_SOURCE_DIR}/cmake/GetGitRevisionDescription.cmake") +include("${SDL3_ttf_SOURCE_DIR}/cmake/PrivateSdlFunctions.cmake") +include("${SDL3_ttf_SOURCE_DIR}/cmake/sdlmanpages.cmake") sdl_calculate_derived_version_variables(${MAJOR_VERSION} ${MINOR_VERSION} ${MICRO_VERSION}) message(STATUS "Configuring ${PROJECT_NAME} ${PROJECT_VERSION}") @@ -49,8 +50,13 @@ include(CMakePackageConfigHelpers) include(GNUInstallDirs) include(CheckSymbolExists) -option(CMAKE_POSITION_INDEPENDENT_CODE "Build static libraries with -fPIC" ON) -option(BUILD_SHARED_LIBS "Build the library as a shared library" ON) +set(PLATFORM_SUPPORTS_SHARED ON) +if(VITA OR PSP OR PS2 OR N3DS OR RISCOS) + set(PLATFORM_SUPPORTS_SHARED OFF) +endif() + +option(CMAKE_POSITION_INDEPENDENT_CODE "Build static libraries with -fPIC" ${PLATFORM_SUPPORTS_SHARED}) +cmake_dependent_option(BUILD_SHARED_LIBS "Build the library as a shared library" ON PLATFORM_SUPPORTS_SHARED OFF) cmake_dependent_option(SDL3TTF_INSTALL "Enable SDL3_ttf install target" ${SDL3TTF_ROOTPROJECT} "${sdl3ttf_install_enableable}" OFF) cmake_dependent_option(SDL3TTF_INSTALL_MAN "Install man pages for SDL3_ttf" ${SDL3TTF_ROOTPROJECT} "SDL3TTF_INSTALL" OFF) @@ -103,9 +109,7 @@ endif() target_include_directories(${sdl3_ttf_target_name} PUBLIC "$" - "$" "$" - "$" ) target_compile_definitions(${sdl3_ttf_target_name} PRIVATE BUILD_SDL @@ -334,10 +338,12 @@ if(SDL3TTF_INSTALL) ) if(SDL3TTF_INSTALL_MAN) + sdl_get_git_revision_hash(SDL3TTF_REVISION) SDL_generate_manpages( HEADERS_DIR "${PROJECT_SOURCE_DIR}/include/SDL3_ttf" SYMBOL "TTF_Init" WIKIHEADERS_PL_PATH "${CMAKE_CURRENT_SOURCE_DIR}/build-scripts/wikiheaders.pl" + REVISION "${SDL3TTF_REVISION}" ) endif() endif() diff --git a/LICENSE.txt b/LICENSE.txt index 1d155ef4..73301d65 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (C) 1997-2023 Sam Lantinga +Copyright (C) 1997-2024 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/VisualC/SDL_ttf.vcxproj b/VisualC/SDL_ttf.vcxproj index 2ff573cb..bca85e73 100644 --- a/VisualC/SDL_ttf.vcxproj +++ b/VisualC/SDL_ttf.vcxproj @@ -296,50 +296,81 @@ + + + + + + + + + + + + + + - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) @@ -352,7 +383,7 @@ - + %(PreprocessorDefinitions) %(PreprocessorDefinitions) %(PreprocessorDefinitions) diff --git a/VisualC/SDL_ttf.vcxproj.filters b/VisualC/SDL_ttf.vcxproj.filters index 23bc872f..ea6ea142 100644 --- a/VisualC/SDL_ttf.vcxproj.filters +++ b/VisualC/SDL_ttf.vcxproj.filters @@ -281,7 +281,7 @@ - + Sources diff --git a/VisualC/Version.rc b/VisualC/Version.rc deleted file mode 100644 index fcb5e16f..00000000 --- a/VisualC/Version.rc +++ /dev/null @@ -1,105 +0,0 @@ -//Microsoft Developer Studio generated resource script. -// -#include "resource.h" - -#define APSTUDIO_READONLY_SYMBOLS -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 2 resource. -// -#include "winresrc.h" - -///////////////////////////////////////////////////////////////////////////// -#undef APSTUDIO_READONLY_SYMBOLS - -///////////////////////////////////////////////////////////////////////////// -// English (U.S.) resources - -#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) -#ifdef _WIN32 -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US -#pragma code_page(1252) -#endif //_WIN32 - -#ifndef _MAC -///////////////////////////////////////////////////////////////////////////// -// -// Version -// - -VS_VERSION_INFO VERSIONINFO - FILEVERSION 3,0,0,0 - PRODUCTVERSION 3,0,0,0 - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", "\0" - VALUE "FileDescription", "SDL_ttf\0" - VALUE "FileVersion", "3, 0, 0, 0\0" - VALUE "InternalName", "SDL_ttf\0" - VALUE "LegalCopyright", "Copyright (C) 2023 Sam Lantinga\0" - VALUE "OriginalFilename", "SDL_ttf.dll\0" - VALUE "ProductName", "Simple DirectMedia Layer\0" - VALUE "ProductVersion", "3, 0, 0, 0\0" - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - -#endif // !_MAC - - -#ifdef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// TEXTINCLUDE -// - -1 TEXTINCLUDE DISCARDABLE -BEGIN - "resource.h\0" -END - -2 TEXTINCLUDE DISCARDABLE -BEGIN - "#include ""afxres.h""\r\n" - "\0" -END - -3 TEXTINCLUDE DISCARDABLE -BEGIN - "\r\n" - "\0" -END - -#endif // APSTUDIO_INVOKED - -#endif // English (U.S.) resources -///////////////////////////////////////////////////////////////////////////// - - - -#ifndef APSTUDIO_INVOKED -///////////////////////////////////////////////////////////////////////////// -// -// Generated from the TEXTINCLUDE 3 resource. -// - - -///////////////////////////////////////////////////////////////////////////// -#endif // not APSTUDIO_INVOKED - diff --git a/VisualC/pkg-support/cmake/sdl3_ttf-config.cmake b/VisualC/pkg-support/cmake/sdl3_ttf-config.cmake index f3355047..9573f459 100644 --- a/VisualC/pkg-support/cmake/sdl3_ttf-config.cmake +++ b/VisualC/pkg-support/cmake/sdl3_ttf-config.cmake @@ -37,7 +37,7 @@ if(NOT TARGET SDL3_ttf::SDL3_ttf) add_library(SDL3_ttf::SDL3_ttf SHARED IMPORTED) set_target_properties(SDL3_ttf::SDL3_ttf PROPERTIES - INTERFACE_INCLUDE_DIRECTORIES "${_sdl3ttf_incdir};${_sdl3ttf_incdir}/SDL3_ttf" + INTERFACE_INCLUDE_DIRECTORIES "${_sdl3ttf_incdir}" IMPORTED_IMPLIB "${_sdl3ttf_library}" IMPORTED_LOCATION "${_sdl3ttf_dll}" COMPATIBLE_INTERFACE_BOOL "SDL3_SHARED" diff --git a/VisualC/resource.h b/VisualC/resource.h deleted file mode 100644 index 7c822cff..00000000 --- a/VisualC/resource.h +++ /dev/null @@ -1,15 +0,0 @@ -//{{NO_DEPENDENCIES}} -// Microsoft Developer Studio generated include file. -// Used by Version.rc -// - -// Next default values for new objects -// -#ifdef APSTUDIO_INVOKED -#ifndef APSTUDIO_READONLY_SYMBOLS -#define _APS_NEXT_RESOURCE_VALUE 101 -#define _APS_NEXT_COMMAND_VALUE 40001 -#define _APS_NEXT_CONTROL_VALUE 1000 -#define _APS_NEXT_SYMED_VALUE 101 -#endif -#endif diff --git a/Xcode/SDL_ttf.xcodeproj/project.pbxproj b/Xcode/SDL_ttf.xcodeproj/project.pbxproj index 4e733df7..23e5f948 100644 --- a/Xcode/SDL_ttf.xcodeproj/project.pbxproj +++ b/Xcode/SDL_ttf.xcodeproj/project.pbxproj @@ -7,15 +7,15 @@ objects = { /* Begin PBXAggregateTarget section */ - F3016F68296F9E9F00C730E5 /* SDL3_ttf.xcFramework */ = { + F3016F68296F9E9F00C730E5 /* SDL3_ttf.xcframework */ = { isa = PBXAggregateTarget; - buildConfigurationList = F3016F69296F9E9F00C730E5 /* Build configuration list for PBXAggregateTarget "SDL3_ttf.xcFramework" */; + buildConfigurationList = F3016F69296F9E9F00C730E5 /* Build configuration list for PBXAggregateTarget "SDL3_ttf.xcframework" */; buildPhases = ( F3016F6C296F9EA700C730E5 /* ShellScript */, ); dependencies = ( ); - name = SDL3_ttf.xcFramework; + name = SDL3_ttf.xcframework; productName = xcFramework; }; F3E1F8282A79403E00AC76D3 /* SDL3_ttf.dmg */ = { @@ -33,11 +33,34 @@ /* End PBXAggregateTarget section */ /* Begin PBXBuildFile section */ + 61047EA42B48AD0F00868128 /* hb-ot-shaper-syllabic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E8D2B48AD0D00868128 /* hb-ot-shaper-syllabic.cc */; }; + 61047EA52B48AD0F00868128 /* hb-paint-extents.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E8E2B48AD0D00868128 /* hb-paint-extents.cc */; }; + 61047EA62B48AD0F00868128 /* hb-ot-name.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E8F2B48AD0D00868128 /* hb-ot-name.cc */; }; + 61047EA72B48AD0F00868128 /* hb-coretext.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E902B48AD0D00868128 /* hb-coretext.cc */; }; + 61047EA82B48AD0F00868128 /* hb-paint.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E912B48AD0D00868128 /* hb-paint.cc */; }; + 61047EA92B48AD0F00868128 /* hb-face-builder.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E922B48AD0E00868128 /* hb-face-builder.cc */; }; + 61047EAA2B48AD0F00868128 /* hb-ot-shaper-arabic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E932B48AD0E00868128 /* hb-ot-shaper-arabic.cc */; }; + 61047EAB2B48AD0F00868128 /* hb-draw.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E942B48AD0E00868128 /* hb-draw.cc */; }; + 61047EAC2B48AD0F00868128 /* hb-ot-shaper-indic.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E952B48AD0E00868128 /* hb-ot-shaper-indic.cc */; }; + 61047EAD2B48AD0F00868128 /* hb-ot-shaper-indic-table.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E962B48AD0E00868128 /* hb-ot-shaper-indic-table.cc */; }; + 61047EAE2B48AD0F00868128 /* hb-style.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E972B48AD0E00868128 /* hb-style.cc */; }; + 61047EAF2B48AD0F00868128 /* hb-ot-shaper-use.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E982B48AD0E00868128 /* hb-ot-shaper-use.cc */; }; + 61047EB02B48AD0F00868128 /* hb-ot-shaper-khmer.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E992B48AD0E00868128 /* hb-ot-shaper-khmer.cc */; }; + 61047EB12B48AD0F00868128 /* hb-ot-shaper-vowel-constraints.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E9A2B48AD0E00868128 /* hb-ot-shaper-vowel-constraints.cc */; }; + 61047EB22B48AD0F00868128 /* hb-ot-shaper-hangul.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E9B2B48AD0E00868128 /* hb-ot-shaper-hangul.cc */; }; + 61047EB32B48AD0F00868128 /* hb-ot-meta.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E9C2B48AD0E00868128 /* hb-ot-meta.cc */; }; + 61047EB42B48AD0F00868128 /* hb-ot-shaper-thai.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E9D2B48AD0F00868128 /* hb-ot-shaper-thai.cc */; }; + 61047EB52B48AD0F00868128 /* hb-ot-shaper-hebrew.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E9E2B48AD0F00868128 /* hb-ot-shaper-hebrew.cc */; }; + 61047EB62B48AD0F00868128 /* hb-outline.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047E9F2B48AD0F00868128 /* hb-outline.cc */; }; + 61047EB72B48AD0F00868128 /* hb-ot-shaper-default.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047EA02B48AD0F00868128 /* hb-ot-shaper-default.cc */; }; + 61047EB82B48AD0F00868128 /* hb-directwrite.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047EA12B48AD0F00868128 /* hb-directwrite.cc */; }; + 61047EB92B48AD0F00868128 /* hb-ot-shaper-myanmar.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047EA22B48AD0F00868128 /* hb-ot-shaper-myanmar.cc */; }; + 61047EBA2B48AD0F00868128 /* hb-ot-color.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047EA32B48AD0F00868128 /* hb-ot-color.cc */; }; + 61047EBC2B48AF9700868128 /* hb-buffer-verify.cc in Sources */ = {isa = PBXBuildFile; fileRef = 61047EBB2B48AF9700868128 /* hb-buffer-verify.cc */; }; 7FC2F5DC285AC0D600836845 /* CMake in Resources */ = {isa = PBXBuildFile; fileRef = 7FC2F5DB285AC0D600836845 /* CMake */; }; BE48FD5F07AFA17000BB41DA /* SDL_ttf.h in Headers */ = {isa = PBXBuildFile; fileRef = 1014BAEA010A4B677F000001 /* SDL_ttf.h */; settings = {ATTRIBUTES = (Public, ); }; }; BE48FD6207AFA17000BB41DA /* SDL_ttf.c in Sources */ = {isa = PBXBuildFile; fileRef = F567D67A01CD962A01F3E8B9 /* SDL_ttf.c */; }; F307EE29282738F8003915D7 /* svg.c in Sources */ = {isa = PBXBuildFile; fileRef = F307EE28282738F8003915D7 /* svg.c */; }; - F307EE2C282807EB003915D7 /* hb-ms-feature-ranges.cc in Sources */ = {isa = PBXBuildFile; fileRef = F307EE2B282807EB003915D7 /* hb-ms-feature-ranges.cc */; }; F364A5B82620E1A200325ECE /* FTL.TXT in Resources */ = {isa = PBXBuildFile; fileRef = F364A5B72620E1A200325ECE /* FTL.TXT */; }; F364A5C42620E22400325ECE /* ReadMe.txt in Resources */ = {isa = PBXBuildFile; fileRef = F364A5C32620E22400325ECE /* ReadMe.txt */; }; F3696FE4278F7107003A7F94 /* sdf.c in Sources */ = {isa = PBXBuildFile; fileRef = F3696FE3278F7107003A7F94 /* sdf.c */; }; @@ -81,35 +104,24 @@ F384BCD4261EC2BE0028A248 /* type42.c in Sources */ = {isa = PBXBuildFile; fileRef = F384BCD3261EC2BE0028A248 /* type42.c */; }; F384BCDF261EC2CF0028A248 /* winfnt.c in Sources */ = {isa = PBXBuildFile; fileRef = F384BCDE261EC2CF0028A248 /* winfnt.c */; }; F384BCF2261EC5130028A248 /* ftcache.c in Sources */ = {isa = PBXBuildFile; fileRef = F384BCF1261EC5130028A248 /* ftcache.c */; }; - F384BD2F261EC7650028A248 /* hb-ot-shape-complex-default.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD05261EC7640028A248 /* hb-ot-shape-complex-default.cc */; }; F384BD35261EC7650028A248 /* hb-set.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD06261EC7640028A248 /* hb-set.cc */; }; F384BD3B261EC7650028A248 /* hb-shape.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD07261EC7640028A248 /* hb-shape.cc */; }; F384BD41261EC7650028A248 /* hb-static.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD08261EC7640028A248 /* hb-static.cc */; }; - F384BD47261EC7650028A248 /* hb-ot-shape-complex-hebrew.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD09261EC7640028A248 /* hb-ot-shape-complex-hebrew.cc */; }; F384BD4D261EC7650028A248 /* hb-ucd.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD0A261EC7640028A248 /* hb-ucd.cc */; }; - F384BD53261EC7650028A248 /* hb-ot-shape-complex-indic-table.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD0B261EC7640028A248 /* hb-ot-shape-complex-indic-table.cc */; }; F384BD59261EC7650028A248 /* hb-ot-map.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD0C261EC7640028A248 /* hb-ot-map.cc */; }; - F384BD5F261EC7650028A248 /* hb-ot-shape-complex-hangul.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD0D261EC7640028A248 /* hb-ot-shape-complex-hangul.cc */; }; F384BD65261EC7650028A248 /* hb-ot-font.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD0E261EC7640028A248 /* hb-ot-font.cc */; }; F384BD6B261EC7650028A248 /* hb-shape-plan.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD0F261EC7640028A248 /* hb-shape-plan.cc */; }; F384BD71261EC7650028A248 /* hb-ot-tag.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD10261EC7640028A248 /* hb-ot-tag.cc */; }; F384BD77261EC7650028A248 /* hb-number.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD11261EC7640028A248 /* hb-number.cc */; }; F384BD7D261EC7650028A248 /* hb-ot-metrics.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD12261EC7640028A248 /* hb-ot-metrics.cc */; }; F384BD83261EC7650028A248 /* hb-shaper.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD13261EC7650028A248 /* hb-shaper.cc */; }; - F384BD89261EC7650028A248 /* hb-ot-shape-complex-arabic.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD14261EC7650028A248 /* hb-ot-shape-complex-arabic.cc */; }; - F384BD8F261EC7650028A248 /* hb-ot-shape-complex-vowel-constraints.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD15261EC7650028A248 /* hb-ot-shape-complex-vowel-constraints.cc */; }; F384BD95261EC7650028A248 /* hb-ot-layout.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD16261EC7650028A248 /* hb-ot-layout.cc */; }; - F384BD9B261EC7650028A248 /* hb-ot-shape-complex-thai.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD17261EC7650028A248 /* hb-ot-shape-complex-thai.cc */; }; - F384BDA1261EC7650028A248 /* hb-ot-shape-complex-indic.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD18261EC7650028A248 /* hb-ot-shape-complex-indic.cc */; }; F384BDA7261EC7650028A248 /* hb-buffer-serialize.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD19261EC7650028A248 /* hb-buffer-serialize.cc */; }; F384BDAD261EC7650028A248 /* hb-font.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD1A261EC7650028A248 /* hb-font.cc */; }; - F384BDB3261EC7650028A248 /* hb-ot-shape-complex-use.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD1B261EC7650028A248 /* hb-ot-shape-complex-use.cc */; }; F384BDB9261EC7650028A248 /* hb-unicode.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD1C261EC7650028A248 /* hb-unicode.cc */; }; F384BDBF261EC7650028A248 /* hb-buffer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD1D261EC7650028A248 /* hb-buffer.cc */; }; F384BDC5261EC7650028A248 /* hb-ot-cff2-table.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD1E261EC7650028A248 /* hb-ot-cff2-table.cc */; }; F384BDCB261EC7650028A248 /* hb-ot-face.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD1F261EC7650028A248 /* hb-ot-face.cc */; }; - F384BDD1261EC7650028A248 /* hb-ot-shape-complex-khmer.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD20261EC7650028A248 /* hb-ot-shape-complex-khmer.cc */; }; - F384BDD7261EC7650028A248 /* hb-ot-shape-complex-myanmar.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD21261EC7650028A248 /* hb-ot-shape-complex-myanmar.cc */; }; F384BDDD261EC7650028A248 /* hb-aat-layout.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD22261EC7650028A248 /* hb-aat-layout.cc */; }; F384BDE3261EC7650028A248 /* hb-common.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD23261EC7650028A248 /* hb-common.cc */; }; F384BDE9261EC7650028A248 /* hb-ot-cff1-table.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD24261EC7650028A248 /* hb-ot-cff1-table.cc */; }; @@ -122,7 +134,6 @@ F384BE13261EC7650028A248 /* hb-ot-math.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD2B261EC7650028A248 /* hb-ot-math.cc */; }; F384BE19261EC7650028A248 /* hb-ot-shape-fallback.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD2C261EC7650028A248 /* hb-ot-shape-fallback.cc */; }; F384BE1F261EC7650028A248 /* hb-ot-shape.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD2D261EC7650028A248 /* hb-ot-shape.cc */; }; - F384BE25261EC7650028A248 /* hb-ot-shape-complex-syllabic.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BD2E261EC7650028A248 /* hb-ot-shape-complex-syllabic.cc */; }; F384BE48261EC9470028A248 /* hb-fallback-shape.cc in Sources */ = {isa = PBXBuildFile; fileRef = F384BE47261EC9470028A248 /* hb-fallback-shape.cc */; }; F384BE62261ECD9F0028A248 /* HarfBuzz-LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = F384BE60261ECD9F0028A248 /* HarfBuzz-LICENSE.txt */; }; F384BE65261ECD9F0028A248 /* FreeType-LICENSE.txt in Resources */ = {isa = PBXBuildFile; fileRef = F384BE61261ECD9F0028A248 /* FreeType-LICENSE.txt */; }; @@ -149,6 +160,30 @@ /* Begin PBXFileReference section */ 1014BAEA010A4B677F000001 /* SDL_ttf.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; name = SDL_ttf.h; path = ../include/SDL3_ttf/SDL_ttf.h; sourceTree = SOURCE_ROOT; }; + 61047E8D2B48AD0D00868128 /* hb-ot-shaper-syllabic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-syllabic.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-syllabic.cc"; sourceTree = ""; }; + 61047E8E2B48AD0D00868128 /* hb-paint-extents.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-paint-extents.cc"; path = "../external/harfbuzz/src/hb-paint-extents.cc"; sourceTree = ""; }; + 61047E8F2B48AD0D00868128 /* hb-ot-name.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-name.cc"; path = "../external/harfbuzz/src/hb-ot-name.cc"; sourceTree = ""; }; + 61047E902B48AD0D00868128 /* hb-coretext.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-coretext.cc"; path = "../external/harfbuzz/src/hb-coretext.cc"; sourceTree = ""; }; + 61047E912B48AD0D00868128 /* hb-paint.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-paint.cc"; path = "../external/harfbuzz/src/hb-paint.cc"; sourceTree = ""; }; + 61047E922B48AD0E00868128 /* hb-face-builder.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-face-builder.cc"; path = "../external/harfbuzz/src/hb-face-builder.cc"; sourceTree = ""; }; + 61047E932B48AD0E00868128 /* hb-ot-shaper-arabic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-arabic.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-arabic.cc"; sourceTree = ""; }; + 61047E942B48AD0E00868128 /* hb-draw.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-draw.cc"; path = "../external/harfbuzz/src/hb-draw.cc"; sourceTree = ""; }; + 61047E952B48AD0E00868128 /* hb-ot-shaper-indic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-indic.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-indic.cc"; sourceTree = ""; }; + 61047E962B48AD0E00868128 /* hb-ot-shaper-indic-table.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-indic-table.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-indic-table.cc"; sourceTree = ""; }; + 61047E972B48AD0E00868128 /* hb-style.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-style.cc"; path = "../external/harfbuzz/src/hb-style.cc"; sourceTree = ""; }; + 61047E982B48AD0E00868128 /* hb-ot-shaper-use.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-use.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-use.cc"; sourceTree = ""; }; + 61047E992B48AD0E00868128 /* hb-ot-shaper-khmer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-khmer.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-khmer.cc"; sourceTree = ""; }; + 61047E9A2B48AD0E00868128 /* hb-ot-shaper-vowel-constraints.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-vowel-constraints.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-vowel-constraints.cc"; sourceTree = ""; }; + 61047E9B2B48AD0E00868128 /* hb-ot-shaper-hangul.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-hangul.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-hangul.cc"; sourceTree = ""; }; + 61047E9C2B48AD0E00868128 /* hb-ot-meta.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-meta.cc"; path = "../external/harfbuzz/src/hb-ot-meta.cc"; sourceTree = ""; }; + 61047E9D2B48AD0F00868128 /* hb-ot-shaper-thai.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-thai.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-thai.cc"; sourceTree = ""; }; + 61047E9E2B48AD0F00868128 /* hb-ot-shaper-hebrew.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-hebrew.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-hebrew.cc"; sourceTree = ""; }; + 61047E9F2B48AD0F00868128 /* hb-outline.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-outline.cc"; path = "../external/harfbuzz/src/hb-outline.cc"; sourceTree = ""; }; + 61047EA02B48AD0F00868128 /* hb-ot-shaper-default.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-default.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-default.cc"; sourceTree = ""; }; + 61047EA12B48AD0F00868128 /* hb-directwrite.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-directwrite.cc"; path = "../external/harfbuzz/src/hb-directwrite.cc"; sourceTree = ""; }; + 61047EA22B48AD0F00868128 /* hb-ot-shaper-myanmar.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shaper-myanmar.cc"; path = "../external/harfbuzz/src/hb-ot-shaper-myanmar.cc"; sourceTree = ""; }; + 61047EA32B48AD0F00868128 /* hb-ot-color.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-color.cc"; path = "../external/harfbuzz/src/hb-ot-color.cc"; sourceTree = ""; }; + 61047EBB2B48AF9700868128 /* hb-buffer-verify.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-buffer-verify.cc"; path = "../external/harfbuzz/src/hb-buffer-verify.cc"; sourceTree = ""; }; 7FC2F5DB285AC0D600836845 /* CMake */ = {isa = PBXFileReference; lastKnownFileType = folder; path = CMake; sourceTree = ""; }; A75FDB0C23E37ED200529352 /* SDL3.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL3.framework; path = iOS/SDL3.framework; sourceTree = ""; }; A75FDB1023E37EE400529352 /* SDL3.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SDL3.framework; path = tvOS/SDL3.framework; sourceTree = ""; }; @@ -156,7 +191,6 @@ BE48FD6707AFA17000BB41DA /* SDL3_ttf.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SDL3_ttf.framework; sourceTree = BUILT_PRODUCTS_DIR; }; BE48FD8307AFA29000BB41DA /* SDL3.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = SDL3.framework; sourceTree = ""; }; F307EE28282738F8003915D7 /* svg.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = svg.c; path = ../external/freetype/src/svg/svg.c; sourceTree = ""; }; - F307EE2B282807EB003915D7 /* hb-ms-feature-ranges.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ms-feature-ranges.cc"; path = "../external/harfbuzz/src/hb-ms-feature-ranges.cc"; sourceTree = ""; }; F364A5B72620E1A200325ECE /* FTL.TXT */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = FTL.TXT; path = ../../../external/freetype/docs/FTL.TXT; sourceTree = ""; }; F364A5C32620E22400325ECE /* ReadMe.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = ReadMe.txt; sourceTree = ""; }; F3696FE3278F7107003A7F94 /* sdf.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = sdf.c; path = ../external/freetype/src/sdf/sdf.c; sourceTree = ""; }; @@ -200,35 +234,24 @@ F384BCD3261EC2BE0028A248 /* type42.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = type42.c; path = ../external/freetype/src/type42/type42.c; sourceTree = ""; }; F384BCDE261EC2CF0028A248 /* winfnt.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = winfnt.c; path = ../external/freetype/src/winfonts/winfnt.c; sourceTree = ""; }; F384BCF1261EC5130028A248 /* ftcache.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; name = ftcache.c; path = ../external/freetype/src/cache/ftcache.c; sourceTree = ""; }; - F384BD05261EC7640028A248 /* hb-ot-shape-complex-default.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-default.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-default.cc"; sourceTree = ""; }; F384BD06261EC7640028A248 /* hb-set.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-set.cc"; path = "../external/harfbuzz/src/hb-set.cc"; sourceTree = ""; }; F384BD07261EC7640028A248 /* hb-shape.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-shape.cc"; path = "../external/harfbuzz/src/hb-shape.cc"; sourceTree = ""; }; F384BD08261EC7640028A248 /* hb-static.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-static.cc"; path = "../external/harfbuzz/src/hb-static.cc"; sourceTree = ""; }; - F384BD09261EC7640028A248 /* hb-ot-shape-complex-hebrew.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-hebrew.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-hebrew.cc"; sourceTree = ""; }; F384BD0A261EC7640028A248 /* hb-ucd.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ucd.cc"; path = "../external/harfbuzz/src/hb-ucd.cc"; sourceTree = ""; }; - F384BD0B261EC7640028A248 /* hb-ot-shape-complex-indic-table.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-indic-table.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-indic-table.cc"; sourceTree = ""; }; F384BD0C261EC7640028A248 /* hb-ot-map.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-map.cc"; path = "../external/harfbuzz/src/hb-ot-map.cc"; sourceTree = ""; }; - F384BD0D261EC7640028A248 /* hb-ot-shape-complex-hangul.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-hangul.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-hangul.cc"; sourceTree = ""; }; F384BD0E261EC7640028A248 /* hb-ot-font.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-font.cc"; path = "../external/harfbuzz/src/hb-ot-font.cc"; sourceTree = ""; }; F384BD0F261EC7640028A248 /* hb-shape-plan.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-shape-plan.cc"; path = "../external/harfbuzz/src/hb-shape-plan.cc"; sourceTree = ""; }; F384BD10261EC7640028A248 /* hb-ot-tag.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-tag.cc"; path = "../external/harfbuzz/src/hb-ot-tag.cc"; sourceTree = ""; }; F384BD11261EC7640028A248 /* hb-number.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-number.cc"; path = "../external/harfbuzz/src/hb-number.cc"; sourceTree = ""; }; F384BD12261EC7640028A248 /* hb-ot-metrics.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-metrics.cc"; path = "../external/harfbuzz/src/hb-ot-metrics.cc"; sourceTree = ""; }; F384BD13261EC7650028A248 /* hb-shaper.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-shaper.cc"; path = "../external/harfbuzz/src/hb-shaper.cc"; sourceTree = ""; }; - F384BD14261EC7650028A248 /* hb-ot-shape-complex-arabic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-arabic.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-arabic.cc"; sourceTree = ""; }; - F384BD15261EC7650028A248 /* hb-ot-shape-complex-vowel-constraints.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-vowel-constraints.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc"; sourceTree = ""; }; F384BD16261EC7650028A248 /* hb-ot-layout.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-layout.cc"; path = "../external/harfbuzz/src/hb-ot-layout.cc"; sourceTree = ""; }; - F384BD17261EC7650028A248 /* hb-ot-shape-complex-thai.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-thai.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-thai.cc"; sourceTree = ""; }; - F384BD18261EC7650028A248 /* hb-ot-shape-complex-indic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-indic.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-indic.cc"; sourceTree = ""; }; F384BD19261EC7650028A248 /* hb-buffer-serialize.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-buffer-serialize.cc"; path = "../external/harfbuzz/src/hb-buffer-serialize.cc"; sourceTree = ""; }; F384BD1A261EC7650028A248 /* hb-font.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-font.cc"; path = "../external/harfbuzz/src/hb-font.cc"; sourceTree = ""; }; - F384BD1B261EC7650028A248 /* hb-ot-shape-complex-use.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-use.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-use.cc"; sourceTree = ""; }; F384BD1C261EC7650028A248 /* hb-unicode.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-unicode.cc"; path = "../external/harfbuzz/src/hb-unicode.cc"; sourceTree = ""; }; F384BD1D261EC7650028A248 /* hb-buffer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-buffer.cc"; path = "../external/harfbuzz/src/hb-buffer.cc"; sourceTree = ""; }; F384BD1E261EC7650028A248 /* hb-ot-cff2-table.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-cff2-table.cc"; path = "../external/harfbuzz/src/hb-ot-cff2-table.cc"; sourceTree = ""; }; F384BD1F261EC7650028A248 /* hb-ot-face.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-face.cc"; path = "../external/harfbuzz/src/hb-ot-face.cc"; sourceTree = ""; }; - F384BD20261EC7650028A248 /* hb-ot-shape-complex-khmer.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-khmer.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-khmer.cc"; sourceTree = ""; }; - F384BD21261EC7650028A248 /* hb-ot-shape-complex-myanmar.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-myanmar.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-myanmar.cc"; sourceTree = ""; }; F384BD22261EC7650028A248 /* hb-aat-layout.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-aat-layout.cc"; path = "../external/harfbuzz/src/hb-aat-layout.cc"; sourceTree = ""; }; F384BD23261EC7650028A248 /* hb-common.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-common.cc"; path = "../external/harfbuzz/src/hb-common.cc"; sourceTree = ""; }; F384BD24261EC7650028A248 /* hb-ot-cff1-table.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-cff1-table.cc"; path = "../external/harfbuzz/src/hb-ot-cff1-table.cc"; sourceTree = ""; }; @@ -241,7 +264,6 @@ F384BD2B261EC7650028A248 /* hb-ot-math.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-math.cc"; path = "../external/harfbuzz/src/hb-ot-math.cc"; sourceTree = ""; }; F384BD2C261EC7650028A248 /* hb-ot-shape-fallback.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-fallback.cc"; path = "../external/harfbuzz/src/hb-ot-shape-fallback.cc"; sourceTree = ""; }; F384BD2D261EC7650028A248 /* hb-ot-shape.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape.cc"; path = "../external/harfbuzz/src/hb-ot-shape.cc"; sourceTree = ""; }; - F384BD2E261EC7650028A248 /* hb-ot-shape-complex-syllabic.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-ot-shape-complex-syllabic.cc"; path = "../external/harfbuzz/src/hb-ot-shape-complex-syllabic.cc"; sourceTree = ""; }; F384BE47261EC9470028A248 /* hb-fallback-shape.cc */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = "hb-fallback-shape.cc"; path = "../external/harfbuzz/src/hb-fallback-shape.cc"; sourceTree = ""; }; F384BE60261ECD9F0028A248 /* HarfBuzz-LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "HarfBuzz-LICENSE.txt"; sourceTree = ""; }; F384BE61261ECD9F0028A248 /* FreeType-LICENSE.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = "FreeType-LICENSE.txt"; sourceTree = ""; }; @@ -406,6 +428,30 @@ F384BD04261EC64F0028A248 /* HarfBuzz */ = { isa = PBXGroup; children = ( + 61047EBB2B48AF9700868128 /* hb-buffer-verify.cc */, + 61047E902B48AD0D00868128 /* hb-coretext.cc */, + 61047EA12B48AD0F00868128 /* hb-directwrite.cc */, + 61047E942B48AD0E00868128 /* hb-draw.cc */, + 61047E922B48AD0E00868128 /* hb-face-builder.cc */, + 61047EA32B48AD0F00868128 /* hb-ot-color.cc */, + 61047E9C2B48AD0E00868128 /* hb-ot-meta.cc */, + 61047E8F2B48AD0D00868128 /* hb-ot-name.cc */, + 61047E932B48AD0E00868128 /* hb-ot-shaper-arabic.cc */, + 61047EA02B48AD0F00868128 /* hb-ot-shaper-default.cc */, + 61047E9B2B48AD0E00868128 /* hb-ot-shaper-hangul.cc */, + 61047E9E2B48AD0F00868128 /* hb-ot-shaper-hebrew.cc */, + 61047E962B48AD0E00868128 /* hb-ot-shaper-indic-table.cc */, + 61047E952B48AD0E00868128 /* hb-ot-shaper-indic.cc */, + 61047E992B48AD0E00868128 /* hb-ot-shaper-khmer.cc */, + 61047EA22B48AD0F00868128 /* hb-ot-shaper-myanmar.cc */, + 61047E8D2B48AD0D00868128 /* hb-ot-shaper-syllabic.cc */, + 61047E9D2B48AD0F00868128 /* hb-ot-shaper-thai.cc */, + 61047E982B48AD0E00868128 /* hb-ot-shaper-use.cc */, + 61047E9A2B48AD0E00868128 /* hb-ot-shaper-vowel-constraints.cc */, + 61047E9F2B48AD0F00868128 /* hb-outline.cc */, + 61047E8E2B48AD0D00868128 /* hb-paint-extents.cc */, + 61047E912B48AD0D00868128 /* hb-paint.cc */, + 61047E972B48AD0E00868128 /* hb-style.cc */, F384BD22261EC7650028A248 /* hb-aat-layout.cc */, F384BD27261EC7650028A248 /* hb-aat-map.cc */, F384BD26261EC7650028A248 /* hb-blob.cc */, @@ -416,7 +462,6 @@ F384BE47261EC9470028A248 /* hb-fallback-shape.cc */, F384BD1A261EC7650028A248 /* hb-font.cc */, F384BD28261EC7650028A248 /* hb-ft.cc */, - F307EE2B282807EB003915D7 /* hb-ms-feature-ranges.cc */, F384BD11261EC7640028A248 /* hb-number.cc */, F384BD24261EC7650028A248 /* hb-ot-cff1-table.cc */, F384BD1E261EC7650028A248 /* hb-ot-cff2-table.cc */, @@ -426,18 +471,6 @@ F384BD0C261EC7640028A248 /* hb-ot-map.cc */, F384BD2B261EC7650028A248 /* hb-ot-math.cc */, F384BD12261EC7640028A248 /* hb-ot-metrics.cc */, - F384BD14261EC7650028A248 /* hb-ot-shape-complex-arabic.cc */, - F384BD05261EC7640028A248 /* hb-ot-shape-complex-default.cc */, - F384BD0D261EC7640028A248 /* hb-ot-shape-complex-hangul.cc */, - F384BD09261EC7640028A248 /* hb-ot-shape-complex-hebrew.cc */, - F384BD0B261EC7640028A248 /* hb-ot-shape-complex-indic-table.cc */, - F384BD18261EC7650028A248 /* hb-ot-shape-complex-indic.cc */, - F384BD20261EC7650028A248 /* hb-ot-shape-complex-khmer.cc */, - F384BD21261EC7650028A248 /* hb-ot-shape-complex-myanmar.cc */, - F384BD2E261EC7650028A248 /* hb-ot-shape-complex-syllabic.cc */, - F384BD17261EC7650028A248 /* hb-ot-shape-complex-thai.cc */, - F384BD1B261EC7650028A248 /* hb-ot-shape-complex-use.cc */, - F384BD15261EC7650028A248 /* hb-ot-shape-complex-vowel-constraints.cc */, F384BD2C261EC7650028A248 /* hb-ot-shape-fallback.cc */, F384BD29261EC7650028A248 /* hb-ot-shape-normalize.cc */, F384BD2D261EC7650028A248 /* hb-ot-shape.cc */, @@ -554,7 +587,7 @@ projectRoot = ""; targets = ( BE48FD5D07AFA17000BB41DA /* SDL3_ttf */, - F3016F68296F9E9F00C730E5 /* SDL3_ttf.xcFramework */, + F3016F68296F9E9F00C730E5 /* SDL3_ttf.xcframework */, F3E1F8282A79403E00AC76D3 /* SDL3_ttf.dmg */, ); }; @@ -613,7 +646,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3_ttf\"\nPROJECT_NAME=\"SDL_ttf\"\nSCHEME=\"SDL3_ttf\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -sdk macosx \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -sdk iphonesimulator \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -sdk iphoneos \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -sdk appletvsimulator \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -sdk appletvos \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n"; + shellScript = "# Build an xcframework with both device and simulator files for all platforms.\n# Adapted from an answer in\n# https://developer.apple.com/forums/thread/666335?answerId=685927022#685927022\n\nif [ \"$XCODE_VERSION_ACTUAL\" -lt 1100 ]\nthen\n echo \"error: Building an xcframework requires Xcode 11 minimum.\"\n exit 1\nfi\n\nFRAMEWORK_NAME=\"SDL3_ttf\"\nPROJECT_NAME=\"SDL_ttf\"\nSCHEME=\"SDL3_ttf\"\n\nMACOS_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-macosx.xcarchive\"\nIOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphonesimulator.xcarchive\"\nIOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-iphoneos.xcarchive\"\nTVOS_SIMULATOR_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvsimulator.xcarchive\"\nTVOS_DEVICE_ARCHIVE_PATH=\"${BUILD_DIR}/${CONFIGURATION}/${FRAMEWORK_NAME}-appletvos.xcarchive\"\n\nOUTPUT_DIR=\"./build/\"\n\n# macOS\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${MACOS_ARCHIVE_PATH} \\\n -destination 'generic/platform=macOS,name=Any Mac' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n \n# iOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# iOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${IOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=iOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS simulator\nxcodebuild archive \\\n ONLY_ACTIVE_ARCH=NO \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_SIMULATOR_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS Simulator' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# tvOS device\nxcodebuild archive \\\n -scheme \"${SCHEME}\" \\\n -project \"${PROJECT_NAME}.xcodeproj\" \\\n -archivePath ${TVOS_DEVICE_ARCHIVE_PATH} \\\n -destination 'generic/platform=tvOS' \\\n BUILD_LIBRARY_FOR_DISTRIBUTION=YES \\\n SKIP_INSTALL=NO || exit $?\n\n# Clean-up any existing instance of this xcframework from the Products directory\nrm -rf \"${OUTPUT_DIR}${FRAMEWORK_NAME}.xcframework\"\n\n# Create final xcframework\nxcodebuild -create-xcframework \\\n -framework \"${MACOS_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${IOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_DEVICE_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -framework \"${TVOS_SIMULATOR_ARCHIVE_PATH}\"/Products/Library/Frameworks/${FRAMEWORK_NAME}.framework \\\n -output ${OUTPUT_DIR}/${FRAMEWORK_NAME}.xcframework\n\n# Ensure git doesn't pick up on our Products folder. \nrm -rf ${OUTPUT_DIR}/.gitignore\necho \"*\" >> ${OUTPUT_DIR}/.gitignore\n"; }; F3E1F82E2A79405E00AC76D3 /* ShellScript */ = { isa = PBXShellScriptBuildPhase; @@ -640,16 +673,14 @@ isa = PBXSourcesBuildPhase; buildActionMask = 2147483647; files = ( + 61047EBC2B48AF9700868128 /* hb-buffer-verify.cc in Sources */, F384BB8B261EC0DE0028A248 /* ftbdf.c in Sources */, - F384BD8F261EC7650028A248 /* hb-ot-shape-complex-vowel-constraints.cc in Sources */, F384BBBB261EC0DE0028A248 /* ftglyph.c in Sources */, F384BC3A261EC1890028A248 /* type1cid.c in Sources */, F384BC71261EC2050028A248 /* psaux.c in Sources */, F384BD35261EC7650028A248 /* hb-set.cc in Sources */, F384BC9D261EC2680028A248 /* sfnt.c in Sources */, F384BDE9261EC7650028A248 /* hb-ot-cff1-table.cc in Sources */, - F384BE25261EC7650028A248 /* hb-ot-shape-complex-syllabic.cc in Sources */, - F384BDD1261EC7650028A248 /* hb-ot-shape-complex-khmer.cc in Sources */, F384BCBE261EC2980028A248 /* truetype.c in Sources */, F384BD59261EC7650028A248 /* hb-ot-map.cc in Sources */, F384BBD9261EC0DE0028A248 /* ftcid.c in Sources */, @@ -662,41 +693,54 @@ F384BDA7261EC7650028A248 /* hb-buffer-serialize.cc in Sources */, F384BBC1261EC0DE0028A248 /* ftsynth.c in Sources */, F384BE07261EC7650028A248 /* hb-ot-shape-normalize.cc in Sources */, + 61047EB32B48AD0F00868128 /* hb-ot-meta.cc in Sources */, F384BD41261EC7650028A248 /* hb-static.cc in Sources */, F384BD77261EC7650028A248 /* hb-number.cc in Sources */, + 61047EB02B48AD0F00868128 /* hb-ot-shaper-khmer.cc in Sources */, F384BBCD261EC0DE0028A248 /* ftinit.c in Sources */, F384BE1F261EC7650028A248 /* hb-ot-shape.cc in Sources */, - F384BDD7261EC7650028A248 /* hb-ot-shape-complex-myanmar.cc in Sources */, + 61047EBA2B48AD0F00868128 /* hb-ot-color.cc in Sources */, + 61047EB42B48AD0F00868128 /* hb-ot-shaper-thai.cc in Sources */, + 61047EA42B48AD0F00868128 /* hb-ot-shaper-syllabic.cc in Sources */, F384BD6B261EC7650028A248 /* hb-shape-plan.cc in Sources */, F384BBAF261EC0DE0028A248 /* ftbase.c in Sources */, F384BC5B261EC1DF0028A248 /* pcf.c in Sources */, F384BC50261EC1B90028A248 /* ftlzw.c in Sources */, F384BBF1261EC0DE0028A248 /* ftsystem.c in Sources */, F384BBDF261EC0DE0028A248 /* ftpfr.c in Sources */, - F384BDB3261EC7650028A248 /* hb-ot-shape-complex-use.cc in Sources */, + 61047EB22B48AD0F00868128 /* hb-ot-shaper-hangul.cc in Sources */, + 61047EAD2B48AD0F00868128 /* hb-ot-shaper-indic-table.cc in Sources */, + 61047EAE2B48AD0F00868128 /* hb-style.cc in Sources */, F384BDC5261EC7650028A248 /* hb-ot-cff2-table.cc in Sources */, F384BE13261EC7650028A248 /* hb-ot-math.cc in Sources */, F384BBD3261EC0DE0028A248 /* ftmm.c in Sources */, F384BD71261EC7650028A248 /* hb-ot-tag.cc in Sources */, F384BC03261EC0DE0028A248 /* fttype1.c in Sources */, + 61047EA72B48AD0F00868128 /* hb-coretext.cc in Sources */, F384BB9D261EC0DE0028A248 /* ftstroke.c in Sources */, - F384BD5F261EC7650028A248 /* hb-ot-shape-complex-hangul.cc in Sources */, F384BC45261EC1A30028A248 /* ftgzip.c in Sources */, F307EE29282738F8003915D7 /* svg.c in Sources */, F384BB6C261EC0760028A248 /* autofit.c in Sources */, - F384BD53261EC7650028A248 /* hb-ot-shape-complex-indic-table.cc in Sources */, F384BDFB261EC7650028A248 /* hb-aat-map.cc in Sources */, + 61047EAB2B48AD0F00868128 /* hb-draw.cc in Sources */, F384BB91261EC0DE0028A248 /* ftgasp.c in Sources */, + 61047EAF2B48AD0F00868128 /* hb-ot-shaper-use.cc in Sources */, + 61047EB62B48AD0F00868128 /* hb-outline.cc in Sources */, F384BBF7261EC0DE0028A248 /* ftwinfnt.c in Sources */, + 61047EAA2B48AD0F00868128 /* hb-ot-shaper-arabic.cc in Sources */, + 61047EA62B48AD0F00868128 /* hb-ot-name.cc in Sources */, BE48FD6207AFA17000BB41DA /* SDL_ttf.c in Sources */, - F384BD89261EC7650028A248 /* hb-ot-shape-complex-arabic.cc in Sources */, + 61047EB92B48AD0F00868128 /* hb-ot-shaper-myanmar.cc in Sources */, F384BDE3261EC7650028A248 /* hb-common.cc in Sources */, F384BD7D261EC7650028A248 /* hb-ot-metrics.cc in Sources */, F384BDDD261EC7650028A248 /* hb-aat-layout.cc in Sources */, + 61047EA92B48AD0F00868128 /* hb-face-builder.cc in Sources */, + 61047EB82B48AD0F00868128 /* hb-directwrite.cc in Sources */, + 61047EA52B48AD0F00868128 /* hb-paint-extents.cc in Sources */, F384BDF5261EC7650028A248 /* hb-blob.cc in Sources */, - F384BD9B261EC7650028A248 /* hb-ot-shape-complex-thai.cc in Sources */, F384BCC9261EC2AE0028A248 /* type1.c in Sources */, F384BD3B261EC7650028A248 /* hb-shape.cc in Sources */, + 61047EA82B48AD0F00868128 /* hb-paint.cc in Sources */, F384BC92261EC2560028A248 /* raster.c in Sources */, F384BDCB261EC7650028A248 /* hb-ot-face.cc in Sources */, F384BB97261EC0DE0028A248 /* ftgxval.c in Sources */, @@ -707,24 +751,24 @@ F384BE01261EC7650028A248 /* hb-ft.cc in Sources */, F384BE19261EC7650028A248 /* hb-ot-shape-fallback.cc in Sources */, F384BD95261EC7650028A248 /* hb-ot-layout.cc in Sources */, - F307EE2C282807EB003915D7 /* hb-ms-feature-ranges.cc in Sources */, F384BC0E261EC0F90028A248 /* bdf.c in Sources */, F384BC87261EC23B0028A248 /* psmodule.c in Sources */, F384BE0D261EC7650028A248 /* hb-ot-var.cc in Sources */, F384BBE5261EC0DE0028A248 /* ftotval.c in Sources */, - F384BD2F261EC7650028A248 /* hb-ot-shape-complex-default.cc in Sources */, + 61047EB12B48AD0F00868128 /* hb-ot-shaper-vowel-constraints.cc in Sources */, F384BBEB261EC0DE0028A248 /* ftfstype.c in Sources */, + 61047EAC2B48AD0F00868128 /* hb-ot-shaper-indic.cc in Sources */, F384BC7C261EC2180028A248 /* pshinter.c in Sources */, F384BD65261EC7650028A248 /* hb-ot-font.cc in Sources */, + 61047EB52B48AD0F00868128 /* hb-ot-shaper-hebrew.cc in Sources */, F384BBC7261EC0DE0028A248 /* ftbitmap.c in Sources */, F384BCA8261EC2770028A248 /* smooth.c in Sources */, - F384BD47261EC7650028A248 /* hb-ot-shape-complex-hebrew.cc in Sources */, F384BBA9261EC0DE0028A248 /* ftbbox.c in Sources */, F384BE48261EC9470028A248 /* hb-fallback-shape.cc in Sources */, F384BBA3261EC0DE0028A248 /* ftdebug.c in Sources */, + 61047EB72B48AD0F00868128 /* hb-ot-shaper-default.cc in Sources */, F384BDB9261EC7650028A248 /* hb-unicode.cc in Sources */, F384BC66261EC1F30028A248 /* pfr.c in Sources */, - F384BDA1261EC7650028A248 /* hb-ot-shape-complex-indic.cc in Sources */, F384BC19261EC1440028A248 /* ftbzip2.c in Sources */, F384BCF2261EC5130028A248 /* ftcache.c in Sources */, ); @@ -735,7 +779,7 @@ /* Begin PBXTargetDependency section */ F3E1F82D2A79405A00AC76D3 /* PBXTargetDependency */ = { isa = PBXTargetDependency; - target = F3016F68296F9E9F00C730E5 /* SDL3_ttf.xcFramework */; + target = F3016F68296F9E9F00C730E5 /* SDL3_ttf.xcframework */; targetProxy = F3E1F82C2A79405A00AC76D3 /* PBXContainerItemProxy */; }; /* End PBXTargetDependency section */ @@ -898,7 +942,7 @@ defaultConfigurationIsVisible = 0; defaultConfigurationName = Debug; }; - F3016F69296F9E9F00C730E5 /* Build configuration list for PBXAggregateTarget "SDL3_ttf.xcFramework" */ = { + F3016F69296F9E9F00C730E5 /* Build configuration list for PBXAggregateTarget "SDL3_ttf.xcframework" */ = { isa = XCConfigurationList; buildConfigurations = ( F3016F6A296F9E9F00C730E5 /* Debug */, diff --git a/build-scripts/test-versioning.sh b/build-scripts/test-versioning.sh index b2ecb8bd..58b9d816 100755 --- a/build-scripts/test-versioning.sh +++ b/build-scripts/test-versioning.sh @@ -41,7 +41,7 @@ else not_ok "CMakeLists.txt $version disagrees with SDL_ttf.h $ref_version" fi -for rcfile in src/version.rc VisualC/Version.rc; do +for rcfile in src/version.rc; do tuple=$(sed -ne 's/^ *FILEVERSION *//p' "$rcfile" | tr -d '\r') ref_tuple="${ref_major},${ref_minor},${ref_micro},0" diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl index bb09faa8..c2bb8edb 100755 --- a/build-scripts/wikiheaders.pl +++ b/build-scripts/wikiheaders.pl @@ -31,6 +31,7 @@ my $wikipreamble = undef; my $changeformat = undef; my $manpath = undef; +my $gitrev = undef; foreach (@ARGV) { $warn_about_missing = 1, next if $_ eq '--warn-about-missing'; @@ -47,6 +48,9 @@ } elsif (/\A--manpath=(.*)\Z/) { $manpath = $1; next; + } elsif (/\A--rev=(.*)\Z/) { + $gitrev = $1; + next; } $srcpath = $_, next if not defined $srcpath; $wikipath = $_, next if not defined $wikipath; @@ -788,6 +792,45 @@ sub usage { } closedir(DH); +delete $wikifuncs{"Undocumented"}; + +{ + my $path = "$wikipath/Undocumented.md"; + open(FH, '>', $path) or die("Can't open '$path': $!\n"); + + print FH "# Undocumented\n\n"; + + print FH "## Functions defined in the headers, but not in the wiki\n\n"; + my $header_only_func = 0; + foreach (sort keys %headerfuncs) { + my $fn = $_; + if (not defined $wikifuncs{$fn}) { + print FH "- [$fn]($fn)\n"; + $header_only_func = 1; + } + } + if (!$header_only_func) { + print FH "(none)\n"; + } + print FH "\n"; + + print FH "## Functions defined in the wiki, but not in the headers\n\n"; + + my $wiki_only_func = 0; + foreach (sort keys %wikifuncs) { + my $fn = $_; + if (not defined $headerfuncs{$fn}) { + print FH "- [$fn]($fn)\n"; + $wiki_only_func = 1; + } + } + if (!$wiki_only_func) { + print FH "(none)\n"; + } + print FH "\n"; + + close(FH); +} if ($warn_about_missing) { foreach (keys %wikifuncs) { @@ -1437,8 +1480,10 @@ sub usage { close(FH); } - my $gitrev = `cd "$srcpath" ; git rev-list HEAD~..`; - chomp($gitrev); + if (!$gitrev) { + $gitrev = `cd "$srcpath" ; git rev-list HEAD~..`; + chomp($gitrev); + } # !!! FIXME open(FH, '<', "$srcpath/$versionfname") or die("Can't open '$srcpath/$versionfname': $!\n"); diff --git a/cmake/GetGitRevisionDescription.cmake b/cmake/GetGitRevisionDescription.cmake new file mode 100644 index 00000000..a08895c6 --- /dev/null +++ b/cmake/GetGitRevisionDescription.cmake @@ -0,0 +1,284 @@ +# - Returns a version string from Git +# +# These functions force a re-configure on each git commit so that you can +# trust the values of the variables in your build system. +# +# get_git_head_revision( [ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR]) +# +# Returns the refspec and sha hash of the current head revision +# +# git_describe( [ ...]) +# +# Returns the results of git describe on the source tree, and adjusting +# the output so that it tests false if an error occurs. +# +# git_describe_working_tree( [ ...]) +# +# Returns the results of git describe on the working tree (--dirty option), +# and adjusting the output so that it tests false if an error occurs. +# +# git_get_exact_tag( [ ...]) +# +# Returns the results of git describe --exact-match on the source tree, +# and adjusting the output so that it tests false if there was no exact +# matching tag. +# +# git_local_changes() +# +# Returns either "CLEAN" or "DIRTY" with respect to uncommitted changes. +# Uses the return code of "git diff-index --quiet HEAD --". +# Does not regard untracked files. +# +# Requires CMake 2.6 or newer (uses the 'function' command) +# +# Original Author: +# 2009-2020 Ryan Pavlik +# http://academic.cleardefinition.com +# +# Copyright 2009-2013, Iowa State University. +# Copyright 2013-2020, Ryan Pavlik +# Copyright 2013-2020, Contributors +# SPDX-License-Identifier: BSL-1.0 +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +if(__get_git_revision_description) + return() +endif() +set(__get_git_revision_description YES) + +# We must run the following at "include" time, not at function call time, +# to find the path to this module rather than the path to a calling list file +get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) + +# Function _git_find_closest_git_dir finds the next closest .git directory +# that is part of any directory in the path defined by _start_dir. +# The result is returned in the parent scope variable whose name is passed +# as variable _git_dir_var. If no .git directory can be found, the +# function returns an empty string via _git_dir_var. +# +# Example: Given a path C:/bla/foo/bar and assuming C:/bla/.git exists and +# neither foo nor bar contain a file/directory .git. This will return +# C:/bla/.git +# +function(_git_find_closest_git_dir _start_dir _git_dir_var) + set(cur_dir "${_start_dir}") + set(git_dir "${_start_dir}/.git") + while(NOT EXISTS "${git_dir}") + # .git dir not found, search parent directories + set(git_previous_parent "${cur_dir}") + get_filename_component(cur_dir "${cur_dir}" DIRECTORY) + if(cur_dir STREQUAL git_previous_parent) + # We have reached the root directory, we are not in git + set(${_git_dir_var} + "" + PARENT_SCOPE) + return() + endif() + set(git_dir "${cur_dir}/.git") + endwhile() + set(${_git_dir_var} + "${git_dir}" + PARENT_SCOPE) +endfunction() + +function(get_git_head_revision _refspecvar _hashvar) + _git_find_closest_git_dir("${CMAKE_CURRENT_SOURCE_DIR}" GIT_DIR) + + if("${ARGN}" STREQUAL "ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR") + set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR TRUE) + else() + set(ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR FALSE) + endif() + if(NOT "${GIT_DIR}" STREQUAL "") + file(RELATIVE_PATH _relative_to_source_dir "${CMAKE_SOURCE_DIR}" + "${GIT_DIR}") + if("${_relative_to_source_dir}" MATCHES "[.][.]" AND NOT ALLOW_LOOKING_ABOVE_CMAKE_SOURCE_DIR) + # We've gone above the CMake root dir. + set(GIT_DIR "") + endif() + endif() + if("${GIT_DIR}" STREQUAL "") + set(${_refspecvar} + "GITDIR-NOTFOUND" + PARENT_SCOPE) + set(${_hashvar} + "GITDIR-NOTFOUND" + PARENT_SCOPE) + return() + endif() + + # Check if the current source dir is a git submodule or a worktree. + # In both cases .git is a file instead of a directory. + # + if(NOT IS_DIRECTORY ${GIT_DIR}) + # The following git command will return a non empty string that + # points to the super project working tree if the current + # source dir is inside a git submodule. + # Otherwise the command will return an empty string. + # + execute_process( + COMMAND "${GIT_EXECUTABLE}" rev-parse + --show-superproject-working-tree + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + OUTPUT_VARIABLE out + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT "${out}" STREQUAL "") + # If out is empty, GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a submodule + file(READ ${GIT_DIR} submodule) + string(REGEX REPLACE "gitdir: (.*)$" "\\1" GIT_DIR_RELATIVE + ${submodule}) + string(STRIP ${GIT_DIR_RELATIVE} GIT_DIR_RELATIVE) + get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) + get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} + ABSOLUTE) + set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD") + else() + # GIT_DIR/CMAKE_CURRENT_SOURCE_DIR is in a worktree + file(READ ${GIT_DIR} worktree_ref) + # The .git directory contains a path to the worktree information directory + # inside the parent git repo of the worktree. + # + string(REGEX REPLACE "gitdir: (.*)$" "\\1" git_worktree_dir + ${worktree_ref}) + string(STRIP ${git_worktree_dir} git_worktree_dir) + _git_find_closest_git_dir("${git_worktree_dir}" GIT_DIR) + set(HEAD_SOURCE_FILE "${git_worktree_dir}/HEAD") + endif() + else() + set(HEAD_SOURCE_FILE "${GIT_DIR}/HEAD") + endif() + set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") + if(NOT EXISTS "${GIT_DATA}") + file(MAKE_DIRECTORY "${GIT_DATA}") + endif() + + if(NOT EXISTS "${HEAD_SOURCE_FILE}") + return() + endif() + set(HEAD_FILE "${GIT_DATA}/HEAD") + configure_file("${HEAD_SOURCE_FILE}" "${HEAD_FILE}" COPYONLY) + + configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" + "${GIT_DATA}/grabRef.cmake" @ONLY) + include("${GIT_DATA}/grabRef.cmake") + + set(${_refspecvar} + "${HEAD_REF}" + PARENT_SCOPE) + set(${_hashvar} + "${HEAD_HASH}" + PARENT_SCOPE) +endfunction() + +function(git_describe _var) + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + get_git_head_revision(refspec hash) + if(NOT GIT_FOUND) + set(${_var} + "GIT-NOTFOUND" + PARENT_SCOPE) + return() + endif() + if(NOT hash) + set(${_var} + "HEAD-HASH-NOTFOUND" + PARENT_SCOPE) + return() + endif() + + # TODO sanitize + #if((${ARGN}" MATCHES "&&") OR + # (ARGN MATCHES "||") OR + # (ARGN MATCHES "\\;")) + # message("Please report the following error to the project!") + # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") + #endif() + + #message(STATUS "Arguments to execute_process: ${ARGN}") + + execute_process( + COMMAND "${GIT_EXECUTABLE}" describe --tags --always ${hash} ${ARGN} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + RESULT_VARIABLE res + OUTPUT_VARIABLE out + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT res EQUAL 0) + set(out "${out}-${res}-NOTFOUND") + endif() + + set(${_var} + "${out}" + PARENT_SCOPE) +endfunction() + +function(git_describe_working_tree _var) + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + if(NOT GIT_FOUND) + set(${_var} + "GIT-NOTFOUND" + PARENT_SCOPE) + return() + endif() + + execute_process( + COMMAND "${GIT_EXECUTABLE}" describe --dirty ${ARGN} + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + RESULT_VARIABLE res + OUTPUT_VARIABLE out + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT res EQUAL 0) + set(out "${out}-${res}-NOTFOUND") + endif() + + set(${_var} + "${out}" + PARENT_SCOPE) +endfunction() + +function(git_get_exact_tag _var) + git_describe(out --exact-match ${ARGN}) + set(${_var} + "${out}" + PARENT_SCOPE) +endfunction() + +function(git_local_changes _var) + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + get_git_head_revision(refspec hash) + if(NOT GIT_FOUND) + set(${_var} + "GIT-NOTFOUND" + PARENT_SCOPE) + return() + endif() + if(NOT hash) + set(${_var} + "HEAD-HASH-NOTFOUND" + PARENT_SCOPE) + return() + endif() + + execute_process( + COMMAND "${GIT_EXECUTABLE}" diff-index --quiet HEAD -- + WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" + RESULT_VARIABLE res + OUTPUT_VARIABLE out + ERROR_QUIET OUTPUT_STRIP_TRAILING_WHITESPACE) + if(res EQUAL 0) + set(${_var} + "CLEAN" + PARENT_SCOPE) + else() + set(${_var} + "DIRTY" + PARENT_SCOPE) + endif() +endfunction() diff --git a/cmake/GetGitRevisionDescription.cmake.in b/cmake/GetGitRevisionDescription.cmake.in new file mode 100644 index 00000000..116efc4e --- /dev/null +++ b/cmake/GetGitRevisionDescription.cmake.in @@ -0,0 +1,43 @@ +# +# Internal file for GetGitRevisionDescription.cmake +# +# Requires CMake 2.6 or newer (uses the 'function' command) +# +# Original Author: +# 2009-2010 Ryan Pavlik +# http://academic.cleardefinition.com +# Iowa State University HCI Graduate Program/VRAC +# +# Copyright 2009-2012, Iowa State University +# Copyright 2011-2015, Contributors +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) +# SPDX-License-Identifier: BSL-1.0 + +set(HEAD_HASH) + +file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) + +string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) +if(HEAD_CONTENTS MATCHES "ref") + # named branch + string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") + if(EXISTS "@GIT_DIR@/${HEAD_REF}") + configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) + else() + configure_file("@GIT_DIR@/packed-refs" "@GIT_DATA@/packed-refs" COPYONLY) + file(READ "@GIT_DATA@/packed-refs" PACKED_REFS) + if(${PACKED_REFS} MATCHES "([0-9a-z]*) ${HEAD_REF}") + set(HEAD_HASH "${CMAKE_MATCH_1}") + endif() + endif() +else() + # detached HEAD + configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) +endif() + +if(NOT HEAD_HASH) + file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) + string(STRIP "${HEAD_HASH}" HEAD_HASH) +endif() diff --git a/cmake/PrivateSdlFunctions.cmake b/cmake/PrivateSdlFunctions.cmake index b94039ca..47d820d0 100644 --- a/cmake/PrivateSdlFunctions.cmake +++ b/cmake/PrivateSdlFunctions.cmake @@ -1,6 +1,8 @@ # This file is shared amongst SDL_image/SDL_mixer/SDL_ttf include(CheckCCompilerFlag) +include(CheckCSourceCompiles) +include(CMakePushCheckState) macro(sdl_calculate_derived_version_variables MAJOR MINOR MICRO) set(SO_VERSION_MAJOR "0") @@ -28,23 +30,24 @@ endmacro() function(read_absolute_symlink DEST PATH) file(READ_SYMLINK "${PATH}" p) - if (NOT IS_ABSOLUTE p) + if(NOT IS_ABSOLUTE "${p}") get_filename_component(pdir "${PATH}" DIRECTORY) set(p "${pdir}/${p}") endif() + get_filename_component(p "${p}" ABSOLUTE) set("${DEST}" "${p}" PARENT_SCOPE) endfunction() function(win32_implib_identify_dll DEST IMPLIB) cmake_parse_arguments(ARGS "NOTFATAL" "" "" ${ARGN}) - if (CMAKE_DLLTOOL) + if(CMAKE_DLLTOOL) execute_process( COMMAND "${CMAKE_DLLTOOL}" --identify "${IMPLIB}" RESULT_VARIABLE retcode OUTPUT_VARIABLE stdout ERROR_VARIABLE stderr) - if (NOT retcode EQUAL 0) - if (NOT ARGS_NOTFATAL) + if(NOT retcode EQUAL 0) + if(NOT ARGS_NOTFATAL) message(FATAL_ERROR "${CMAKE_DLLTOOL} failed.") else() set("${DEST}" "${DEST}-NOTFOUND" PARENT_SCOPE) @@ -53,17 +56,17 @@ function(win32_implib_identify_dll DEST IMPLIB) endif() string(STRIP "${stdout}" result) set(${DEST} "${result}" PARENT_SCOPE) - elseif (MSVC) + elseif(MSVC) get_filename_component(CMAKE_C_COMPILER_DIRECTORY "${CMAKE_C_COMPILER}" DIRECTORY CACHE) find_program(CMAKE_DUMPBIN NAMES dumpbin PATHS "${CMAKE_C_COMPILER_DIRECTORY}") - if (CMAKE_DUMPBIN) + if(CMAKE_DUMPBIN) execute_process( COMMAND "${CMAKE_DUMPBIN}" "-headers" "${IMPLIB}" RESULT_VARIABLE retcode OUTPUT_VARIABLE stdout ERROR_VARIABLE stderr) - if (NOT retcode EQUAL 0) - if (NOT ARGS_NOTFATAL) + if(NOT retcode EQUAL 0) + if(NOT ARGS_NOTFATAL) message(FATAL_ERROR "dumpbin failed.") else() set(${DEST} "${DEST}-NOTFOUND" PARENT_SCOPE) @@ -71,8 +74,8 @@ function(win32_implib_identify_dll DEST IMPLIB) endif() endif() string(REGEX MATCH "DLL name[ ]+:[ ]+([^\n]+)\n" match "${stdout}") - if (NOT match) - if (NOT ARGS_NOTFATAL) + if(NOT match) + if(NOT ARGS_NOTFATAL) message(FATAL_ERROR "dumpbin did not find any associated dll for ${IMPLIB}.") else() set(${DEST} "${DEST}-NOTFOUND" PARENT_SCOPE) @@ -85,7 +88,7 @@ function(win32_implib_identify_dll DEST IMPLIB) message(FATAL_ERROR "Cannot find dumpbin, please set CMAKE_DUMPBIN cmake variable") endif() else() - if (NOT ARGS_NOTFATAL) + if(NOT ARGS_NOTFATAL) message(FATAL_ERROR "Don't know how to identify dll from import library. Set CMAKE_DLLTOOL (for mingw) or CMAKE_DUMPBIN (for MSVC)") else() set(${DEST} "${DEST}-NOTFOUND") @@ -96,25 +99,27 @@ endfunction() function(get_actual_target) set(dst "${ARGV0}") set(target "${${dst}}") + set(input "${target}") get_target_property(alias "${target}" ALIASED_TARGET) while(alias) set(target "${alias}") get_target_property(alias "${target}" ALIASED_TARGET) endwhile() + message(DEBUG "get_actual_target(\"${input}\") -> \"${target}\"") set("${dst}" "${target}" PARENT_SCOPE) endfunction() function(target_get_dynamic_library DEST TARGET) set(result) get_actual_target(TARGET) - if (WIN32) + if(WIN32) # Use the target dll of the import library set(props_to_check IMPORTED_IMPLIB) - if (CMAKE_BUILD_TYPE) + if(CMAKE_BUILD_TYPE) list(APPEND props_to_check IMPORTED_IMPLIB_${CMAKE_BUILD_TYPE}) endif() list(APPEND props_to_check IMPORTED_LOCATION) - if (CMAKE_BUILD_TYPE) + if(CMAKE_BUILD_TYPE) list(APPEND props_to_check IMPORTED_LOCATION_${CMAKE_BUILD_TYPE}) endif() foreach (config_type ${CMAKE_CONFIGURATION_TYPES} RELEASE DEBUG RELWITHDEBINFO MINSIZEREL) @@ -123,9 +128,9 @@ function(target_get_dynamic_library DEST TARGET) endforeach() foreach(prop_to_check ${props_to_check}) - if (NOT result) + if(NOT result) get_target_property(propvalue "${TARGET}" ${prop_to_check}) - if (propvalue AND EXISTS "${propvalue}") + if(propvalue AND EXISTS "${propvalue}") win32_implib_identify_dll(result "${propvalue}" NOTFATAL) endif() endif() @@ -133,37 +138,49 @@ function(target_get_dynamic_library DEST TARGET) else() # 1. find the target library a file might be symbolic linking to # 2. find all other files in the same folder that symolic link to it - # 3. sort all these files, and select the 2nd item + # 3. sort all these files, and select the 1st item on Linux, and last on Macos set(location_properties IMPORTED_LOCATION) - if (CMAKE_BUILD_TYPE) + if(CMAKE_BUILD_TYPE) list(APPEND location_properties IMPORTED_LOCATION_${CMAKE_BUILD_TYPE}) endif() foreach (config_type ${CMAKE_CONFIGURATION_TYPES} RELEASE DEBUG RELWITHDEBINFO MINSIZEREL) list(APPEND location_properties IMPORTED_LOCATION_${config_type}) endforeach() + if(APPLE) + set(valid_shared_library_regex "\\.[0-9]+\\.dylib$") + else() + set(valid_shared_library_regex "\\.so\\.([0-9.]+)?[0-9]") + endif() foreach(location_property ${location_properties}) - if (NOT result) + if(NOT result) get_target_property(library_path "${TARGET}" ${location_property}) - if (EXISTS "${library_path}") + message(DEBUG "get_target_property(${TARGET} ${location_propert}) -> ${library_path}") + if(EXISTS "${library_path}") + get_filename_component(library_path "${library_path}" ABSOLUTE) while (IS_SYMLINK "${library_path}") read_absolute_symlink(library_path "${library_path}") endwhile() + message(DEBUG "${TARGET} -> ${library_path}") get_filename_component(libdir "${library_path}" DIRECTORY) file(GLOB subfiles "${libdir}/*") set(similar_files "${library_path}") foreach(subfile ${subfiles}) - if (IS_SYMLINK "${subfile}") + if(IS_SYMLINK "${subfile}") read_absolute_symlink(subfile_target "${subfile}") - while (IS_SYMLINK "${subfile_target}") + while(IS_SYMLINK "${subfile_target}") read_absolute_symlink(subfile_target "${subfile_target}") endwhile() - if (subfile_target STREQUAL library_path AND NOT "${subfile}" MATCHES ".*(dylib|so)$") + get_filename_component(subfile_target "${subfile_target}" ABSOLUTE) + if(subfile_target STREQUAL library_path AND subfile MATCHES "${valid_shared_library_regex}") list(APPEND similar_files "${subfile}") endif() endif() endforeach() list(SORT similar_files) - list(LENGTH similar_files eq_length) + message(DEBUG "files that are similar to \"${library_path}\"=${similar_files}") + if(APPLE) + list(REVERSE similar_files) + endif() list(GET similar_files 0 item) get_filename_component(result "${item}" NAME) endif() @@ -194,28 +211,67 @@ function(target_get_dynamic_library DEST TARGET) else() message(WARNING "Unable to extract dynamic library from target=${TARGET}, type=${target_type}.") endif() - set (result "$") + # TARGET_SONAME_FILE is not allowed for DLL target platforms. + if(WIN32) + set(result "$") + else() + set(result "$") + endif() endif() set(${DEST} ${result} PARENT_SCOPE) endfunction() -macro(sdl_check_project_in_subfolder relative_subfolder name vendored_option) - if(NOT EXISTS "${PROJECT_SOURCE_DIR}/${relative_subfolder}/CMakeLists.txt") - message(FATAL_ERROR "No cmake project for ${name} found in ${relative_subfolder}.\n" +function(sdl_check_project_in_subfolder relative_subfolder name vendored_option) + cmake_parse_arguments(ARG "" "FILE" "" ${ARGN}) + if(NOT ARG_FILE) + set(ARG_FILE "CMakeLists.txt") + endif() + if(NOT EXISTS "${PROJECT_SOURCE_DIR}/${relative_subfolder}/${ARG_FILE}") + message(FATAL_ERROR "Could not find ${ARG_FILE} for ${name} in ${relative_subfolder}.\n" "Run the download script in the external folder, or re-configure with -D${vendored_option}=OFF to use system packages.") endif() -endmacro() +endfunction() macro(sdl_check_linker_flag flag var) # FIXME: Use CheckLinkerFlag module once cmake minimum version >= 3.18 - include(CMakePushCheckState) - include(CheckCSourceCompiles) cmake_push_check_state(RESET) set(CMAKE_REQUIRED_LINK_OPTIONS "${flag}") - check_c_source_compiles("int main() { return 0; }" ${var}) + check_c_source_compiles("int main() { return 0; }" ${var} FAIL_REGEX "(unsupported|syntax error|unrecognized option)") cmake_pop_check_state() endmacro() +function(SDL_detect_linker) + if(CMAKE_VERSION VERSION_LESS 3.29) + if(NOT DEFINED SDL_CMAKE_C_COMPILER_LINKER_ID) + execute_process(COMMAND ${CMAKE_LINKER} -v OUTPUT_VARIABLE LINKER_OUTPUT ERROR_VARIABLE LINKER_OUTPUT) + string(REGEX REPLACE "[\r\n]" " " LINKER_OUTPUT "${LINKER_OUTPUT}") + if(LINKER_OUTPUT MATCHES ".*Microsoft.*") + set(linker MSVC) + else() + set(linker GNUlike) + endif() + message(STATUS "Linker identification: ${linker}") + set(SDL_CMAKE_C_COMPILER_LINKER_ID "${linker}" CACHE STRING "Linker identification") + mark_as_advanced(SDL_CMAKE_C_COMPILER_LINKER_ID) + endif() + set(CMAKE_C_COMPILER_LINKER_ID "${SDL_CMAKE_C_COMPILER_LINKER_ID}" PARENT_SCOPE) + endif() +endfunction() + +function(check_linker_support_version_script VAR) + SDL_detect_linker() + if(CMAKE_C_COMPILER_LINKER_ID MATCHES "^(MSVC)$") + set(LINKER_SUPPORTS_VERSION_SCRIPT FALSE) + else() + cmake_push_check_state(RESET) + file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/dummy.sym" "n_0 {\n global:\n func;\n local: *;\n};\n") + list(APPEND CMAKE_REQUIRED_LINK_OPTIONS "-Wl,--version-script=${CMAKE_CURRENT_BINARY_DIR}/dummy.sym") + check_c_source_compiles("int func(void) {return 0;} int main(int argc,char*argv[]){(void)argc;(void)argv;return func();}" LINKER_SUPPORTS_VERSION_SCRIPT FAIL_REGEX "(unsupported|syntax error|unrecognized option)") + cmake_pop_check_state() + endif() + set(${VAR} "${LINKER_SUPPORTS_VERSION_SCRIPT}" PARENT_SCOPE) +endfunction() + function(sdl_target_link_options_no_undefined TARGET) if(NOT MSVC) if(CMAKE_C_COMPILER_ID MATCHES "AppleClang") @@ -230,7 +286,7 @@ function(sdl_target_link_options_no_undefined TARGET) endfunction() function(sdl_target_link_option_version_file TARGET VERSION_SCRIPT) - sdl_check_linker_flag("-Wl,--version-script=${VERSION_SCRIPT}" HAVE_WL_VERSION_SCRIPT) + check_linker_support_version_script(HAVE_WL_VERSION_SCRIPT) if(HAVE_WL_VERSION_SCRIPT) target_link_options(${TARGET} PRIVATE "-Wl,--version-script=${VERSION_SCRIPT}") else() @@ -258,7 +314,27 @@ endfunction() function(sdl_no_deprecated_errors TARGET) check_c_compiler_flag(-Wno-error=deprecated-declarations HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS) - if(HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS) - target_compile_options(${TARGET} PRIVATE "-Wno-error=deprecated-declarations") + if(HAVE_WNO_ERROR_DEPRECATED_DECLARATIONS) + target_compile_options(${TARGET} PRIVATE "-Wno-error=deprecated-declarations") +endif() +endfunction() + +function(sdl_get_git_revision_hash VARNAME) + set("${VARNAME}" "" CACHE STRING "${PROJECT_NAME} revision") + set(revision "${${VARNAME}}") + if(NOT revision) + if(EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt") + # If VERSION.txt exists, it contains the SDL version + file(READ "${CMAKE_CURRENT_SOURCE_DIR}/VERSION.txt" revision_version) + string(STRIP "${revision_version}" revision_version) + else() + # If VERSION.txt does not exist, use git to calculate a version + git_describe(revision_version) + if(NOT revision_version) + set(revision_version "${PROJECT_VERSION}-no-vcs") + endif() + endif() + set(revision "${revision_version}") endif() + set("${VARNAME}" "${revision}" PARENT_SCOPE) endfunction() diff --git a/cmake/sdl3-ttf.pc.in b/cmake/sdl3-ttf.pc.in index c725e390..f467bfd8 100644 --- a/cmake/sdl3-ttf.pc.in +++ b/cmake/sdl3-ttf.pc.in @@ -10,4 +10,4 @@ Requires: sdl3 >= @SDL_REQUIRED_VERSION@ Libs: -L${libdir} -lSDL3_ttf Requires.private: @PC_REQUIRES@ Libs.private: @PC_LIBS@ -Cflags: -I${includedir} -I${includedir}/SDL3_ttf +Cflags: -I${includedir} diff --git a/cmake/sdlmanpages.cmake b/cmake/sdlmanpages.cmake index f7691285..dc3ebb6b 100644 --- a/cmake/sdlmanpages.cmake +++ b/cmake/sdlmanpages.cmake @@ -2,7 +2,9 @@ include(CMakeParseArguments) include(GNUInstallDirs) function(SDL_generate_manpages) - cmake_parse_arguments(ARG "" "RESULT_VARIABLE;NAME;BUILD_DOCDIR;HEADERS_DIR;SOURCE_DIR;SYMBOL;OPTION_FILE;WIKIHEADERS_PL_PATH" "" ${ARGN}) + cmake_parse_arguments(ARG "" "RESULT_VARIABLE;NAME;BUILD_DOCDIR;HEADERS_DIR;SOURCE_DIR;SYMBOL;OPTION_FILE;WIKIHEADERS_PL_PATH;REVISION" "" ${ARGN}) + + set(wikiheaders_extra_args) if(NOT ARG_NAME) set(ARG_NAME "${PROJECT_NAME}") @@ -25,6 +27,10 @@ function(SDL_generate_manpages) message(FATAL_ERROR "Missing required SYMBOL argument") endif() + if(ARG_REVISION) + list(APPEND wikiheaders_extra_args "--rev=${ARG_REVISION}") + endif() + if(NOT ARG_BUILD_DOCDIR) set(ARG_BUILD_DOCDIR "${CMAKE_CURRENT_BINARY_DIR}/docs") endif() @@ -40,13 +46,13 @@ function(SDL_generate_manpages) add_custom_command( OUTPUT "${BUILD_WIKIDIR}/${ARG_SYMBOL}.md" COMMAND "${CMAKE_COMMAND}" -E make_directory "${BUILD_WIKIDIR}" - COMMAND "${PERL_EXECUTABLE}" "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_SOURCE_DIR}" "${BUILD_WIKIDIR}" "--options=${ARG_OPTION_FILE}" --copy-to-wiki + COMMAND "${PERL_EXECUTABLE}" "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_SOURCE_DIR}" "${BUILD_WIKIDIR}" "--options=${ARG_OPTION_FILE}" --copy-to-wiki ${wikiheaders_extra_args} DEPENDS ${HEADER_FILES} "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_OPTION_FILE}" COMMENT "Generating ${ARG_NAME} wiki markdown files" ) add_custom_command( OUTPUT "${BUILD_MANDIR}/man3/${ARG_SYMBOL}.3" - COMMAND "${PERL_EXECUTABLE}" "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_SOURCE_DIR}" "${BUILD_WIKIDIR}" "--options=${ARG_OPTION_FILE}" "--manpath=${BUILD_MANDIR}" --copy-to-manpages + COMMAND "${PERL_EXECUTABLE}" "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_SOURCE_DIR}" "${BUILD_WIKIDIR}" "--options=${ARG_OPTION_FILE}" "--manpath=${BUILD_MANDIR}" --copy-to-manpages ${wikiheaders_extra_args} DEPENDS "${BUILD_WIKIDIR}/${ARG_SYMBOL}.md" "${ARG_WIKIHEADERS_PL_PATH}" "${ARG_OPTION_FILE}" COMMENT "Generating ${ARG_NAME} man pages" ) diff --git a/examples/glfont.c b/examples/glfont.c index 04444c52..88bac8a7 100644 --- a/examples/glfont.c +++ b/examples/glfont.c @@ -1,6 +1,6 @@ /* glfont: An example of using the SDL_ttf library with OpenGL. - Copyright (C) 2001-2023 Sam Lantinga + Copyright (C) 2001-2024 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages diff --git a/examples/showfont.c b/examples/showfont.c index 11fe36b0..7b12f4b4 100644 --- a/examples/showfont.c +++ b/examples/showfont.c @@ -1,6 +1,6 @@ /* showfont: An example of using the SDL_ttf library with 2D graphics. - Copyright (C) 2001-2023 Sam Lantinga + Copyright (C) 2001-2024 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -35,7 +35,7 @@ #define HEIGHT 480 #define TTF_SHOWFONT_USAGE \ -"Usage: %s [-solid] [-shaded] [-blended] [-utf8|-unicode] [-b] [-i] [-u] [-s] [-outline size] [-hintlight|-hintmono|-hintnone] [-nokerning] [-fgcol r,g,b,a] [-bgcol r,g,b,a] .ttf [ptsize] [text]\n" +"Usage: %s [-solid] [-shaded] [-blended] [-wrapped] [-utf8|-unicode] [-b] [-i] [-u] [-s] [-outline size] [-hintlight|-hintmono|-hintnone] [-nokerning] [-wrap] [-fgcol r,g,b,a] [-bgcol r,g,b,a] .ttf [ptsize] [text]\n" typedef enum { @@ -89,6 +89,7 @@ int main(int argc, char *argv[]) int outline; int hinting; int kerning; + int wrap; int dump; enum { RENDER_LATIN1, @@ -155,6 +156,9 @@ int main(int argc, char *argv[]) if (SDL_strcmp(argv[i], "-nokerning") == 0) { kerning = 0; } else + if (SDL_strcmp(argv[i], "-wrap") == 0) { + wrap = 1; + } else if (SDL_strcmp(argv[i], "-dump") == 0) { dump = 1; } else @@ -276,13 +280,25 @@ int main(int argc, char *argv[]) case RENDER_LATIN1: switch (rendermethod) { case TextRenderSolid: - text = TTF_RenderText_Solid(font, message, *forecol); + if (wrap) { + text = TTF_RenderText_Solid_Wrapped(font, message, *forecol, 0); + } else { + text = TTF_RenderText_Solid(font, message, *forecol); + } break; case TextRenderShaded: - text = TTF_RenderText_Shaded(font, message, *forecol, *backcol); + if (wrap) { + text = TTF_RenderText_Shaded_Wrapped(font, message, *forecol, *backcol, 0); + } else { + text = TTF_RenderText_Shaded(font, message, *forecol, *backcol); + } break; case TextRenderBlended: - text = TTF_RenderText_Blended(font, message, *forecol); + if (wrap) { + text = TTF_RenderText_Blended_Wrapped(font, message, *forecol, 0); + } else { + text = TTF_RenderText_Blended(font, message, *forecol); + } break; } break; @@ -290,13 +306,25 @@ int main(int argc, char *argv[]) case RENDER_UTF8: switch (rendermethod) { case TextRenderSolid: - text = TTF_RenderUTF8_Solid(font, message, *forecol); + if (wrap) { + text = TTF_RenderUTF8_Solid_Wrapped(font, message, *forecol, 0); + } else { + text = TTF_RenderUTF8_Solid(font, message, *forecol); + } break; case TextRenderShaded: - text = TTF_RenderUTF8_Shaded(font, message, *forecol, *backcol); + if (wrap) { + text = TTF_RenderUTF8_Shaded_Wrapped(font, message, *forecol, *backcol, 0); + } else { + text = TTF_RenderUTF8_Shaded(font, message, *forecol, *backcol); + } break; case TextRenderBlended: - text = TTF_RenderUTF8_Blended(font, message, *forecol); + if (wrap) { + text = TTF_RenderUTF8_Blended_Wrapped(font, message, *forecol, 0); + } else { + text = TTF_RenderUTF8_Blended(font, message, *forecol); + } break; } break; @@ -306,13 +334,25 @@ int main(int argc, char *argv[]) Uint16 *unicode_text = SDL_iconv_utf8_ucs2(message); switch (rendermethod) { case TextRenderSolid: - text = TTF_RenderUNICODE_Solid(font, unicode_text, *forecol); + if (wrap) { + text = TTF_RenderUNICODE_Solid_Wrapped(font, unicode_text, *forecol, 0); + } else { + text = TTF_RenderUNICODE_Solid(font, unicode_text, *forecol); + } break; case TextRenderShaded: - text = TTF_RenderUNICODE_Shaded(font, unicode_text, *forecol, *backcol); + if (wrap) { + text = TTF_RenderUNICODE_Shaded_Wrapped(font, unicode_text, *forecol, *backcol, 0); + } else { + text = TTF_RenderUNICODE_Shaded(font, unicode_text, *forecol, *backcol); + } break; case TextRenderBlended: - text = TTF_RenderUNICODE_Blended(font, unicode_text, *forecol); + if (wrap) { + text = TTF_RenderUNICODE_Blended_Wrapped(font, unicode_text, *forecol, 0); + } else { + text = TTF_RenderUNICODE_Blended(font, unicode_text, *forecol); + } break; } SDL_free(unicode_text); @@ -337,7 +377,7 @@ int main(int argc, char *argv[]) /* Wait for a keystroke, and blit text on mouse press */ done = 0; while (!done) { - if (SDL_WaitEvent(&event) < 0) { + if (!SDL_WaitEvent(&event)) { SDL_Log("SDL_PullEvent() error: %s\n", SDL_GetError()); done = 1; continue; @@ -368,5 +408,3 @@ int main(int argc, char *argv[]) /* Not reached, but fixes compiler warnings */ return 0; } - -/* vi: set ts=4 sw=4 expandtab: */ diff --git a/examples/testapp.c b/examples/testapp.c index 1942efa5..40e61a85 100644 --- a/examples/testapp.c +++ b/examples/testapp.c @@ -1,6 +1,6 @@ /* testapp: An example of using the SDL_ttf library with OpenGL. - Copyright (C) 2001-2023 Sam Lantinga + Copyright (C) 2001-2024 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -337,8 +337,6 @@ static const char *test_strings[] = { "hvlSZ6jE2BU9ImjUjQiY255GA5ASfUUx", "e9o4tBCA9TCpilOI05UyHzes6s8lP9lQ", "gJyC26gZsCKR8wSp9kNMYKJRRgA3u45U1DWdzPCWv1SUEKi3Wdo3zNFTWiMcCfcl5A0MzOhbqRee7OP13NruY WP0ufGiB4W9RBWqgSy7umnE6puTyCc9WhPOzdLz168BhQwYetZkADWibObi8jcYajuUv54zxXkXQwC1B8lAi8rIH9lmIy0G10fQ832HKiLx" - - }; static const int test_strings_count = SDL_arraysize(test_strings); static const char *font_path = NULL; @@ -361,7 +359,7 @@ static int wait_for_input(void) SDL_Event event; while (!done) { - if (SDL_WaitEvent(&event) < 0) { + if (!SDL_WaitEvent(&event)) { quit("Event handling"); } @@ -656,8 +654,6 @@ int main(void) T_min = SDL_min(T_min, T2 - T1); \ - - if (SDL_Init(SDL_INIT_VIDEO) < 0) { quit("SDL init failed"); } @@ -716,20 +712,12 @@ int main(void) //seed=1673390190; replay=1; font_style=9; kerning=1; sdf=0; wrap=1; wrap_size=94; w_align=2; outline=7; curr_size=42; render_mode=1; curr_str=75; curr_font=1997; hinting=1; fg_alpha=90; // light Blended - - - - - - if (replay) { SDL_Log("Replay with string _%s_", test_strings[curr_str]); } - while (1) { - /* Normal mode , try all combination {strings}x{render_mode} and exit This updates "render_mode" and "curr_str" */ if (!mode_random_test && !replay) { @@ -818,8 +806,6 @@ int main(void) } TTF_SetFontDirection(font, directions[direction].value); - // TTF_SetScript(HB_SCRIPT_ARABIC); - // TTF_SetScript(HB_SCRIPT_HAN); { int tmp; @@ -842,8 +828,6 @@ int main(void) } #endif - - { // static const char *hinting_desc[] = { "normal", "light", "light_subpix", "mono", "none" }; // static const char *hinting_desc[] = { "normal", "light", "light_subpix", "lcd_subpix", "mono", "none" }; @@ -951,8 +935,6 @@ int main(void) SDL_Log("font_style=%d; kerning=%d; wrap=%d; wrap_size=%d; outline=%d; curr_size=%d; render_mode=%d; curr_str=%d; curr_font=%d; hinting=%d;", font_style, kerning, wrap, wrap_size, outline, curr_size, render_mode, curr_str, curr_font, hinting); #endif - - } /* pick a string */ @@ -1128,7 +1110,6 @@ int main(void) SDL_RenderClear(renderer); - text_texture = SDL_CreateTextureFromSurface(renderer, text_surface); if (text_texture == NULL) { SDL_Log("Cannot create texture from surface(w=%d h=%d): %s", text_surface->w, text_surface->h, SDL_GetError()); @@ -1336,4 +1317,3 @@ static void random_input(void) return; } - diff --git a/external/Get-GitModules.ps1 b/external/Get-GitModules.ps1 new file mode 100644 index 00000000..c43f6375 --- /dev/null +++ b/external/Get-GitModules.ps1 @@ -0,0 +1,36 @@ +<# + .SYNOPSIS + Downloads the Git modules specified in ../.gitmodules + + .DESCRIPTION + Parses and downloads the Github repositories specified in the .gitmodules file + + .EXAMPLE + PS> .\Get-GitModules.ps1 + < Downloads and parses the repositories in the .gitmodules file. > +#> + +#------- Variables ------------------------------------------------------------- +[String] $PathRegex = "path\s*=\s*(?.*)" +[String] $URLRegex = "url\s*=\s*(?.*)" +[String] $BranchRegex = "branch\s*=\s*(?.*)" + +#------- Script ---------------------------------------------------------------- +foreach ($Line in Get-Content $PSScriptRoot\..\.gitmodules) { + if ($Line -match $PathRegex) { + $Match = Select-String -InputObject $Line -Pattern $PathRegex + $Path = $Match.Matches[0].Groups[1].Value + } + elseif ($Line -match $URLRegex) { + $Match = Select-String -InputObject $Line -Pattern $URLRegex + $URL = $Match.Matches[0].Groups[1].Value + } + elseif ($Line -match $BranchRegex) { + $Match = Select-String -InputObject $Line -Pattern $BranchRegex + $Branch = $Match.Matches[0].Groups[1].Value + + Write-Host "git clone $URL $Path -b $Branch --recursive" ` + -ForegroundColor Blue + git clone $URL $PSScriptRoot/../$Path -b $Branch --recursive + } +} diff --git a/external/harfbuzz b/external/harfbuzz index 43931e3e..516b7ed0 160000 --- a/external/harfbuzz +++ b/external/harfbuzz @@ -1 +1 @@ -Subproject commit 43931e3e596c04044861770b831c8f9452e2d3b0 +Subproject commit 516b7ed0b022ab0ffeb0cee87d31d9c40d3a54df diff --git a/include/SDL3_ttf/SDL_ttf.h b/include/SDL3_ttf/SDL_ttf.h index 97e14014..89b0b45b 100644 --- a/include/SDL3_ttf/SDL_ttf.h +++ b/include/SDL3_ttf/SDL_ttf.h @@ -1,6 +1,6 @@ /* SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts - Copyright (C) 2001-2023 Sam Lantinga + Copyright (C) 2001-2024 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -70,20 +70,6 @@ extern "C" { #define TTF_PATCHLEVEL SDL_TTF_PATCHLEVEL #define TTF_VERSION(X) SDL_TTF_VERSION(X) -#if SDL_TTF_MAJOR_VERSION < 3 && SDL_MAJOR_VERSION < 3 -/** - * This is the version number macro for the current SDL_ttf version. - * - * In versions higher than 2.9.0, the minor version overflows into - * the thousands digit: for example, 2.23.0 is encoded as 4300. - * This macro will not be available in SDL 3.x or SDL_ttf 3.x. - * - * \deprecated, use SDL_TTF_VERSION_ATLEAST or SDL_TTF_VERSION instead. - */ -#define SDL_TTF_COMPILEDVERSION \ - SDL_VERSIONNUM(SDL_TTF_MAJOR_VERSION, SDL_TTF_MINOR_VERSION, SDL_TTF_PATCHLEVEL) -#endif /* SDL_TTF_MAJOR_VERSION < 3 && SDL_MAJOR_VERSION < 3 */ - /** * This macro will evaluate to true if compiled with SDL_ttf at least X.Y.Z. */ @@ -92,11 +78,6 @@ extern "C" { (SDL_TTF_MAJOR_VERSION > X || SDL_TTF_MINOR_VERSION >= Y) && \ (SDL_TTF_MAJOR_VERSION > X || SDL_TTF_MINOR_VERSION > Y || SDL_TTF_PATCHLEVEL >= Z)) -/* Make sure this is defined (only available in newer SDL versions) */ -#ifndef SDL_DEPRECATED -#define SDL_DEPRECATED -#endif - /** * Query the version of SDL_ttf that the program is linked against. * @@ -108,7 +89,7 @@ extern "C" { * * \returns a pointer to the version information. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC const SDL_version * SDLCALL TTF_Linked_Version(void); @@ -121,7 +102,7 @@ extern DECLSPEC const SDL_version * SDLCALL TTF_Linked_Version(void); * \param minor to be filled in with the minor version number. Can be NULL. * \param patch to be filled in with the param version number. Can be NULL. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_Init */ @@ -136,7 +117,7 @@ extern DECLSPEC void SDLCALL TTF_GetFreeTypeVersion(int *major, int *minor, int * \param minor to be filled in with the minor version number. Can be NULL. * \param patch to be filled in with the param version number. Can be NULL. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC void SDLCALL TTF_GetHarfBuzzVersion(int *major, int *minor, int *patch); @@ -154,7 +135,7 @@ extern DECLSPEC void SDLCALL TTF_GetHarfBuzzVersion(int *major, int *minor, int * * \param swapped boolean to indicate whether text is byteswapped * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC void SDLCALL TTF_ByteSwappedUNICODE(SDL_bool swapped); @@ -179,7 +160,7 @@ typedef struct _TTF_Font TTF_Font; * * \returns 0 on success, -1 on error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_Quit */ @@ -198,7 +179,7 @@ extern DECLSPEC int SDLCALL TTF_Init(void); * \param ptsize point size to use for the newly-opened font. * \returns a valid TTF_Font, or NULL on error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_CloseFont */ @@ -222,7 +203,7 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFont(const char *file, int ptsize); * \param index index of the face in the font file. * \returns a valid TTF_Font, or NULL on error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_CloseFont */ @@ -235,19 +216,19 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndex(const char *file, int ptsiz * size becomes the index of choosing which size. If the value is too high, * the last indexed size will be the default. * - * If `freesrc` is SDL_TRUE, the RWops will be closed before returning, - * whether this function succeeds or not. SDL_ttf reads everything it needs - * from the RWops during this call in any case. + * If `freesrc` is SDL_TRUE, the RWops will be automatically closed once the + * font is closed. Otherwise you should close the RWops yourself after closing + * the font. * * When done with the returned TTF_Font, use TTF_CloseFont() to dispose of it. * * \param src an SDL_RWops to provide a font file's data. - * \param freesrc SDL_TRUE to close the RWops before returning, SDL_FALSE to - * leave it open. + * \param freesrc SDL_TRUE to close the RWops when the font is closed, + * SDL_FALSE to leave it open. * \param ptsize point size to use for the newly-opened font. * \returns a valid TTF_Font, or NULL on error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_CloseFont */ @@ -260,9 +241,9 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontRW(SDL_RWops *src, SDL_bool frees * size becomes the index of choosing which size. If the value is too high, * the last indexed size will be the default. * - * If `freesrc` is SDL_TRUE, the RWops will be closed before returning, - * whether this function succeeds or not. SDL_ttf reads everything it needs - * from the RWops during this call in any case. + * If `freesrc` is SDL_TRUE the RWops will be automatically closed once the + * font is closed. Otherwise you should close the RWops yourself after closing + * the font. * * Some fonts have multiple "faces" included. The index specifies which face * to use from the font file. Font files with only one face should specify @@ -271,13 +252,13 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontRW(SDL_RWops *src, SDL_bool frees * When done with the returned TTF_Font, use TTF_CloseFont() to dispose of it. * * \param src an SDL_RWops to provide a font file's data. - * \param freesrc SDL_TRUE to close the RWops before returning, SDL_FALSE to - * leave it open. + * \param freesrc SDL_TRUE to close the RWops when the font is closed, + * SDL_FALSE to leave it open. * \param ptsize point size to use for the newly-opened font. * \param index index of the face in the font file. * \returns a valid TTF_Font, or NULL on error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_CloseFont */ @@ -300,7 +281,7 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndexRW(SDL_RWops *src, SDL_bool * \param vdpi the target vertical DPI. * \returns a valid TTF_Font, or NULL on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_CloseFont */ @@ -328,7 +309,7 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontDPI(const char *file, int ptsize, * \param vdpi the target vertical DPI. * \returns a valid TTF_Font, or NULL on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_CloseFont */ @@ -343,21 +324,21 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndexDPI(const char *file, int pt * size becomes the index of choosing which size. If the value is too high, * the last indexed size will be the default. * - * If `freesrc` is SDL_TRUE, the RWops will be closed before returning, - * whether this function succeeds or not. SDL_ttf reads everything it needs - * from the RWops during this call in any case. + * If `freesrc` is SDL_TRUE the RWops will be automatically closed once the + * font is closed. Otherwise you should close the RWops yourself after closing + * the font. * * When done with the returned TTF_Font, use TTF_CloseFont() to dispose of it. * * \param src an SDL_RWops to provide a font file's data. - * \param freesrc SDL_TRUE to close the RWops before returning, zero to leave - * it open. + * \param freesrc SDL_TRUE to close the RWops when the font is closed, + * SDL_FALSE to leave it open. * \param ptsize point size to use for the newly-opened font. * \param hdpi the target horizontal DPI. * \param vdpi the target vertical DPI. * \returns a valid TTF_Font, or NULL on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_CloseFont */ @@ -372,9 +353,9 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontDPIRW(SDL_RWops *src, SDL_bool fr * size becomes the index of choosing which size. If the value is too high, * the last indexed size will be the default. * - * If `freesrc` is SDL_TRUE, the RWops will be closed before returning, - * whether this function succeeds or not. SDL_ttf reads everything it needs - * from the RWops during this call in any case. + * If `freesrc` is SDL_TRUE the RWops will be automatically closed once the + * font is closed. Otherwise you should close the RWops yourself after closing + * the font. * * Some fonts have multiple "faces" included. The index specifies which face * to use from the font file. Font files with only one face should specify @@ -383,15 +364,15 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontDPIRW(SDL_RWops *src, SDL_bool fr * When done with the returned TTF_Font, use TTF_CloseFont() to dispose of it. * * \param src an SDL_RWops to provide a font file's data. - * \param freesrc SDL_TRUE to close the RWops before returning, SDL_FALSE to - * leave it open. + * \param freesrc SDL_TRUE to close the RWops when the font is closed, + * SDL_FALSE to leave it open. * \param ptsize point size to use for the newly-opened font. * \param index index of the face in the font file. * \param hdpi the target horizontal DPI. * \param vdpi the target vertical DPI. * \returns a valid TTF_Font, or NULL on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_CloseFont */ @@ -406,7 +387,7 @@ extern DECLSPEC TTF_Font * SDLCALL TTF_OpenFontIndexDPIRW(SDL_RWops *src, SDL_bo * \param ptsize the new point size. * \returns 0 if successful, -1 on error * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_SetFontSize(TTF_Font *font, int ptsize); @@ -421,7 +402,7 @@ extern DECLSPEC int SDLCALL TTF_SetFontSize(TTF_Font *font, int ptsize); * \param vdpi the target vertical DPI. * \returns 0 if successful, -1 on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_SetFontSizeDPI(TTF_Font *font, int ptsize, unsigned int hdpi, unsigned int vdpi); @@ -448,7 +429,7 @@ extern DECLSPEC int SDLCALL TTF_SetFontSizeDPI(TTF_Font *font, int ptsize, unsig * \param font the font to query. * \returns the current font style, as a set of bit flags. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_SetFontStyle */ @@ -470,7 +451,7 @@ extern DECLSPEC int SDLCALL TTF_GetFontStyle(const TTF_Font *font); * \param font the font to set a new style on. * \param style the new style values to set, OR'd together. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_GetFontStyle */ @@ -482,7 +463,7 @@ extern DECLSPEC void SDLCALL TTF_SetFontStyle(TTF_Font *font, int style); * \param font the font to query. * \returns the font's current outline value. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_SetFontOutline */ @@ -494,7 +475,7 @@ extern DECLSPEC int SDLCALL TTF_GetFontOutline(const TTF_Font *font); * \param font the font to set a new outline on. * \param outline positive outline value, 0 to default. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_GetFontOutline */ @@ -519,12 +500,12 @@ extern DECLSPEC void SDLCALL TTF_SetFontOutline(TTF_Font *font, int outline); * - `TTF_HINTING_LIGHT` * - `TTF_HINTING_MONO` * - `TTF_HINTING_NONE` - * - `TTF_HINTING_LIGHT_SUBPIXEL` (available in SDL_ttf 2.0.18 and later) + * - `TTF_HINTING_LIGHT_SUBPIXEL` (available in SDL_ttf 3.0.0 and later) * * \param font the font to query. * \returns the font's current hinter value. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_SetFontHinting */ @@ -541,12 +522,12 @@ extern DECLSPEC int SDLCALL TTF_GetFontHinting(const TTF_Font *font); * - `TTF_HINTING_LIGHT` * - `TTF_HINTING_MONO` * - `TTF_HINTING_NONE` - * - `TTF_HINTING_LIGHT_SUBPIXEL` (available in SDL_ttf 2.0.18 and later) + * - `TTF_HINTING_LIGHT_SUBPIXEL` (available in SDL_ttf 3.0.0 and later) * * \param font the font to set a new hinter setting on. * \param hinting the new hinter setting. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_GetFontHinting */ @@ -571,7 +552,7 @@ extern DECLSPEC void SDLCALL TTF_SetFontHinting(TTF_Font *font, int hinting); * \param font the font to query. * \returns the font's current wrap alignment option. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_SetFontWrappedAlign */ @@ -589,7 +570,7 @@ extern DECLSPEC int SDLCALL TTF_GetFontWrappedAlign(const TTF_Font *font); * \param font the font to set a new wrap alignment option on. * \param align the new wrap alignment option. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_GetFontWrappedAlign */ @@ -603,7 +584,7 @@ extern DECLSPEC void SDLCALL TTF_SetFontWrappedAlign(TTF_Font *font, int align); * \param font the font to query. * \returns the font's height. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_FontHeight(const TTF_Font *font); @@ -615,7 +596,7 @@ extern DECLSPEC int SDLCALL TTF_FontHeight(const TTF_Font *font); * \param font the font to query. * \returns the font's ascent. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_FontAscent(const TTF_Font *font); @@ -627,7 +608,7 @@ extern DECLSPEC int SDLCALL TTF_FontAscent(const TTF_Font *font); * \param font the font to query. * \returns the font's descent. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_FontDescent(const TTF_Font *font); @@ -637,7 +618,7 @@ extern DECLSPEC int SDLCALL TTF_FontDescent(const TTF_Font *font); * \param font the font to query. * \returns the font's recommended spacing. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_FontLineSkip(const TTF_Font *font); @@ -647,7 +628,7 @@ extern DECLSPEC int SDLCALL TTF_FontLineSkip(const TTF_Font *font); * \param font the font to query. * \returns non-zero if kerning is enabled, zero otherwise. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_GetFontKerning(const TTF_Font *font); @@ -662,7 +643,7 @@ extern DECLSPEC int SDLCALL TTF_GetFontKerning(const TTF_Font *font); * \param font the font to set kerning on. * \param allowed non-zero to allow kerning, zero to disallow. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC void SDLCALL TTF_SetFontKerning(TTF_Font *font, int allowed); @@ -672,7 +653,7 @@ extern DECLSPEC void SDLCALL TTF_SetFontKerning(TTF_Font *font, int allowed); * \param font the font to query. * \returns the number of FreeType font faces. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC long SDLCALL TTF_FontFaces(const TTF_Font *font); @@ -688,7 +669,7 @@ extern DECLSPEC long SDLCALL TTF_FontFaces(const TTF_Font *font); * \param font the font to query. * \returns non-zero if fixed-width, zero if not. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_FontFaceIsFixedWidth(const TTF_Font *font); @@ -704,7 +685,7 @@ extern DECLSPEC int SDLCALL TTF_FontFaceIsFixedWidth(const TTF_Font *font); * \param font the font to query. * \returns the font's family name. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC const char * SDLCALL TTF_FontFaceFamilyName(const TTF_Font *font); @@ -720,7 +701,7 @@ extern DECLSPEC const char * SDLCALL TTF_FontFaceFamilyName(const TTF_Font *font * \param font the font to query. * \returns the font's style name. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC const char * SDLCALL TTF_FontFaceStyleName(const TTF_Font *font); @@ -740,7 +721,7 @@ extern DECLSPEC const char * SDLCALL TTF_FontFaceStyleName(const TTF_Font *font) * \param ch the character code to check. * \returns non-zero if font provides a glyph for this character, zero if not. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_GlyphIsProvided32 */ @@ -758,7 +739,7 @@ extern DECLSPEC int SDLCALL TTF_GlyphIsProvided(TTF_Font *font, Uint16 ch); * \param ch the character code to check. * \returns non-zero if font provides a glyph for this character, zero if not. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_GlyphIsProvided32(TTF_Font *font, Uint32 ch); @@ -781,7 +762,7 @@ extern DECLSPEC int SDLCALL TTF_GlyphIsProvided32(TTF_Font *font, Uint32 ch); * \param font the font to query. * \param ch the character code to check. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_GlyphMetrics32 */ @@ -804,7 +785,7 @@ extern DECLSPEC int SDLCALL TTF_GlyphMetrics(TTF_Font *font, Uint16 ch, * \param font the font to query. * \param ch the character code to check. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_GlyphMetrics32(TTF_Font *font, Uint32 ch, int *minx, int *maxx, @@ -829,7 +810,7 @@ extern DECLSPEC int SDLCALL TTF_GlyphMetrics32(TTF_Font *font, Uint32 ch, * \param h will be filled with height, in pixels, on return. * \returns 0 if successful, -1 on error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_SizeUTF8 * \sa TTF_SizeUNICODE @@ -850,7 +831,7 @@ extern DECLSPEC int SDLCALL TTF_SizeText(TTF_Font *font, const char *text, int * * \param h will be filled with height, in pixels, on return. * \returns 0 if successful, -1 on error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_SizeUNICODE */ @@ -875,7 +856,7 @@ extern DECLSPEC int SDLCALL TTF_SizeUTF8(TTF_Font *font, const char *text, int * * \param h will be filled with height, in pixels, on return. * \returns 0 if successful, -1 on error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_SizeUTF8 */ @@ -902,7 +883,7 @@ extern DECLSPEC int SDLCALL TTF_SizeUNICODE(TTF_Font *font, const Uint16 *text, * \param extent on return, filled with latest calculated width. * \returns 0 if successful, -1 on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_MeasureText * \sa TTF_MeasureUTF8 @@ -926,7 +907,7 @@ extern DECLSPEC int SDLCALL TTF_MeasureText(TTF_Font *font, const char *text, in * \param extent on return, filled with latest calculated width. * \returns 0 if successful, -1 on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_MeasureText * \sa TTF_MeasureUTF8 @@ -955,7 +936,7 @@ extern DECLSPEC int SDLCALL TTF_MeasureUTF8(TTF_Font *font, const char *text, in * \param extent on return, filled with latest calculated width. * \returns 0 if successful, -1 on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_MeasureText * \sa TTF_MeasureUTF8 @@ -990,7 +971,7 @@ extern DECLSPEC int SDLCALL TTF_MeasureUNICODE(TTF_Font *font, const Uint16 *tex * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Solid * \sa TTF_RenderUNICODE_Solid @@ -1020,7 +1001,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Solid(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Shaded * \sa TTF_RenderUTF8_Blended @@ -1056,7 +1037,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Solid(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Solid */ @@ -1088,7 +1069,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Solid(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Solid_Wrapped * \sa TTF_RenderUNICODE_Solid_Wrapped @@ -1116,7 +1097,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Solid_Wrapped(TTF_Font *fon * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Shaded_Wrapped * \sa TTF_RenderUTF8_Blended_Wrapped @@ -1151,7 +1132,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Solid_Wrapped(TTF_Font *fon * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Solid_Wrapped */ @@ -1185,7 +1166,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Solid_Wrapped(TTF_Font * * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderGlyph32_Solid */ @@ -1215,7 +1196,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Solid(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderGlyph32_Shaded * \sa TTF_RenderGlyph32_Blended @@ -1253,7 +1234,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph32_Solid(TTF_Font *font, * \param bg the background color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Shaded * \sa TTF_RenderUNICODE_Shaded @@ -1285,7 +1266,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Shaded(TTF_Font *font, * \param bg the background color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUNICODE_Shaded */ @@ -1320,7 +1301,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Shaded(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Shaded */ @@ -1354,7 +1335,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Shaded(TTF_Font *font, * \param bg the background color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Shaded_Wrapped * \sa TTF_RenderUNICODE_Shaded_Wrapped @@ -1383,7 +1364,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Shaded_Wrapped(TTF_Font *fo * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Solid_Wrapped * \sa TTF_RenderUTF8_Blended_Wrapped @@ -1419,7 +1400,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Shaded_Wrapped(TTF_Font *fo * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Shaded_Wrapped */ @@ -1455,7 +1436,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Shaded_Wrapped(TTF_Font * \param bg the background color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderGlyph32_Shaded */ @@ -1486,7 +1467,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Shaded(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 8-bit, palettized surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderGlyph32_Solid * \sa TTF_RenderGlyph32_Blended @@ -1522,7 +1503,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph32_Shaded(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Shaded * \sa TTF_RenderUNICODE_Shaded @@ -1552,7 +1533,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Blended(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUNICODE_Blended */ @@ -1586,7 +1567,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Blended(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Blended */ @@ -1618,7 +1599,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Blended(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Blended_Wrapped * \sa TTF_RenderUNICODE_Blended_Wrapped @@ -1646,7 +1627,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_Blended_Wrapped(TTF_Font *f * \param fg the foreground color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Solid_Wrapped * \sa TTF_RenderUTF8_Shaded_Wrapped @@ -1681,7 +1662,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_Blended_Wrapped(TTF_Font *f * \param fg the foreground color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Blended_Wrapped */ @@ -1715,7 +1696,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_Blended_Wrapped(TTF_Font * \param fg the foreground color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderGlyph32_Blended */ @@ -1745,7 +1726,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_Blended(TTF_Font *font, * \param fg the foreground color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderGlyph32_Solid * \sa TTF_RenderGlyph32_Shaded @@ -1782,7 +1763,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph32_Blended(TTF_Font *font, * \param bg the background color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_LCD * \sa TTF_RenderUNICODE_LCD @@ -1813,7 +1794,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_LCD(TTF_Font *font, * \param bg the background color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUNICODE_LCD */ @@ -1848,7 +1829,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_LCD(TTF_Font *font, * \param bg the background color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_LCD */ @@ -1882,7 +1863,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_LCD(TTF_Font *font, * \param bg the background color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_LCD_Wrapped * \sa TTF_RenderUNICODE_LCD_Wrapped @@ -1912,7 +1893,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderText_LCD_Wrapped(TTF_Font *font, * \param bg the background color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_Solid_Wrapped * \sa TTF_RenderUTF8_Shaded_Wrapped @@ -1949,7 +1930,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUTF8_LCD_Wrapped(TTF_Font *font, * \param bg the background color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderUTF8_LCD_Wrapped */ @@ -1984,7 +1965,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderUNICODE_LCD_Wrapped(TTF_Font *fo * \param bg the background color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderGlyph32_LCD */ @@ -2014,7 +1995,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph_LCD(TTF_Font *font, * \param bg the background color for the text. * \returns a new 32-bit, ARGB surface, or NULL if there was an error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_RenderGlyph32_Solid * \sa TTF_RenderGlyph32_Shaded @@ -2046,7 +2027,7 @@ extern DECLSPEC SDL_Surface * SDLCALL TTF_RenderGlyph32_LCD(TTF_Font *font, * * \param font the font to dispose of. * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_OpenFont * \sa TTF_OpenFontIndexDPIRW @@ -2076,7 +2057,7 @@ extern DECLSPEC void SDLCALL TTF_CloseFont(TTF_Font *font); * deal with it. A well-written program should call TTF_CloseFont() on any * open fonts before calling this function! * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC void SDLCALL TTF_Quit(void); @@ -2095,34 +2076,13 @@ extern DECLSPEC void SDLCALL TTF_Quit(void); * \returns the current number of initialization calls, that need to * eventually be paired with this many calls to TTF_Quit(). * - * \since This function is available since SDL_ttf 2.0.12. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_Init * \sa TTF_Quit */ extern DECLSPEC int SDLCALL TTF_WasInit(void); -/** - * Query the kerning size of two glyphs indices. - * - * \deprecated This function accidentally requires FreeType font indexes, - * not codepoints, which we don't expose through this API, so - * it could give wildly incorrect results, especially with - * non-ASCII values. Going forward, please use - * TTF_GetFontKerningSizeGlyphs() instead, which does what you - * probably expected this function to do. - * - * \param font the font to query. - * \param prev_index the font index, NOT codepoint, of the previous character. - * \param index the font index, NOT codepoint, of the current character. - * \returns The kerning size between the two specified characters, in pixels, or -1 on error. - * - * \since This function is available since SDL_ttf 2.0.12. - * - * \sa TTF_GetFontKerningSizeGlyphs - */ -extern SDL_DEPRECATED DECLSPEC int TTF_GetFontKerningSize(TTF_Font *font, int prev_index, int index); - /** * Query the kerning size of two 16-bit glyphs. * @@ -2140,7 +2100,7 @@ extern SDL_DEPRECATED DECLSPEC int TTF_GetFontKerningSize(TTF_Font *font, int pr * \param ch the current character's code, 16 bits. * \returns The kerning size between the two specified characters, in pixels, or -1 on error. * - * \since This function is available since SDL_ttf 2.0.14. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_GetFontKerningSizeGlyphs32 */ @@ -2159,7 +2119,7 @@ extern DECLSPEC int TTF_GetFontKerningSizeGlyphs(TTF_Font *font, Uint16 previous * \param ch the current character's code, 32 bits. * \returns The kerning size between the two specified characters, in pixels, or -1 on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int TTF_GetFontKerningSizeGlyphs32(TTF_Font *font, Uint32 previous_ch, Uint32 ch); @@ -2176,7 +2136,7 @@ extern DECLSPEC int TTF_GetFontKerningSizeGlyphs32(TTF_Font *font, Uint32 previo * * \returns 0 on success, -1 on error. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_GetFontSDF */ @@ -2189,7 +2149,7 @@ extern DECLSPEC int TTF_SetFontSDF(TTF_Font *font, SDL_bool on_off); * * \returns SDL_TRUE if enabled, SDL_FALSE otherwise. * - * \since This function is available since SDL_ttf 2.0.18. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_SetFontSDF */ @@ -2222,59 +2182,9 @@ typedef enum TTF_DIRECTION_BTT /* Bottom to Top */ } TTF_Direction; -/** - * Set a global direction to be used for text shaping. - * - * \deprecated This function expects an hb_direction_t value, from HarfBuzz, - * cast to an int, and affects all fonts globally. Please use - * TTF_SetFontDirection() instead, which uses an enum supplied by - * SDL_ttf itself and operates on a per-font basis. - * - * This is a global setting; fonts will favor a value set with - * TTF_SetFontDirection(), but if they have not had one explicitly - * set, they will use the value specified here. - * - * The default value is `HB_DIRECTION_LTR` (left-to-right text - * flow). - * - * \param direction an hb_direction_t value. - * \returns 0, or -1 if SDL_ttf is not compiled with HarfBuzz support. - * - * \since This function is available since SDL_ttf 2.0.18. - * - * \sa TTF_SetFontDirection - */ -extern SDL_DEPRECATED DECLSPEC int SDLCALL TTF_SetDirection(int direction); /* hb_direction_t */ - -/** - * Set a global script to be used for text shaping. - * - * \deprecated This function expects an hb_script_t value, from HarfBuzz, cast - * to an int, and affects all fonts globally. Please use - * TTF_SetFontScriptName() instead, which accepts a string that is - * converted to an equivalent int internally, and operates on a - * per-font basis. - * - * This is a global setting; fonts will favor a value set with - * TTF_SetFontScriptName(), but if they have not had one - * explicitly set, they will use the value specified here. - * - * The default value is `HB_SCRIPT_UNKNOWN`. - * - * \returns 0, or -1 if SDL_ttf is not compiled with HarfBuzz support. - * - * \since This function is available since SDL_ttf 2.0.18. - * - * \sa TTF_SetFontScriptName - */ -extern SDL_DEPRECATED DECLSPEC int SDLCALL TTF_SetScript(int script); /* hb_script_t */ - /** * Set direction to be used for text shaping by a font. * - * Any value supplied here will override the global direction set with the - * deprecated TTF_SetDirection(). - * * Possible direction values are: * * - `TTF_DIRECTION_LTR` (Left to Right) @@ -2288,16 +2198,13 @@ extern SDL_DEPRECATED DECLSPEC int SDLCALL TTF_SetScript(int script); /* hb_scri * \param direction the new direction for text to flow. * \returns 0 on success, or -1 on error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_SetFontDirection(TTF_Font *font, TTF_Direction direction); /** * Set script to be used for text shaping by a font. * - * Any value supplied here will override the global script set with the - * deprecated TTF_SetScript(). - * * The supplied script value must be a null-terminated string of exactly four * characters. * @@ -2307,10 +2214,23 @@ extern DECLSPEC int SDLCALL TTF_SetFontDirection(TTF_Font *font, TTF_Direction d * \param script null-terminated string of exactly 4 characters. * \returns 0 on success, or -1 on error. * - * \since This function is available since SDL_ttf 2.20.0. + * \since This function is available since SDL_ttf 3.0.0. */ extern DECLSPEC int SDLCALL TTF_SetFontScriptName(TTF_Font *font, const char *script); +/** + * Set language to be used for text shaping by a font. + * + * If SDL_ttf was not built with HarfBuzz support, this function returns -1. + * + * \param font the font to specify a language for. + * \param language_bcp47 a null-terminated string containing the desired language's BCP47 code. Or null to reset the value. + * \returns 0 on success, or -1 on error. + * + * \since This function is available since SDL_ttf 3.0.0. + */ +extern DECLSPEC int TTF_SetFontLanguage(TTF_Font *font, const char *language_bcp47); + /** * Query whether a font is scalable or not. * @@ -2320,7 +2240,7 @@ extern DECLSPEC int SDLCALL TTF_SetFontScriptName(TTF_Font *font, const char *sc * * \returns SDL_TRUE if the font is scalable, SDL_FALSE otherwise. * - * \since This function is available since SDL_ttf 2.21.0. + * \since This function is available since SDL_ttf 3.0.0. * * \sa TTF_SetFontSDF */ diff --git a/src/SDL_ttf.c b/src/SDL_ttf.c index d282c6d0..968e1138 100644 --- a/src/SDL_ttf.c +++ b/src/SDL_ttf.c @@ -1,6 +1,6 @@ /* SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts - Copyright (C) 2001-2023 Sam Lantinga + Copyright (C) 2001-2024 Sam Lantinga This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -88,29 +88,6 @@ static hb_direction_t g_hb_direction = HB_DIRECTION_LTR; static hb_script_t g_hb_script = HB_SCRIPT_UNKNOWN; #endif -/* Harfbuzz */ -int TTF_SetDirection(int direction) /* hb_direction_t */ -{ -#if TTF_USE_HARFBUZZ - g_hb_direction = direction; - return 0; -#else - (void) direction; - return -1; -#endif -} - -int TTF_SetScript(int script) /* hb_script_t */ -{ -#if TTF_USE_HARFBUZZ - g_hb_script = script; - return 0; -#else - (void) script; - return -1; -#endif -} - /* Round glyph to 16 bytes width and use SSE2 instructions */ #if defined(__SSE2__) # define HAVE_SSE2_INTRINSICS 1 @@ -300,6 +277,7 @@ struct _TTF_Font { hb_script_t hb_script; /* If HB_DIRECTION_INVALID, use global default direction */ hb_direction_t hb_direction; + hb_language_t hb_language; #endif int render_sdf; @@ -436,7 +414,9 @@ static SDL_INLINE void BG_Blended_Color(const TTF_Image *image, Uint32 *destinat while (height--) { /* *INDENT-OFF* */ DUFFS_LOOP4( - tmp = *src++; + /* prevent misaligned load: tmp = *src++; */ + /* eventually, we can expect the compiler to replace the memcpy call with something optimized */ + memcpy(&tmp, src++, sizeof(tmp)); /* This should NOT be SDL_memcpy */ alpha = tmp >> 24; tmp &= ~0xFF000000; alpha = fg_alpha * alpha; @@ -471,7 +451,8 @@ static SDL_INLINE void BG_Blended_LCD(const TTF_Image *image, Uint32 *destinatio while (height--) { /* *INDENT-OFF* */ DUFFS_LOOP4( - tmp = *src++; + /* prevent misaligned load: tmp = *src++; */ + memcpy(&tmp, src++, sizeof(tmp)); /* This should NOT be SDL_memcpy */ if (tmp) { bg = *dst; @@ -527,7 +508,7 @@ static SDL_INLINE void BG_Blended_Opaque_SDF(const TTF_Image *image, Uint32 *des /* *INDENT-OFF* */ DUFFS_LOOP4( d = *dst; - s = *src++ << 24; + s = ((Uint32)*src++) << 24; if (s > d) { *dst = s; } @@ -581,7 +562,7 @@ static SDL_INLINE void BG_Blended_Opaque(const TTF_Image *image, Uint32 *destina while (height--) { /* *INDENT-OFF* */ DUFFS_LOOP4( - *dst++ |= *src++ << 24; + *dst++ |= ((Uint32)*src++) << 24; , width); /* *INDENT-ON* */ src += srcskip; @@ -622,10 +603,10 @@ static SDL_INLINE void BG_Blended_Opaque_32(const TTF_Image *image, Uint32 *dest while (height--) { /* *INDENT-OFF* */ DUFFS_LOOP4( - *dst++ |= *src++ << 24; - *dst++ |= *src++ << 24; - *dst++ |= *src++ << 24; - *dst++ |= *src++ << 24; + *dst++ |= ((Uint32)*src++) << 24; + *dst++ |= ((Uint32)*src++) << 24; + *dst++ |= ((Uint32)*src++) << 24; + *dst++ |= ((Uint32)*src++) << 24; , width); /* *INDENT-ON* */ src += srcskip; @@ -928,11 +909,14 @@ static SDL_INLINE void BG_64(const TTF_Image *image, Uint8 *destination, Sint32 Uint64 *dst = (Uint64 *)destination; Uint32 width = image->width / 8; Uint32 height = image->rows; + Uint64 tmp; while (height--) { /* *INDENT-OFF* */ DUFFS_LOOP4( - *dst++ |= *src++; + /* prevent misaligned load: *dst++ |= *src++; */ + memcpy(&tmp, src++, sizeof(tmp)); /* This should NOT be SDL_memcpy */ + *dst++ |= tmp; , width); /* *INDENT-ON* */ src = (const Uint64 *)((const Uint8 *)src + srcskip); @@ -946,11 +930,14 @@ static SDL_INLINE void BG_32(const TTF_Image *image, Uint8 *destination, Sint32 Uint32 *dst = (Uint32 *)destination; Uint32 width = image->width / 4; Uint32 height = image->rows; + Uint32 tmp; while (height--) { /* *INDENT-OFF* */ DUFFS_LOOP4( - *dst++ |= *src++; + /* prevent misaligned load: *dst++ |= *src++; */ + memcpy(&tmp, src++, sizeof(tmp)); /* This should NOT be SDL_memcpy */ + *dst++ |= tmp; , width); /* *INDENT-ON* */ src = (const Uint32 *)((const Uint8 *)src + srcskip); @@ -1587,7 +1574,7 @@ static SDL_Surface *Create_Surface_Blended(int width, int height, SDL_Color fg, bgcolor = (fg.r << 16) | (fg.g << 8) | fg.b; /* Underline/Strikethrough color style */ - *color = bgcolor | (fg.a << 24); + *color = bgcolor | ((Uint32)fg.a << 24); /* Create the target surface if required */ if (width != 0) { @@ -1611,10 +1598,10 @@ static SDL_Surface* Create_Surface_LCD(int width, int height, SDL_Color fg, SDL_ Uint32 bgcolor; /* Background color */ - bgcolor = (bg.a << 24) | (bg.r << 16) | (bg.g << 8) | bg.b; + bgcolor = (((Uint32)bg.a) << 24) | (bg.r << 16) | (bg.g << 8) | bg.b; /* Underline/Strikethrough color style */ - *color = (bg.a << 24) | (fg.r << 16) | (fg.g << 8) | fg.b; + *color = (((Uint32)bg.a) << 24) | (fg.r << 16) | (fg.g << 8) | fg.b; /* Create the target surface if required */ if (width != 0) { @@ -1762,18 +1749,10 @@ static unsigned long RWread( ) { SDL_RWops *src; - Sint64 amount; src = (SDL_RWops *)stream->descriptor.pointer; - SDL_RWseek(src, (int)offset, SDL_RW_SEEK_SET); - if (count == 0) { - return 0; - } - amount = SDL_RWread(src, buffer, count); - if (amount <= 0) { - return 0; - } - return (unsigned long)amount; + SDL_RWseek(src, offset, SDL_RW_SEEK_SET); + return SDL_RWread(src, buffer, count); } TTF_Font* TTF_OpenFontIndexDPIRW(SDL_RWops *src, SDL_bool freesrc, int ptsize, long index, unsigned int hdpi, unsigned int vdpi) @@ -1911,6 +1890,7 @@ TTF_Font* TTF_OpenFontIndexDPIRW(SDL_RWops *src, SDL_bool freesrc, int ptsize, l /* By default the script / direction are inherited from global variables */ font->hb_script = HB_SCRIPT_INVALID; font->hb_direction = HB_DIRECTION_INVALID; + font->hb_language = hb_language_from_string("", -1); #endif if (TTF_SetFontSizeDPI(font, ptsize, hdpi, vdpi) < 0) { @@ -2049,17 +2029,17 @@ static int TTF_initFontMetrics(TTF_Font *font) return 0; } -TTF_Font* TTF_OpenFontDPIRW( SDL_RWops *src, SDL_bool freesrc, int ptsize, unsigned int hdpi, unsigned int vdpi ) +TTF_Font* TTF_OpenFontDPIRW(SDL_RWops *src, SDL_bool freesrc, int ptsize, unsigned int hdpi, unsigned int vdpi) { return TTF_OpenFontIndexDPIRW(src, freesrc, ptsize, 0, hdpi, vdpi); } -TTF_Font* TTF_OpenFontIndexRW( SDL_RWops *src, SDL_bool freesrc, int ptsize, long index ) +TTF_Font* TTF_OpenFontIndexRW(SDL_RWops *src, SDL_bool freesrc, int ptsize, long index) { return TTF_OpenFontIndexDPIRW(src, freesrc, ptsize, index, 0, 0); } -TTF_Font* TTF_OpenFontIndexDPI( const char *file, int ptsize, long index, unsigned int hdpi, unsigned int vdpi ) +TTF_Font* TTF_OpenFontIndexDPI(const char *file, int ptsize, long index, unsigned int hdpi, unsigned int vdpi) { SDL_RWops *rw = SDL_RWFromFile(file, "rb"); if ( rw == NULL ) { @@ -3155,6 +3135,24 @@ int TTF_SetFontScriptName(TTF_Font *font, const char *script) #endif } +int TTF_SetFontLanguage(TTF_Font *font, const char *language_bcp47) +{ +#if TTF_USE_HARFBUZZ + TTF_CHECK_POINTER(font, -1); + + if (language_bcp47 == NULL) { + font->hb_language = hb_language_from_string("", -1); + } else { + font->hb_language = hb_language_from_string(language_bcp47, -1); + } + return 0; +#else + (void) font; + (void) language_bcp47; + return TTF_SetError("Unsupported"); +#endif +} + static int TTF_Size_Internal(TTF_Font *font, const char *text, const str_type_t str_type, int *w, int *h, int *xstart, int *ystart, @@ -3244,6 +3242,7 @@ static int TTF_Size_Internal(TTF_Font *font, } /* Set global configuration */ + hb_buffer_set_language(hb_buffer, font->hb_language); hb_buffer_set_direction(hb_buffer, hb_direction); hb_buffer_set_script(hb_buffer, hb_script); @@ -3894,6 +3893,8 @@ static SDL_Surface* TTF_Render_Wrapped_Internal(TTF_Font *font, const char *text } } } + /* In case there are all newlines */ + width = SDL_max(width, 1); } } else { if (numLines <= 1 && font->horizontal_align == TTF_WRAPPED_ALIGN_LEFT) { @@ -3954,6 +3955,7 @@ static SDL_Surface* TTF_Render_Wrapped_Internal(TTF_Font *font, const char *text } else { xoffset = 0; } + xoffset = SDL_max(0, xoffset); /* Render one text line to textbuf at (xstart, ystart) */ if (Render_Line(render_mode, font->render_subpixel, font, textbuf, xstart + xoffset, ystart, fg) < 0) { @@ -4236,17 +4238,6 @@ int TTF_WasInit(void) return TTF_initialized; } -/* don't use this function. It's just here for binary compatibility. */ -int TTF_GetFontKerningSize(TTF_Font *font, int prev_index, int index) -{ - FT_Vector delta; - - TTF_CHECK_POINTER(font, -1); - - FT_Get_Kerning(font->face, (FT_UInt)prev_index, (FT_UInt)index, FT_KERNING_DEFAULT, &delta); - return (int)(delta.x >> 6); -} - int TTF_GetFontKerningSizeGlyphs(TTF_Font *font, Uint16 previous_ch, Uint16 ch) { return TTF_GetFontKerningSizeGlyphs32(font, previous_ch, ch); diff --git a/src/SDL_ttf.sym b/src/SDL_ttf.sym index 8401af7d..d262dd8c 100644 --- a/src/SDL_ttf.sym +++ b/src/SDL_ttf.sym @@ -12,7 +12,6 @@ SDL3_ttf_0.0.0 { TTF_FontLineSkip; TTF_GetFontHinting; TTF_GetFontKerning; - TTF_GetFontKerningSize; TTF_GetFontKerningSizeGlyphs; TTF_GetFontKerningSizeGlyphs32; TTF_GetFontOutline; @@ -73,10 +72,10 @@ SDL3_ttf_0.0.0 { TTF_RenderUTF8_Shaded_Wrapped; TTF_RenderUTF8_Solid; TTF_RenderUTF8_Solid_Wrapped; - TTF_SetDirection; TTF_SetFontDirection; TTF_SetFontHinting; TTF_SetFontKerning; + TTF_SetFontLanguage; TTF_SetFontOutline; TTF_SetFontSDF; TTF_SetFontScriptName; diff --git a/src/version.rc b/src/version.rc index 42440b6d..96bd276f 100644 --- a/src/version.rc +++ b/src/version.rc @@ -25,8 +25,8 @@ BEGIN VALUE "FileDescription", "SDL_ttf\0" VALUE "FileVersion", "3, 0, 0, 0\0" VALUE "InternalName", "SDL_ttf\0" - VALUE "LegalCopyright", "Copyright (C) 2023 Sam Lantinga\0" - VALUE "OriginalFilename", "SDL_ttf.dll\0" + VALUE "LegalCopyright", "Copyright (C) 2024 Sam Lantinga\0" + VALUE "OriginalFilename", "SDL3_ttf.dll\0" VALUE "ProductName", "Simple DirectMedia Layer\0" VALUE "ProductVersion", "3, 0, 0, 0\0" END