Skip to content

Commit

Permalink
Merge branch 'main' into br_subpixelmode
Browse files Browse the repository at this point in the history
  • Loading branch information
1bsyl authored Jan 15, 2024
2 parents ddb1881 + c4daf98 commit a6883d3
Show file tree
Hide file tree
Showing 28 changed files with 933 additions and 553 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 1 addition & 1 deletion .wikiheaders-options
Original file line number Diff line number Diff line change
Expand Up @@ -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.)
2 changes: 1 addition & 1 deletion Android.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
20 changes: 13 additions & 7 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand All @@ -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}")
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -103,9 +109,7 @@ endif()
target_include_directories(${sdl3_ttf_target_name}
PUBLIC
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>"
"$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include/SDL3_ttf>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}>"
"$<INSTALL_INTERFACE:${CMAKE_INSTALL_INCLUDEDIR}/SDL3_ttf>"
)
target_compile_definitions(${sdl3_ttf_target_name} PRIVATE
BUILD_SDL
Expand Down Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion LICENSE.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (C) 1997-2023 Sam Lantinga <[email protected]>
Copyright (C) 1997-2024 Sam Lantinga <[email protected]>

This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
Expand Down
59 changes: 45 additions & 14 deletions VisualC/SDL_ttf.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -296,50 +296,81 @@
<ClCompile Include="..\external\freetype\src\type1\type1.c" />
<ClCompile Include="..\external\freetype\src\type42\type42.c" />
<ClCompile Include="..\external\freetype\src\winfonts\winfnt.c" />
<ClCompile Include="..\external\harfbuzz\src\graph\gsubgpos-context.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-aat-layout.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-aat-map.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-blob.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-buffer-serialize.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-buffer-verify.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-buffer.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-cairo-utils.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-cairo.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-common.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-coretext.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-directwrite.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-draw.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-face-builder.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-face.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-fallback-shape.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-font.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ft.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-gdi.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-glib.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-gobject-structs.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-graphite2.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-icu.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-map.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-number.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ms-feature-ranges.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-cff1-table.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-cff2-table.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-color.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-face.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-font.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-layout.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-map.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-math.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-meta.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-metrics.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-arabic.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-default.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-hangul.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-hebrew.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-indic-table.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-indic.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-khmer.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-myanmar.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-syllabic.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-thai.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-use.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-complex-vowel-constraints.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-name.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-fallback.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape-normalize.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shape.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-arabic.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-default.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-hangul.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-hebrew.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-indic-table.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-indic.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-khmer.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-myanmar.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-syllabic.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-thai.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-use.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-shaper-vowel-constraints.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-tag.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ot-var.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-outline.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-paint-extents.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-paint.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-set.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-shape-plan.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-shape.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-shaper.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-static.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-style.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-subset-cff-common.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-subset-cff1.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-subset-cff2.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-subset-input.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-subset-instancer-solver.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-subset-plan.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-subset-repacker.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-subset.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-ucd.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-unicode.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-uniscribe.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-wasm-api.cc" />
<ClCompile Include="..\external\harfbuzz\src\hb-wasm-shape.cc" />
<ClCompile Include="..\src\SDL_ttf.c">
<AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand All @@ -352,7 +383,7 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="src\version.rc">
<ResourceCompile Include="..\src\version.rc">
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">%(PreprocessorDefinitions)</PreprocessorDefinitions>
Expand Down
2 changes: 1 addition & 1 deletion VisualC/SDL_ttf.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@
</ClCompile>
</ItemGroup>
<ItemGroup>
<ResourceCompile Include="Version.rc">
<ResourceCompile Include="..\src\version.rc">
<Filter>Sources</Filter>
</ResourceCompile>
</ItemGroup>
Expand Down
105 changes: 0 additions & 105 deletions VisualC/Version.rc

This file was deleted.

2 changes: 1 addition & 1 deletion VisualC/pkg-support/cmake/sdl3_ttf-config.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
15 changes: 0 additions & 15 deletions VisualC/resource.h

This file was deleted.

Loading

0 comments on commit a6883d3

Please sign in to comment.