mirror of
https://github.com/bdnugget/zig-gamedev.git
synced 2026-11-07 09:07:31 +00:00
zsdl: add sdl_ttf bindings
This commit is contained in:
1 parent
31da523af1
commit
ad40cfdcf8
21 files changed
+4621
-1561
No files matched your search
@@ -27,3 +27,5 @@ libs/zwin32/bin/x64/libdxcompiler.so.3.7 filter=lfs diff=lfs merge=lfs -text
|
||||
libs/zsdl/libs/macos/Frameworks/SDL2.framework/SDL2 filter=lfs diff=lfs merge=lfs -text
|
||||
libs/zsdl/libs/macos/Frameworks/SDL2.framework/Versions/A/SDL2 filter=lfs diff=lfs merge=lfs -text
|
||||
.dds filter=lfs diff=lfs merge=lfs -text
|
||||
libs/zsdl/libs/macos/Frameworks/SDL2_ttf.framework/SDL2_ttf filter=lfs diff=lfs merge=lfs -text
|
||||
libs/zsdl/libs/macos/Frameworks/SDL2_ttf.framework/Versions/A/SDL2_ttf filter=lfs diff=lfs merge=lfs -text
|
||||
+49
-7
@@ -4,6 +4,7 @@ const assert = std.debug.assert;
|
||||
pub const Package = struct {
|
||||
zsdl: *std.Build.Module,
|
||||
install: *std.Build.Step,
|
||||
ttf: bool,
|
||||
|
||||
pub fn link(pkg: Package, exe: *std.Build.CompileStep) void {
|
||||
exe.linkLibC();
|
||||
@@ -22,6 +23,10 @@ pub const Package = struct {
|
||||
exe.addLibraryPath(thisDir() ++ "/libs/x86_64-windows-gnu/lib");
|
||||
exe.linkSystemLibraryName("SDL2");
|
||||
exe.linkSystemLibraryName("SDL2main");
|
||||
|
||||
if (pkg.ttf) {
|
||||
exe.linkSystemLibraryName("SDL2_ttf");
|
||||
}
|
||||
},
|
||||
.linux => {
|
||||
assert(target.cpu.arch.isX86());
|
||||
@@ -30,11 +35,19 @@ pub const Package = struct {
|
||||
exe.addLibraryPath(thisDir() ++ "/libs/x86_64-linux-gnu/lib");
|
||||
exe.linkSystemLibraryName("SDL2-2.0");
|
||||
exe.addRPath("$ORIGIN");
|
||||
|
||||
if (pkg.ttf) {
|
||||
exe.linkSystemLibraryName("SDL2_ttf-2.0");
|
||||
}
|
||||
},
|
||||
.macos => {
|
||||
exe.addFrameworkPath(thisDir() ++ "/libs/macos/Frameworks");
|
||||
exe.linkFramework("SDL2");
|
||||
exe.addRPath("@executable_path/Frameworks");
|
||||
|
||||
if (pkg.ttf) {
|
||||
exe.linkFramework("SDL2_ttf");
|
||||
}
|
||||
},
|
||||
else => unreachable,
|
||||
}
|
||||
@@ -45,7 +58,9 @@ pub fn package(
|
||||
b: *std.Build,
|
||||
target: std.zig.CrossTarget,
|
||||
_: std.builtin.Mode,
|
||||
_: struct {},
|
||||
args: struct {
|
||||
ttf: bool = false,
|
||||
},
|
||||
) Package {
|
||||
const zsdl = b.createModule(.{
|
||||
.source_file = .{ .path = thisDir() ++ "/src/zsdl.zig" },
|
||||
@@ -61,6 +76,14 @@ pub fn package(
|
||||
"bin/SDL2.dll",
|
||||
).step,
|
||||
);
|
||||
if (args.ttf) {
|
||||
install_step.dependOn(
|
||||
&b.addInstallFile(
|
||||
.{ .path = thisDir() ++ "/libs/x86_64-windows-gnu/bin/SDL2_ttf.dll" },
|
||||
"bin/SDL2_ttf.dll",
|
||||
).step,
|
||||
);
|
||||
}
|
||||
} else if (target.isLinux()) {
|
||||
install_step.dependOn(
|
||||
&b.addInstallFile(
|
||||
@@ -68,18 +91,37 @@ pub fn package(
|
||||
"bin/libSDL2-2.0.so.0",
|
||||
).step,
|
||||
);
|
||||
if (args.ttf) {
|
||||
install_step.dependOn(
|
||||
&b.addInstallFile(
|
||||
.{ .path = thisDir() ++ "/libs/x86_64-linux-gnu/lib/libSDL2_ttf-2.0.so" },
|
||||
"bin/libSDL2_ttf-2.0.so.0",
|
||||
).step,
|
||||
);
|
||||
}
|
||||
} else if (target.isDarwin()) {
|
||||
const install_dir_step = b.addInstallDirectory(.{
|
||||
.source_dir = .{ .path = thisDir() ++ "/libs/macos/Frameworks/SDL2.framework" },
|
||||
.install_dir = .{ .custom = "" },
|
||||
.install_subdir = "bin/Frameworks/SDL2.framework",
|
||||
});
|
||||
install_step.dependOn(&install_dir_step.step);
|
||||
install_step.dependOn(
|
||||
&b.addInstallDirectory(.{
|
||||
.source_dir = .{ .path = thisDir() ++ "/libs/macos/Frameworks/SDL2.framework" },
|
||||
.install_dir = .{ .custom = "" },
|
||||
.install_subdir = "bin/Frameworks/SDL2.framework",
|
||||
}).step,
|
||||
);
|
||||
if (args.ttf) {
|
||||
install_step.dependOn(
|
||||
&b.addInstallDirectory(.{
|
||||
.source_dir = .{ .path = thisDir() ++ "/libs/macos/Frameworks/SDL2_ttf.framework" },
|
||||
.install_dir = .{ .custom = "" },
|
||||
.install_subdir = "bin/Frameworks/SDL2_ttf.framework",
|
||||
}).step,
|
||||
);
|
||||
}
|
||||
} else unreachable;
|
||||
|
||||
return .{
|
||||
.zsdl = zsdl,
|
||||
.install = install_step,
|
||||
.ttf = args.ttf,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/Headers
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/Resources
|
||||
@@ -0,0 +1 @@
|
||||
Versions/Current/SDL2_ttf
|
||||
File diff suppressed because it is too large.
Load diff
+48
@@ -0,0 +1,48 @@
|
||||
# based on the files generated by CMake's write_basic_package_version_file
|
||||
|
||||
# SDL2_ttf CMake version configuration file:
|
||||
# This file is meant to be placed in Resources/CMake of a SDL2_ttf framework
|
||||
|
||||
if(NOT EXISTS "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_ttf.h")
|
||||
message(AUTHOR_WARNING "Could not find SDL_ttf.h. This script is meant to be placed in the Resources/CMake directory of SDL2_ttf.framework")
|
||||
return()
|
||||
endif()
|
||||
|
||||
file(READ "${CMAKE_CURRENT_LIST_DIR}/../../Headers/SDL_ttf.h" _sdl_ttf_h)
|
||||
string(REGEX MATCH "#define[ \t]+SDL_TTF_MAJOR_VERSION[ \t]+([0-9]+)" _sdl_major_re "${_sdl_ttf_h}")
|
||||
set(_sdl_major "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define[ \t]+SDL_TTF_MINOR_VERSION[ \t]+([0-9]+)" _sdl_minor_re "${_sdl_ttf_h}")
|
||||
set(_sdl_minor "${CMAKE_MATCH_1}")
|
||||
string(REGEX MATCH "#define[ \t]+SDL_TTF_PATCHLEVEL[ \t]+([0-9]+)" _sdl_patch_re "${_sdl_ttf_h}")
|
||||
set(_sdl_patch "${CMAKE_MATCH_1}")
|
||||
if(_sdl_major_re AND _sdl_minor_re AND _sdl_patch_re)
|
||||
set(PACKAGE_VERSION "${_sdl_major}.${_sdl_minor}.${_sdl_patch}")
|
||||
else()
|
||||
message(AUTHOR_WARNING "Could not extract version from SDL_ttf.h.")
|
||||
return()
|
||||
endif()
|
||||
|
||||
if(PACKAGE_FIND_VERSION_RANGE)
|
||||
# Package version must be in the requested version range
|
||||
if ((PACKAGE_FIND_VERSION_RANGE_MIN STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION_MIN)
|
||||
OR ((PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "INCLUDE" AND PACKAGE_VERSION VERSION_GREATER PACKAGE_FIND_VERSION_MAX)
|
||||
OR (PACKAGE_FIND_VERSION_RANGE_MAX STREQUAL "EXCLUDE" AND PACKAGE_VERSION VERSION_GREATER_EQUAL PACKAGE_FIND_VERSION_MAX)))
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
endif()
|
||||
else()
|
||||
if(PACKAGE_VERSION VERSION_LESS PACKAGE_FIND_VERSION)
|
||||
set(PACKAGE_VERSION_COMPATIBLE FALSE)
|
||||
else()
|
||||
set(PACKAGE_VERSION_COMPATIBLE TRUE)
|
||||
if(PACKAGE_FIND_VERSION STREQUAL PACKAGE_VERSION)
|
||||
set(PACKAGE_VERSION_EXACT TRUE)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
# if the using project doesn't have CMAKE_SIZEOF_VOID_P set, fail.
|
||||
if("${CMAKE_SIZEOF_VOID_P}" STREQUAL "")
|
||||
set(PACKAGE_VERSION_UNSUITABLE TRUE)
|
||||
endif()
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
# SDL2_ttf CMake configuration file:
|
||||
# This file is meant to be placed in Resources/CMake of a SDL2_ttf framework
|
||||
|
||||
# INTERFACE_LINK_OPTIONS needs CMake 3.12
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
include(FeatureSummary)
|
||||
set_package_properties(SDL2_ttf PROPERTIES
|
||||
URL "https://www.libsdl.org/projects/SDL_ttf/"
|
||||
DESCRIPTION "Support for TrueType (.ttf) font files with Simple Directmedia Layer"
|
||||
)
|
||||
|
||||
set(SDL2_ttf_FOUND TRUE)
|
||||
|
||||
set(SDL2TTF_VENDORED TRUE)
|
||||
|
||||
set(SDL2TTF_HARFBUZZ TRUE)
|
||||
set(SDL2TTF_FREETYPE TRUE)
|
||||
|
||||
string(REGEX REPLACE "SDL2_ttf\\.framework.*" "SDL2_ttf.framework" _sdl2ttf_framework_path "${CMAKE_CURRENT_LIST_DIR}")
|
||||
string(REGEX REPLACE "SDL2_ttf\\.framework.*" "" _sdl2ttf_framework_parent_path "${CMAKE_CURRENT_LIST_DIR}")
|
||||
|
||||
# All targets are created, even when some might not be requested though COMPONENTS.
|
||||
# This is done for compatibility with CMake generated SDL2_ttf-target.cmake files.
|
||||
|
||||
if(NOT TARGET SDL2_ttf::SDL2_ttf)
|
||||
add_library(SDL2_ttf::SDL2_ttf INTERFACE IMPORTED)
|
||||
set_target_properties(SDL2_ttf::SDL2_ttf
|
||||
PROPERTIES
|
||||
INTERFACE_COMPILE_OPTIONS "SHELL:-F \"${_sdl2ttf_framework_parent_path}\""
|
||||
INTERFACE_INCLUDE_DIRECTORIES "${_sdl2ttf_framework_path}/Headers"
|
||||
INTERFACE_LINK_OPTIONS "SHELL:-F \"${_sdl2ttf_framework_parent_path}\";SHELL:-framework SDL2_ttf"
|
||||
COMPATIBLE_INTERFACE_BOOL "SDL2_SHARED"
|
||||
INTERFACE_SDL2_SHARED "ON"
|
||||
)
|
||||
endif()
|
||||
|
||||
unset(_sdl2ttf_framework_path)
|
||||
unset(_sdl2ttf_framework_parent_path)
|
||||
@@ -0,0 +1,169 @@
|
||||
The FreeType Project LICENSE
|
||||
----------------------------
|
||||
|
||||
2006-Jan-27
|
||||
|
||||
Copyright 1996-2002, 2006 by
|
||||
David Turner, Robert Wilhelm, and Werner Lemberg
|
||||
|
||||
|
||||
|
||||
Introduction
|
||||
============
|
||||
|
||||
The FreeType Project is distributed in several archive packages;
|
||||
some of them may contain, in addition to the FreeType font engine,
|
||||
various tools and contributions which rely on, or relate to, the
|
||||
FreeType Project.
|
||||
|
||||
This license applies to all files found in such packages, and
|
||||
which do not fall under their own explicit license. The license
|
||||
affects thus the FreeType font engine, the test programs,
|
||||
documentation and makefiles, at the very least.
|
||||
|
||||
This license was inspired by the BSD, Artistic, and IJG
|
||||
(Independent JPEG Group) licenses, which all encourage inclusion
|
||||
and use of free software in commercial and freeware products
|
||||
alike. As a consequence, its main points are that:
|
||||
|
||||
o We don't promise that this software works. However, we will be
|
||||
interested in any kind of bug reports. (`as is' distribution)
|
||||
|
||||
o You can use this software for whatever you want, in parts or
|
||||
full form, without having to pay us. (`royalty-free' usage)
|
||||
|
||||
o You may not pretend that you wrote this software. If you use
|
||||
it, or only parts of it, in a program, you must acknowledge
|
||||
somewhere in your documentation that you have used the
|
||||
FreeType code. (`credits')
|
||||
|
||||
We specifically permit and encourage the inclusion of this
|
||||
software, with or without modifications, in commercial products.
|
||||
We disclaim all warranties covering The FreeType Project and
|
||||
assume no liability related to The FreeType Project.
|
||||
|
||||
|
||||
Finally, many people asked us for a preferred form for a
|
||||
credit/disclaimer to use in compliance with this license. We thus
|
||||
encourage you to use the following text:
|
||||
|
||||
"""
|
||||
Portions of this software are copyright © <year> The FreeType
|
||||
Project (www.freetype.org). All rights reserved.
|
||||
"""
|
||||
|
||||
Please replace <year> with the value from the FreeType version you
|
||||
actually use.
|
||||
|
||||
|
||||
Legal Terms
|
||||
===========
|
||||
|
||||
0. Definitions
|
||||
--------------
|
||||
|
||||
Throughout this license, the terms `package', `FreeType Project',
|
||||
and `FreeType archive' refer to the set of files originally
|
||||
distributed by the authors (David Turner, Robert Wilhelm, and
|
||||
Werner Lemberg) as the `FreeType Project', be they named as alpha,
|
||||
beta or final release.
|
||||
|
||||
`You' refers to the licensee, or person using the project, where
|
||||
`using' is a generic term including compiling the project's source
|
||||
code as well as linking it to form a `program' or `executable'.
|
||||
This program is referred to as `a program using the FreeType
|
||||
engine'.
|
||||
|
||||
This license applies to all files distributed in the original
|
||||
FreeType Project, including all source code, binaries and
|
||||
documentation, unless otherwise stated in the file in its
|
||||
original, unmodified form as distributed in the original archive.
|
||||
If you are unsure whether or not a particular file is covered by
|
||||
this license, you must contact us to verify this.
|
||||
|
||||
The FreeType Project is copyright (C) 1996-2000 by David Turner,
|
||||
Robert Wilhelm, and Werner Lemberg. All rights reserved except as
|
||||
specified below.
|
||||
|
||||
1. No Warranty
|
||||
--------------
|
||||
|
||||
THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
|
||||
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
|
||||
BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
|
||||
USE, OF THE FREETYPE PROJECT.
|
||||
|
||||
2. Redistribution
|
||||
-----------------
|
||||
|
||||
This license grants a worldwide, royalty-free, perpetual and
|
||||
irrevocable right and license to use, execute, perform, compile,
|
||||
display, copy, create derivative works of, distribute and
|
||||
sublicense the FreeType Project (in both source and object code
|
||||
forms) and derivative works thereof for any purpose; and to
|
||||
authorize others to exercise some or all of the rights granted
|
||||
herein, subject to the following conditions:
|
||||
|
||||
o Redistribution of source code must retain this license file
|
||||
(`FTL.TXT') unaltered; any additions, deletions or changes to
|
||||
the original files must be clearly indicated in accompanying
|
||||
documentation. The copyright notices of the unaltered,
|
||||
original files must be preserved in all copies of source
|
||||
files.
|
||||
|
||||
o Redistribution in binary form must provide a disclaimer that
|
||||
states that the software is based in part of the work of the
|
||||
FreeType Team, in the distribution documentation. We also
|
||||
encourage you to put an URL to the FreeType web page in your
|
||||
documentation, though this isn't mandatory.
|
||||
|
||||
These conditions apply to any software derived from or based on
|
||||
the FreeType Project, not just the unmodified files. If you use
|
||||
our work, you must acknowledge us. However, no fee need be paid
|
||||
to us.
|
||||
|
||||
3. Advertising
|
||||
--------------
|
||||
|
||||
Neither the FreeType authors and contributors nor you shall use
|
||||
the name of the other for commercial, advertising, or promotional
|
||||
purposes without specific prior written permission.
|
||||
|
||||
We suggest, but do not require, that you use one or more of the
|
||||
following phrases to refer to this software in your documentation
|
||||
or advertising materials: `FreeType Project', `FreeType Engine',
|
||||
`FreeType library', or `FreeType Distribution'.
|
||||
|
||||
As you have not signed this license, you are not required to
|
||||
accept it. However, as the FreeType Project is copyrighted
|
||||
material, only this license, or another one contracted with the
|
||||
authors, grants you the right to use, distribute, and modify it.
|
||||
Therefore, by using, distributing, or modifying the FreeType
|
||||
Project, you indicate that you understand and accept all the terms
|
||||
of this license.
|
||||
|
||||
4. Contacts
|
||||
-----------
|
||||
|
||||
There are two mailing lists related to FreeType:
|
||||
|
||||
o freetype@nongnu.org
|
||||
|
||||
Discusses general use and applications of FreeType, as well as
|
||||
future and wanted additions to the library and distribution.
|
||||
If you are looking for support, start in this list if you
|
||||
haven't found anything to help you in the documentation.
|
||||
|
||||
o freetype-devel@nongnu.org
|
||||
|
||||
Discusses bugs, as well as engine internals, design issues,
|
||||
specific licenses, porting, etc.
|
||||
|
||||
Our home page can be found at
|
||||
|
||||
https://www.freetype.org
|
||||
|
||||
|
||||
--- end of FTL.TXT ---
|
||||
+39
@@ -0,0 +1,39 @@
|
||||
|
||||
The FreeType 2 font engine is copyrighted work and cannot be used
|
||||
legally without a software license. In order to make this project
|
||||
usable to a vast majority of developers, we distribute it under two
|
||||
mutually exclusive open-source licenses.
|
||||
|
||||
This means that *you* must choose *one* of the two licenses described
|
||||
below, then obey all its terms and conditions when using FreeType 2 in
|
||||
any of your projects or products.
|
||||
|
||||
- The FreeType License, found in the file `FTL.TXT', which is similar
|
||||
to the original BSD license *with* an advertising clause that forces
|
||||
you to explicitly cite the FreeType project in your product's
|
||||
documentation. All details are in the license file. This license
|
||||
is suited to products which don't use the GNU General Public
|
||||
License.
|
||||
|
||||
Note that this license is compatible to the GNU General Public
|
||||
License version 3, but not version 2.
|
||||
|
||||
- The GNU General Public License version 2, found in `GPLv2.TXT' (any
|
||||
later version can be used also), for programs which already use the
|
||||
GPL. Note that the FTL is incompatible with GPLv2 due to its
|
||||
advertisement clause.
|
||||
|
||||
The contributed BDF and PCF drivers come with a license similar to that
|
||||
of the X Window System. It is compatible to the above two licenses (see
|
||||
file src/bdf/README and src/pcf/README). The same holds for the files
|
||||
`fthash.c' and `fthash.h'; their code was part of the BDF driver in
|
||||
earlier FreeType versions.
|
||||
|
||||
The gzip module uses the zlib license (see src/gzip/zlib.h) which too is
|
||||
compatible to the above two licenses.
|
||||
|
||||
The MD5 checksum support (only used for debugging in development builds)
|
||||
is in the public domain.
|
||||
|
||||
|
||||
--- end of LICENSE.TXT ---
|
||||
+38
@@ -0,0 +1,38 @@
|
||||
HarfBuzz is licensed under the so-called "Old MIT" license. Details follow.
|
||||
For parts of HarfBuzz that are licensed under different licenses see individual
|
||||
files names COPYING in subdirectories where applicable.
|
||||
|
||||
Copyright © 2010,2011,2012,2013,2014,2015,2016,2017,2018,2019,2020 Google, Inc.
|
||||
Copyright © 2018,2019,2020 Ebrahim Byagowi
|
||||
Copyright © 2019,2020 Facebook, Inc.
|
||||
Copyright © 2012 Mozilla Foundation
|
||||
Copyright © 2011 Codethink Limited
|
||||
Copyright © 2008,2010 Nokia Corporation and/or its subsidiary(-ies)
|
||||
Copyright © 2009 Keith Stribley
|
||||
Copyright © 2009 Martin Hosken and SIL International
|
||||
Copyright © 2007 Chris Wilson
|
||||
Copyright © 2006 Behdad Esfahbod
|
||||
Copyright © 2005 David Turner
|
||||
Copyright © 2004,2007,2008,2009,2010 Red Hat, Inc.
|
||||
Copyright © 1998-2004 David Turner and Werner Lemberg
|
||||
|
||||
For full copyright notices consult the individual files in the package.
|
||||
|
||||
|
||||
Permission is hereby granted, without written agreement and without
|
||||
license or royalty fees, to use, copy, modify, and distribute this
|
||||
software and its documentation for any purpose, provided that the
|
||||
above copyright notice and the following two paragraphs appear in
|
||||
all copies of this software.
|
||||
|
||||
IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
|
||||
DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
|
||||
ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
|
||||
IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGE.
|
||||
|
||||
THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
|
||||
BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||
FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
|
||||
ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
|
||||
PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
|
||||
@@ -0,0 +1,46 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>BuildMachineOSBuild</key>
|
||||
<string>22A400</string>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>English</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>SDL2_ttf</string>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>org.libsdl.SDL2-ttf</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>SDL2_ttf</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>FMWK</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>2.20.2</string>
|
||||
<key>CFBundleSupportedPlatforms</key>
|
||||
<array>
|
||||
<string>MacOSX</string>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>2.20.2</string>
|
||||
<key>DTCompiler</key>
|
||||
<string>com.apple.compilers.llvm.clang.1_0</string>
|
||||
<key>DTPlatformBuild</key>
|
||||
<string>14C18</string>
|
||||
<key>DTPlatformName</key>
|
||||
<string>macosx</string>
|
||||
<key>DTPlatformVersion</key>
|
||||
<string>13.1</string>
|
||||
<key>DTSDKBuild</key>
|
||||
<string>22C55</string>
|
||||
<key>DTSDKName</key>
|
||||
<string>macosx13.1</string>
|
||||
<key>DTXcode</key>
|
||||
<string>1420</string>
|
||||
<key>DTXcodeBuild</key>
|
||||
<string>14C18</string>
|
||||
<key>LSMinimumSystemVersion</key>
|
||||
<string>10.7</string>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1,28 @@
|
||||
SDL_ttf is an example portable font rendering library for use with SDL.
|
||||
|
||||
The source code is available from: http://www.libsdl.org/projects/SDL_ttf
|
||||
|
||||
This library is distributed under the terms of the zlib license: http://www.zlib.net/zlib_license.html
|
||||
|
||||
Portions of this software are copyright © 2013 The FreeType Project (www.freetype.org). All rights reserved.
|
||||
|
||||
This packages contains the SDL2_ttf.framework for OS X. Conforming with Apple guidelines, this framework contains both the SDL runtime component and development header files.
|
||||
|
||||
Requirements:
|
||||
You must have the SDL2.framework installed.
|
||||
|
||||
To Install:
|
||||
Copy the SDL2_ttf.framework to /Library/Frameworks
|
||||
|
||||
You may alternatively install it in <your home directory>/Library/Frameworks if your access privileges are not high enough. (Be aware that the Xcode templates we provide in the SDL Developer Extras package may require some adjustment for your system if you do this.)
|
||||
|
||||
|
||||
(Partial) History of PB/Xcode projects:
|
||||
2009-09-21 - Updated for 64-bit (Snow Leopard) Universal Binaries.
|
||||
Switched to 10.4 minimum requirement.
|
||||
Now dynamic linking Mac OS X bundled freetype directly in /usr/X11R6. (We used to just copy this one into our package since older versions of Mac OS X didn't ship with the library.)
|
||||
Reason: We no longer statically link libfreetype.a into the binary because Apple stopped supplying a libfreetype.a in the 10.5 and 10.6 SDKs.
|
||||
For static library target, you will need to link against libfreetype.dylib for your final app.
|
||||
|
||||
2006-01-31 - First entry in history. Updated for Universal Binaries. Static library of libfreetype has been updated by copying the version Apple provides from the 10.4u SDK.
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:c6d077882fdcbcd52ba521dac60608799c8e7910535435cf449506d17f1d3ef0
|
||||
size 3371536
|
||||
+233
@@ -0,0 +1,233 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>files</key>
|
||||
<dict>
|
||||
<key>Resources/CMake/sdl2_ttf-config-version.cmake</key>
|
||||
<data>
|
||||
2H0oVk3V+kXlw2xJrtkplR8uzZk=
|
||||
</data>
|
||||
<key>Resources/CMake/sdl2_ttf-config.cmake</key>
|
||||
<data>
|
||||
BnA2e1CmuuadQ4WmodFyIid1EAo=
|
||||
</data>
|
||||
<key>Resources/FTL.TXT</key>
|
||||
<data>
|
||||
aTfQN2a6wPh5l5DbBXHTetZHhw8=
|
||||
</data>
|
||||
<key>Resources/FreeType-LICENSE.txt</key>
|
||||
<data>
|
||||
ZLfyE93XJpXZSGahqVMu5bOkcqg=
|
||||
</data>
|
||||
<key>Resources/HarfBuzz-LICENSE.txt</key>
|
||||
<data>
|
||||
GMGU+yuWtqYCiaeSZedpdv/bMD0=
|
||||
</data>
|
||||
<key>Resources/Info.plist</key>
|
||||
<data>
|
||||
OOVyvVBcUvPbIq/C1ppKHIYu7JM=
|
||||
</data>
|
||||
<key>Resources/ReadMe.txt</key>
|
||||
<data>
|
||||
6McVk9LCuB72GPNUFfitazzPTSs=
|
||||
</data>
|
||||
</dict>
|
||||
<key>files2</key>
|
||||
<dict>
|
||||
<key>Headers/SDL_ttf.h</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
4+ZefqoD9HA5z8lHT5i3lh6GLrI=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
RtPoc6u/bhG6XOP0JMhPf8KuxCY/61Cf4kSU0ktp5J0=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/CMake/sdl2_ttf-config-version.cmake</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
2H0oVk3V+kXlw2xJrtkplR8uzZk=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
PfjH4G+WE/+w6VOYm4THELt28ySVkCpaiqk0eqEWK2w=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/CMake/sdl2_ttf-config.cmake</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
BnA2e1CmuuadQ4WmodFyIid1EAo=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
UXGxuOqwWrvD/blIrqL0Y58GXloOCxbZzGzoWI/51QE=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/FTL.TXT</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
aTfQN2a6wPh5l5DbBXHTetZHhw8=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
CME1dV3ViQOUcPH9u0ANqquqpQ0LNm0Zzr/00imGuqE=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/FreeType-LICENSE.txt</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
ZLfyE93XJpXZSGahqVMu5bOkcqg=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
/QVt5BlpA6Z2II71jP3a/H1YPR8o+i5EwwnPhKWeYvs=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/HarfBuzz-LICENSE.txt</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
GMGU+yuWtqYCiaeSZedpdv/bMD0=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
vrPwF860E4dmf3gjenzs+E3voO0lfFBYlGY9ap8TIRs=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/Info.plist</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
OOVyvVBcUvPbIq/C1ppKHIYu7JM=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
A+LX07DOgTlN2hjyvdv4MWJQQMamT82SVeURsGCJ+eI=
|
||||
</data>
|
||||
</dict>
|
||||
<key>Resources/ReadMe.txt</key>
|
||||
<dict>
|
||||
<key>hash</key>
|
||||
<data>
|
||||
6McVk9LCuB72GPNUFfitazzPTSs=
|
||||
</data>
|
||||
<key>hash2</key>
|
||||
<data>
|
||||
qiHN8zxBBJMv8RKGQFiuwXPpgMW7quHFipUT1qlq2wk=
|
||||
</data>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>rules</key>
|
||||
<dict>
|
||||
<key>^Resources/</key>
|
||||
<true/>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^version.plist$</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>rules2</key>
|
||||
<dict>
|
||||
<key>.*\.dSYM($|/)</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>11</real>
|
||||
</dict>
|
||||
<key>^(.*/)?\.DS_Store$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>2000</real>
|
||||
</dict>
|
||||
<key>^(Frameworks|SharedFrameworks|PlugIns|Plug-ins|XPCServices|Helpers|MacOS|Library/(Automator|Spotlight|LoginItems))/</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^.*</key>
|
||||
<true/>
|
||||
<key>^Info\.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^PkgInfo$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/</key>
|
||||
<dict>
|
||||
<key>optional</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1000</real>
|
||||
</dict>
|
||||
<key>^Resources/.*\.lproj/locversion.plist$</key>
|
||||
<dict>
|
||||
<key>omit</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>1100</real>
|
||||
</dict>
|
||||
<key>^Resources/Base\.lproj/</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>1010</real>
|
||||
</dict>
|
||||
<key>^[^/]+$</key>
|
||||
<dict>
|
||||
<key>nested</key>
|
||||
<true/>
|
||||
<key>weight</key>
|
||||
<real>10</real>
|
||||
</dict>
|
||||
<key>^embedded\.provisionprofile$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
<key>^version\.plist$</key>
|
||||
<dict>
|
||||
<key>weight</key>
|
||||
<real>20</real>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -0,0 +1 @@
|
||||
A
|
||||
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:cb1e7c5b8211613b63f542a2d6d30925c95daa7883f854ed736950895bd75406
|
||||
size 82384
|
||||
+3
@@ -0,0 +1,3 @@
|
||||
version https://git-lfs.github.com/spec/v1
|
||||
oid sha256:d96cb0005270afe9925c0bde9c95e29dd7a3f287f79aea17ca381fe3daa28e0e
|
||||
size 1561088
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,43 @@
|
||||
const sdl = @import("sdl2.zig");
|
||||
|
||||
pub fn init() !void {
|
||||
if (TTF_Init() < 0) return sdl.makeError();
|
||||
}
|
||||
extern fn TTF_Init() c_int;
|
||||
|
||||
pub fn wasInit() bool {
|
||||
return TTF_WasInit() == 1;
|
||||
}
|
||||
extern fn TTF_WasInit() c_int;
|
||||
|
||||
pub fn quit() void {
|
||||
TTF_Quit();
|
||||
}
|
||||
extern fn TTF_Quit() void;
|
||||
|
||||
pub const Font = opaque {
|
||||
pub fn open(file: [:0]const u8, ptsize: i32) !*Font {
|
||||
return TTF_OpenFont(file, ptsize) orelse sdl.makeError();
|
||||
}
|
||||
extern fn TTF_OpenFont(file: [*c]const u8, ptsize: c_int) ?*Font;
|
||||
|
||||
pub fn close(font: *Font) void {
|
||||
TTF_CloseFont(font);
|
||||
}
|
||||
extern fn TTF_CloseFont(font: *Font) void;
|
||||
|
||||
pub fn renderTextSolid(font: *Font, text: [:0]const u8, fg: sdl.Color) !*sdl.Surface {
|
||||
return TTF_RenderText_Solid(font, text, fg) orelse sdl.makeError();
|
||||
}
|
||||
extern fn TTF_RenderText_Solid(font: *Font, text: [*c]const u8, fg: sdl.Color) ?*sdl.Surface;
|
||||
|
||||
pub fn renderTextShaded(font: *Font, text: [:0]const u8, fg: sdl.Color, bg: sdl.Color) !*sdl.Surface {
|
||||
return TTF_RenderText_Shaded(font, text, fg, bg) orelse sdl.makeError();
|
||||
}
|
||||
extern fn TTF_RenderText_Shaded(font: *Font, text: [*c]const u8, fg: sdl.Color, bg: sdl.Color) ?*sdl.Surface;
|
||||
|
||||
pub fn renderTextBlended(font: *Font, text: [:0]const u8, fg: sdl.Color) !*sdl.Surface {
|
||||
return TTF_RenderText_Blended(font, text, fg) orelse sdl.makeError();
|
||||
}
|
||||
extern fn TTF_RenderText_Blended(font: *Font, text: [*c]const u8, fg: sdl.Color) ?*sdl.Surface;
|
||||
};
|
||||
+2
-1554
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user