Skip to content

Commit

Permalink
add modified SDL_ttf for MIR
Browse files Browse the repository at this point in the history
  • Loading branch information
jhay06 committed Sep 12, 2024
1 parent b0a49cc commit 7c6dcb4
Show file tree
Hide file tree
Showing 940 changed files with 448,145 additions and 0 deletions.
20 changes: 20 additions & 0 deletions external/SDL_ttf/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
*~
/.deps/
/.libs/
/Makefile
/SDL2_ttf.pc
/SDL_ttf.lo
/SDL_ttf.o
/autom4te.cache/
/confdefs.h
/config.log
/config.status
/conftest.c
/conftest.err
/glfont
/glfont.o
/libSDL2_ttf.la
/libtool
/result
/showfont
/showfont.o
19 changes: 19 additions & 0 deletions external/SDL_ttf/.hgignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
syntax:glob
autom4te*
config.cache
config.log
config.status
Makefile
libtool
.deps
.libs
*.lo
*.o
*.la
*.lai
.DS_Store
xcuserdata
*.xcworkspace
SDL2_ttf.pc
glfont
showfont
30 changes: 30 additions & 0 deletions external/SDL_ttf/Android.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Save the local path
my_LOCAL_PATH := $(call my-dir)

FREETYPE_LIBRARY_PATH := external/freetype-2.4.12

# Build freetype library
ifneq ($(FREETYPE_LIBRARY_PATH),)
include $(my_LOCAL_PATH)/$(FREETYPE_LIBRARY_PATH)/Android.mk
endif

# Restore local path
LOCAL_PATH := $(my_LOCAL_PATH)
include $(CLEAR_VARS)

LOCAL_MODULE := SDL2_ttf

LOCAL_C_INCLUDES := $(LOCAL_PATH)

LOCAL_SRC_FILES := SDL_ttf.c

ifneq ($(FREETYPE_LIBRARY_PATH),)
LOCAL_C_INCLUDES += $(LOCAL_PATH)/$(FREETYPE_LIBRARY_PATH)/include
LOCAL_STATIC_LIBRARIES += freetype
endif

LOCAL_SHARED_LIBRARIES := SDL2

LOCAL_EXPORT_C_INCLUDES += $(LOCAL_C_INCLUDES)

include $(BUILD_SHARED_LIBRARY)
37 changes: 37 additions & 0 deletions external/SDL_ttf/CHANGES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
2.0.15:
Sam Lantinga - Sun Sep 10 00:18:45 PDT 2017
* Text rendering functions now use the alpha component of the text colors
Sam Lantinga - Sat Sep 9 22:21:55 PDT 2017
* Added support for characters greater than 0xFFFF (e.g. emoji) in the UTF-8 APIs

2.0.14:
Ryan Gordon - Fri Jan 29 12:53:29 PST 2016
* Deprecated TTF_GetFontKerningSize() which takes font glyph indices and added TTF_GetFontKerningSizeGlyphs() which takes characters

2.0.13:
Sylvain - Sat Jun 28 11:42:42 2014
* Fixed bug rendering text starting with a glyph with negative starting offset
beuc - Sun Jun 15 18:27:28 2014
* Fixed regression loading non-scalable fonts
Sam Lantinga - Sun Jun 15 18:21:04 PDT 2014
* TTF_GetFontKerningSize() gets kerning between two characters, not two glyph indices
David Ludwig - Sun Apr 13 22:28:26 2014
* Added support for building for Windows RT and Windows Phone

2.0.12:
Sam Lantinga - Sat Jun 1 19:11:26 PDT 2013
* Updated for SDL 2.0 release

2.0.11:
Sam Lantinga - Sat Dec 31 10:49:42 EST 2011
* SDL_ttf is now under the zlib license
Peter Kosyh - Mon Feb 28 14:57:03 PST 2011
* Improved font glyph caching for non-latin languages
Erik Snoek - Wed Jan 12 09:10:15 PST 2011
* Added API to get kerning info: TTF_GetFontKerningSize()
Sam Lantinga - Mon Jan 10 10:58:34 2011 -0800
* Added Android.mk to build on the Android platform

2.0.10:
Adam Strzelecki - Wed Oct 21 21:02:37 PDT 2009
* Find the Unicode or symbol character map if it's available in the font
70 changes: 70 additions & 0 deletions external/SDL_ttf/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
# Taken from https://github.com/Microsoft/vcpkg/blob/2ad118a2532e99a78c41dffa1b9648e7eca20a95/ports/sdl2-ttf/CMakeLists.txt

cmake_minimum_required(VERSION 3.0)
project(SDL2_TTF C)

set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} ${CMAKE_CURRENT_SOURCE_DIR}/mk/cmake)

option(SDL2TTF_INSTALL "Install target for SDL2_ttf." ON)

IF(MIR_BUILD)
message("ITS MIR BUILD")
find_package(SDL2 REQUIRED)
set(SDL_INCLUDE_DIR ${SDL2_INCLUDE_DIRS})
set(SDL_LIBRARY ${SDL2_LIBRARIES})
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
message(${SDL_INCLUDE_DIR})
find_library(SDL_LIBRARY NAMES SDL2d SDL2)
else()
find_path(SDL_INCLUDE_DIR SDL2/SDL.h)
find_library(SDL_LIBRARY NAMES SDL2d SDL2)

endif()
find_package(Freetype REQUIRED)

add_library(SDL2_ttf SDL_ttf.c version.rc)

set_target_properties(SDL2_ttf PROPERTIES DEFINE_SYMBOL SDL2_EXPORTS)
IF(MIR_BUILD)
target_include_directories(SDL2_ttf PRIVATE ${SDL_INCLUDE_DIR} ${FREETYPE_INCLUDE_DIR_ft2build} ${PROJECT_SOURCE_DIR})
target_include_directories(SDL2_ttf PUBLIC ${SDL_INCLUDE_DIR})
else()
target_include_directories(SDL2_ttf PRIVATE ${SDL_INCLUDE_DIR}/SDL2 ${FREETYPE_INCLUDE_DIR_ft2build} ${PROJECT_SOURCE_DIR})
target_include_directories(SDL2_ttf PUBLIC $<INSTALL_INTERFACE:include/SDL2>)
endif()
if(WITH_RAQM)
find_package(RAQM REQUIRED)
add_definitions(-DHAVE_RAQM=1)
target_include_directories(SDL2_ttf PRIVATE ${RAQM_INCLUDE_DIR})
target_link_libraries(SDL2_ttf PUBLIC ${RAQM_LIBRARY})
endif()
target_link_libraries(SDL2_ttf PRIVATE ${SDL_LIBRARY} ${FREETYPE_LIBRARY})

if(SDL2TTF_INSTALL)
include(GNUInstallDirs)
install(TARGETS SDL2_ttf
EXPORT sdl2_ttf-targets
RUNTIME DESTINATION bin
ARCHIVE DESTINATION lib
LIBRARY DESTINATION lib)

if(NOT DEFINED SDL_TTF_SKIP_HEADERS)
install(FILES SDL_ttf.h DESTINATION include/SDL2)
endif()

# CMake integration
configure_file(sdl2_ttf-config.cmake.in
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/sdl2_ttf-config.cmake" @ONLY)
install(FILES
"${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/sdl2_ttf-config.cmake"
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/SDL2_ttf/")
export(TARGETS SDL2_ttf
FILE "${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/sdl2_ttf-targets.cmake")
export(PACKAGE SDL2_ttf)
install(EXPORT sdl2_ttf-targets
DESTINATION "${CMAKE_INSTALL_LIBDIR}/cmake/SDL2_ttf/")
endif()

message(STATUS "Link-time dependencies:")
message(STATUS " " ${SDL_LIBRARY})
message(STATUS " " ${FREETYPE_LIBRARY})
20 changes: 20 additions & 0 deletions external/SDL_ttf/COPYING.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
/*
SDL_ttf: A companion library to SDL for working with TrueType (tm) fonts
Copyright (C) 1997-2018 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
arising from the use of this software.

Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:

1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
*/
57 changes: 57 additions & 0 deletions external/SDL_ttf/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Makefile.am for the SDL truetype font loading library and viewer

lib_LTLIBRARIES = libSDL2_ttf.la

libSDL2_ttfincludedir = $(includedir)/SDL2
libSDL2_ttfinclude_HEADERS = \
SDL_ttf.h

libSDL2_ttf_la_SOURCES = \
SDL_ttf.c

EXTRA_DIST = \
Android.mk \
debian \
external \
version.rc \
VisualC \
Xcode \
Xcode-iOS \
SDL2_ttf.spec \
SDL2_ttf.spec.in \
gcc-fat.sh \
autogen.sh \
$(srcdir)/*.txt

if USE_VERSION_RC
libSDL2_ttf_la_LDFLAGS = \
-no-undefined \
-release $(LT_RELEASE) \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE) -Wl,version.o
libSDL2_ttf_la_DEPENDENCIES = version.o
else
libSDL2_ttf_la_LDFLAGS = \
-no-undefined \
-release $(LT_RELEASE) \
-version-info $(LT_CURRENT):$(LT_REVISION):$(LT_AGE)
endif
libSDL2_ttf_la_LIBADD = @MATHLIB@

pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = SDL2_ttf.pc

%.o : %.rc
$(WINDRES) $< $@

noinst_PROGRAMS = showfont glfont

showfont_LDADD = libSDL2_ttf.la
glfont_LDADD = libSDL2_ttf.la @GL_LIBS@ @MATHLIB@

# Rule to build tar-gzipped distribution package
$(PACKAGE)-$(VERSION).tar.gz: distcheck

# Rule to build RPM distribution package
rpm: $(PACKAGE)-$(VERSION).tar.gz
rpmbuild -ta $(PACKAGE)-$(VERSION).tar.gz

Loading

0 comments on commit 7c6dcb4

Please sign in to comment.