evgenijlutz/freetype
Carefuly compiled with love [FreeType](https://freetype.org/index.html) library as an Xcode Framework and distributed as a Swift package so you can conviniently integrate it in your Xcode project.
Install
Add the following dependency to your Package.swift:
.package(url: "https://github.com/EvgenijLutz/FreeType.git", from: "2.14.3")And you're good to go!
Framework contents
There are several products in the FreeType:
libfreetype - original freetype interface
Precompiled as an XCFramework FreeType library without any extensions. After adding the package to your project, you can import the library in Swift:
import libfreetypeor in C/C++:
#include <libfreetype.h>FreeTypeC - best for C/C++
A C++ library that extends FreeType's interface, links the FreeType target, empty at the moment. You can import the library in Swift:
import FreeTypeCor in C/C++:
#include <FreeTypeC.h>FreeType - best for Swift
A Swift library that extends FreeTypeC's interface, links the FreeTypeC target, empty at the moment. You can import the library in Swift:
import FreeTypeTODOs
- Expose Android artifact bundle. The library is successfully compiled, but not yet tested.
- Support Windows
- Support Linux
Building FreeType
Download the source code here and unpack the archive. From the FreeType package, copy all files from the Resources/Build directory into the downloaded FreeType sources. Using terminal, navigate to the FreeType sources directory:
cd PATH_TO_FREETYPE_SOURCESClone LibPNG and Brotli to use it for building FreeType with libpng and brotli support.
git clone https://github.com/EvgenijLutz/LibPNG.git
git clone https://github.com/EvgenijLutz/Brotli.gitIn the build-apple.sh script, modify the following variables:
libpng_artifact_path- path toLibPNG.xcframeworkin the previously downloadedLibPNGrepo,brotlicommon_artifact_path- paths tobrotlicommon.xcframeworkin the previously downloadedBrotlirepo,brotlienc_artifact_path-brotlienc.xcframework,brotlidec_artifact_path-brotlidec.xcframework,platforms_path- path to theContents/Developer/Platformsin yourXcodeapp,signing_identity- your Xcode signing identity to sign the framework you compile, see the comment for this variable in thebuild-apple.shscript for instructions.
And execute the script:
bash build-apple.shIf everything succeeds, you'll get libfreetype.xcframework in the build folder. Voilà!
Package Metadata
Repository: evgenijlutz/freetype
Default branch: main
README: README.md