Skip to content
GitLab
Explore
Sign in
Register
FreeType
FreeType
Compare revisions
b00c6e7cb1604b1831736fd29f3ff85a10d9f794 to 5a60d2ef0459a371daf911ef70a83963762061ae
Commits on Source (2)
[docs] Migrate docs/INSTALL to Markdown
· 0ca54477
Anurag Thakur
authored
Jun 29, 2023
0ca54477
[docs] Migrate all INSTALL files to Markdown
· 5a60d2ef
Anurag Thakur
authored
Jun 29, 2023
5a60d2ef
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
5a60d2ef
...
...
@@ -154,7 +154,7 @@ and accept it fully.
[
Documentation GZ
]:
https://download.savannah.gnu.org/releases/freetype/freetype-2.11.1.tar.gz
[
Documentation ZIP
]:
https://download.savannah.gnu.org/releases/freetype/ftdmo2111.zip
[
INSTALL
]:
./docs/INSTALL
[
INSTALL
]:
./docs/INSTALL
.md
[
CHANGES
]:
./docs/CHANGES
[
LICENSE
]:
./LICENSE.TXT
[
DOCGUIDE
]:
./docs/DOCGUIDE
...
...
docs/.gitignore
View file @
5a60d2ef
...
...
@@ -5,6 +5,14 @@ reference/
*.html
*.md
!INSTALL.md
!INSTALL_ANY.md
!INSTALL_CROSS.md
!INSTALL_GNU.md
!INSTALL_MAC.md
!INSTALL_UNIX.md
!INSTALL_VMS.md
# MkDocs Config file
mkdocs.yml
...
...
docs/INSTALL
→
docs/INSTALL
.md
View file @
5a60d2ef
# Building FreeType
There are several ways to build the FreeType library, depending on
your system and the level of customization you need. Here is a short
overview of the documentation available:
I. Prerequisites and dependencies
=================================
## A. Prerequisites and dependencies
FreeType is a low level C library that only depends on the standard
C library with very few platform-dependent optimizations utilized at
...
...
@@ -24,23 +24,22 @@ I. Prerequisites and dependencies
run-time; look at the documentation of function
`FT_Property_Set`
.
II. Normal installation and upgrades
====================================
## B. Normal installation and upgrades
1. Unix and Unix-like systems
1.
Unix and Unix-like systems
This also includes MacOS, Cygwin, MinGW + MSYS, Mingw-w64 + MSYS2,
and possibly other, similar environments.
Please read
`
INSTALL.UNIX
`
to install or upgrade FreeType 2 on a
Please read
[
INSTALL.UNIX
]
to install or upgrade FreeType 2 on a
Unix system. Note that you *need* GNU Make for automatic
compilation, since other make tools won't work (this includes BSD
Make).
GNU Make VERSION 3.81 OR NEWER IS NEEDED!
**
GNU Make VERSION 3.81 OR NEWER IS NEEDED!
**
2. Other systems using GNU Make
2.
Other systems using GNU Make
On some non-Unix platforms, it is possible to build the library
using only the GNU Make utility. Note that *NO OTHER MAKE TOOL
...
...
@@ -48,22 +47,24 @@ II. Normal installation and upgrades
Windows, OS/2, and BeOS, including MinGW* (without MSYS*), Visual
C++, Borland C++, and more.
Instructions are provided in the file
`
INSTALL.GNU
`
.
Instructions are provided in the file
[
INSTALL.GNU
]
.
3. Other build tools and platforms.
3.
Other build tools and platforms.
A few other tools can be used to build FreeType. You can find
the corresponding instruction files in the FreeType root folder
or the builds/ sub-folder.
CMake :: see `CMakeLists.txt` for more information
Meson :: see `meson.build` for more information
MSBuild :: see `builds/windows/vc2010/freetype.vcxproj`
MMS :: see `vms_make.com` and `docs/INSTALL.VMS`
|Build Tool | Details |
| --- | --- |
|CMake | see [CMakeLists.txt] for more information |
|Meson | see [meson.build] for more information |
|MSBuild | see [freetype.vcxproj] |
|MMS | see [vms_make.com] and [INSTALL.VMS] |
4. With an IDE Project File (e.g., for Visual Studio or CodeWarrior)
4.
With an IDE Project File (e.g., for Visual Studio or CodeWarrior)
We provide a small number of 'project files' for various IDEs to
automatically build the library as well. Note that these files
...
...
@@ -74,22 +75,63 @@ II. Normal installation and upgrades
directory, where <system> stands for your OS or environment.
5. From you own IDE, or own Makefiles
5.
From you own IDE, or own Makefiles
If you want to create your own project file, follow the
instructions given in the
`
INSTALL.ANY
`
document of this
instructions given in the
[
INSTALL.ANY
]
document of this
directory.
III. Custom builds of the library
=================================
## C. Custom builds of the library
Customizing the compilation of FreeType is easy, and allows you to
select only the components of the font engine that you really need.
For more details read the file
`
CUSTOMIZE
`
.
For more details read the file
[
docs/
CUSTOMIZE
][
CUSTOMIZE
]
.
## D. Standard builds with `configure`
----------------------------------------------------------------------
The git repository doesn't contain pre-built configuration scripts for
UNIXish platforms. To generate them say
sh autogen.sh
which in turn depends on the following packages:
automake (1.10.1)
libtool (2.2.4)
autoconf (2.62)
The versions given in parentheses are known to work. Newer versions
should work too, of course. Note that
`autogen.sh`
also sets up
proper file permissions for the
`configure`
and auxiliary scripts.
The
`autogen.sh`
script checks whether the versions of the above three
tools match the numbers above. Otherwise it will complain and suggest
either upgrading or using environment variables to point to more
recent versions of the required tools.
Note that
`aclocal`
is provided by the 'automake' package on Linux,
and that
`libtoolize`
is called
`glibtoolize`
on Darwin (OS X).
## E. Alternative build methods
For static builds that don't use platform-specific optimizations, no
configure script is necessary at all; saying
make setup ansi
make
should work on all platforms that have GNU
`make`
(or
`makepp`
).
A build with
`cmake`
or
`meson`
can be done directly from the git
repository. However, if you want to use the
`FT_DEBUG_LOGGING`
macro
(see file
[
docs/DEBUG
][
DEBUG
]
for more information) it is currently mandatory
to execute
`autogen.sh`
in advance; this script clones the 'dlg' git
submodule and copies some files into FreeType's source tree.
---
[
1
]
make++, a make tool written in Perl, has sufficient support of GNU
make extensions to build FreeType. See
...
...
@@ -99,7 +141,7 @@ III. Custom builds of the library
for more information; you need version 2.0 or newer, and you must
pass option `--norc-substitution`.
---
-------------------------------------------------------------------
---
Copyright (C) 2000-2023 by
David Turner, Robert Wilhelm, and Werner Lemberg.
...
...
@@ -110,5 +152,15 @@ license, LICENSE.TXT. By continuing to use, modify, or distribute
this file you indicate that you have read the license and understand
and accept it fully.
--- end of INSTALL ---
<!----------------------------------------------------------------------------->
[
CMakeLists.txt
]:
../CMakeLists.txt
[
meson.build
]:
../meson.build
[
freetype.vcxproj
]:
../builds/windows/vc2010/freetype.vcxproj
[
vms_make.com
]:
../vms_make.com
[
INSTALL.VMS
]:
./INSTALL.VMS
[
INSTALL.ANY
]:
./INSTALL.ANY
[
INSTALL.GNU
]:
./INSTALL.GNU
[
INSTALL.UNIX
]:
./INSTALL.UNIX
[
CUSTOMIZE
]:
./CUSTOMIZE
[
DEBUG
]:
./DEBUG
docs/INSTALL
.
ANY
→
docs/INSTALL
_
ANY
.md
View file @
5a60d2ef
Instructions on how to build FreeType with your own build tool
==============================================================
# Instructions on how to build FreeType with your own build tool
See the file `CUSTOMIZE' to learn how to customize FreeType to
specific environments.
See the file
[
docs/CUSTOMIZE
][
CUSTOMIZE
]
to learn how to
customize FreeType to specific environments.
I. Standard procedure
---------------------
* If you use macro names for FreeType header files (while mandatory
in earlier versions, this is now optional since FreeType version
2.6.1) it is necessary to disable pre-compiled headers. This is
very important for Visual C++, because lines like
## A. Standard procedure
*
If you use macro names for FreeType header files (while mandatory
in earlier versions, this is now optional since FreeType version
2.
6.1) it is necessary to disable pre-compiled headers. This is
very important for Visual C++, because lines like
#include FT_FREETYPE_H
are not correctly supported by this compiler while being ISO C
compliant!
are not correctly supported by this compiler while being ISO C
compliant!
* You need to add the directory `include
'
to your include path when
compiling the library.
*
You need to add the directory
`include
`
to your include path when
compiling the library.
* FreeType 2 is made of several components; each of them is located
in a subdirectory of `freetype/src
'
. For example,
`freetype/src/truetype/
'
contains the TrueType font driver.
*
FreeType 2 is made of several components; each of them is located
in a subdirectory of
`freetype/src
`
. For example,
`freetype/src/truetype/
`
contains the TrueType font driver.
* DO NOT COMPILE ALL C FILES! Rather, compile the following ones.
*
DO NOT COMPILE ALL C FILES! Rather, compile the following ones.
--
base components (required)
###
base components (required)
:
src/base/ftsystem.c
src/base/ftinit.c
...
...
@@ -55,7 +54,7 @@ I. Standard procedure
src/base/ftmac.c -- only on the Macintosh
--
font drivers (optional; at least one is needed)
###
font drivers (optional; at least one is needed)
src/bdf/bdf.c -- BDF font driver
src/cff/cff.c -- CFF/OpenType font driver
...
...
@@ -69,14 +68,13 @@ I. Standard procedure
src/type42/type42.c -- Type 42 font driver
src/winfonts/winfnt.c -- Windows FONT / FNT font driver
-- rasterizers (optional; at least one is needed for vector
formats)
### rasterizers (optional; at least one is needed for vector formats)
src/raster/raster.c -- monochrome rasterizer
src/sdf/sdf.c -- Signed Distance Field driver
src/smooth/smooth.c -- anti-aliasing rasterizer
--
auxiliary modules (optional)
###
auxiliary modules (optional)
src/autofit/autofit.c -- auto hinting module
src/cache/ftcache.c -- cache sub-system (in beta)
...
...
@@ -90,54 +88,53 @@ I. Standard procedure
src/psnames/psnames.c -- PostScript glyph names support
Notes:
##
Notes:
`ftcache.c
'
needs `ftglyph.c
'
`ftfstype.c
'
needs `fttype1.c
'
`ftglyph.c
'
needs `ftbitmap.c
'
`ftstroke.c
'
needs `ftglyph.c
'
`ftsynth.c
'
needs `ftbitmap.c
'
`ftcache.c
`
needs `ftglyph.c
`
`ftfstype.c
`
needs `fttype1.c
`
`ftglyph.c
`
needs `ftbitmap.c
`
`ftstroke.c
`
needs `ftglyph.c
`
`ftsynth.c
`
needs `ftbitmap.c
`
`cff.c
'
needs `sfnt.c
'
, `pshinter.c
'
, and `psnames.c
'
`truetype.c
'
needs `sfnt.c
'
and `psnames.c
'
`type1.c
'
needs `psaux.c
'
`pshinter.c
'
, and `psnames.c
'
`type1cid.c
'
needs `psaux.c
'
, `pshinter.c
'
, and `psnames.c
'
`type42.c
'
needs `truetype.c
'
`cff.c
`
needs `sfnt.c
`
, `pshinter.c
`
, and `psnames.c
`
`truetype.c
`
needs `sfnt.c
`
and `psnames.c
`
`type1.c
`
needs `psaux.c
`
`pshinter.c
`
, and `psnames.c
`
`type1cid.c
`
needs `psaux.c
`
, `pshinter.c
`
, and `psnames.c
`
`type42.c
`
needs `truetype.c
`
Please consult the central `include/freetype/config/ftoption.h
'
configuration file for details on additional libraries necessary
for some optional features.
Please consult the central `include/freetype/config/ftoption.h
`
configuration file for details on additional libraries necessary
for some optional features.
Read the file `CUSTOMIZE
'
in case you want to compile only a subset
of the drivers, renderers, and optional modules; a detailed
description of the various base extension is given in the top-level
file `modules.cfg
'
.
Read the file
`CUSTOMIZE
`
in case you want to compile only a subset
of the drivers, renderers, and optional modules; a detailed
description of the various base extension is given in the top-level
file
`modules.cfg
`
.
You are done. In case of problems, see the archives of the FreeType
development mailing list.
You are done. In case of problems, see the archives of the FreeType
development mailing list.
II. Support for flat-directory compilation
------------------------------------------
## B. Support for flat-directory compilation
It is possible to put all FreeType 2 source files into a single
directory, with the *exception* of the `include
'
hierarchy.
It is possible to put all FreeType 2 source files into a single
directory, with the
*exception*
of the
`include
`
hierarchy.
1. Copy all files in current directory
1.
Copy all files in current directory
cp freetype/src/base/*.[hc] .
cp freetype/src/raster1/*.[hc] .
cp freetype/src/smooth/*.[hc] .
etc.
cp freetype/src/base/*.[hc] .
cp freetype/src/raster1/*.[hc] .
cp freetype/src/smooth/*.[hc] .
etc.
2. Compile sources
2.
Compile sources
cc -c -Iinclude -DFT2_BUILD_LIBRARY ftsystem.c
cc -c -Iinclude -DFT2_BUILD_LIBRARY ftinit.c
cc -c -Iinclude -DFT2_BUILD_LIBRARY ftdebug.c
cc -c -Iinclude -DFT2_BUILD_LIBRARY ftbase.c
etc.
cc -c -Iinclude -DFT2_BUILD_LIBRARY ftsystem.c
cc -c -Iinclude -DFT2_BUILD_LIBRARY ftinit.c
cc -c -Iinclude -DFT2_BUILD_LIBRARY ftdebug.c
cc -c -Iinclude -DFT2_BUILD_LIBRARY ftbase.c
etc.
You don't need to define the FT_FLAT_COMPILATION macro (as this
was required in previous releases of FreeType 2).
...
...
@@ -154,4 +151,5 @@ this file you indicate that you have read the license and understand
and accept it fully.
--- end of INSTALL.ANY ---
<!---->
[
CUSTOMIZE
]:
./CUSTOMIZE
docs/INSTALL
.
CROSS
→
docs/INSTALL
_
CROSS
.md
View file @
5a60d2ef
File moved
docs/INSTALL
.
GNU
→
docs/INSTALL
_
GNU
.md
View file @
5a60d2ef
File moved
docs/INSTALL
.
MAC
→
docs/INSTALL
_
MAC
.md
View file @
5a60d2ef
File moved
docs/INSTALL
.
UNIX
→
docs/INSTALL
_
UNIX
.md
View file @
5a60d2ef
This document contains instructions on how to build the FreeType
library on Unix systems. This also works for emulations like Cygwin
or MSys on Win32:
# Building FreeType on Unix Systems
This also works for emulations like Cygwin or MSys on Win32:
1. Ensure that you are using GNU Make
-------------------------------------
1.
**Ensure that you are using GNU Make**
The FreeType build system _exclusively_ works with GNU Make. You
will not be able to compile the library with the instructions
below using any other alternative (including BSD Make).
Check that you have GNU make by running the command:
make -v
```bash
make -v
```
This should dump some text that begins with:
GNU Make <version number>
Copyright (C) <year> Free Software Foundation Inc.
GNU Make <version number>
Copyright (C) <year> Free Software Foundation Inc.
Note that version 3.81 or higher is *required* or the build will
fail.
...
...
@@ -26,102 +26,104 @@ or MSys on Win32:
if you use the MAKE variable as described below.
As a special exception, 'makepp' can also be used to build
FreeType 2. See the file docs/MAKEPP for details.
FreeType 2. See the file
`
docs/MAKEPP
`
for details.
For builds with `cmake
'
please check file `CMakeLists.txt
'
; this
For builds with `cmake
`
please check file `CMakeLists.txt
`
; this
is a contributed file not directly supported by the FreeType team.
2. Regenerate the configure script if needed
--------------------------------------------
2.
**Regenerate the configure script if needed**
This only applies if you are building a git snapshot or checkout,
*not* if you grabbed the sources of an official release.
You need to invoke the `autogen.sh
'
script in the top-level
directory in order to create the `configure
'
script for your
You need to invoke the `autogen.sh
`
script in the top-level
directory in order to create the `configure
`
script for your
platform. Normally, this simply means typing:
sh autogen.sh
```bash
sh autogen.sh
```
In case of problems, you may need to install or upgrade Automake,
Autoconf or Libtool. See `README.git' in the top-level directory
for more information.
Autoconf or Libtool. See [INSTALL.md] for more information.
3. Build and install the library
--------------------------------
3.
**Build and install the library**
Say
./configure --help
```bash
./configure --help
```
to see the list of possible configuration options and important
environment variables. The ./configure script will detect some
environment variables. The
`
./configure
`
script will detect some
prerequisite system libraries (libpng, brotli, etc.) if their
headers are available at the default locations.
The following should work on all Unix systems where the `make
'
The following should work on all Unix systems where the `make
`
command invokes GNU Make:
./configure [options]
make
make install (as root)
The default installation path is `/usr/local'. It can be changed
with the `--prefix=<path>' option. Example:
./configure --prefix=/usr
```bash
./configure [options]
make
make install (as root)
```
The default installation path is `/usr/local`. It can be changed
with the `--prefix=<path>` option. Example:
```bash
./configure --prefix=/usr
```
When using a different command to invoke GNU Make, use the MAKE
variable. For example, if `gmake
'
is the command to use on your
variable. For example, if `gmake
`
is the command to use on your
system, do something like:
MAKE=gmake ./configure [options]
gmake
gmake install (as root)
```bash
MAKE=gmake ./configure [options]
gmake
gmake install (as root)
```
If this still doesn't work, there must be a problem with your
system (e.g., you are using a very old version of GNU Make).
For library identification, FreeType's `configure
'
script uses the
`pkg-config
'
interface: Assuming it needs library `foo
'
, it calls
the `pkg-config
'
program to find information on library `foo
'
,
which in turn looks for a `foo.pc
'
file installed at the system.
Some platforms, however, don't come with `pkg-support
'
; you then
For library identification, FreeType's `configure
`
script uses the
`pkg-config
`
interface: Assuming it needs library `foo
`
, it calls
the `pkg-config
`
program to find information on library `foo
`
,
which in turn looks for a `foo.pc
`
file installed at the system.
Some platforms, however, don't come with `pkg-support
`
; you then
have to use environment variables as described by `configure
--help
'
. Example:
LIBPNG_CFLAGS="-I/path/to/libpng/include/directory" \
LIBPNG_LIBS="-L/path/to/libpng/lib/directory" \
configure ...
--help
`
. Example:
```bash
LIBPNG_CFLAGS="-I/path/to/libpng/include/directory" \
LIBPNG_LIBS="-L/path/to/libpng/lib/directory" \
configure ...
```
It is possible to compile FreeType in a different directory.
Assuming the FreeType source files in directory `/src/freetype' a
compilation in directory `foo' works as follows:
cd foo
/src/freetype/configure [options]
make
make install
Assuming the FreeType source files in directory `/src/freetype` a
compilation in directory `foo` works as follows:
```bash
cd foo
/src/freetype/configure [options]
make
make install
```
3.1 Interdependency with HarfBuzz
.................................
3.
1
**Interdependency with HarfBuzz**
Note that there is a chicken-and-egg problem currently since the
HarfBuzz library (used by the auto-hinter to improve support of
OpenType fonts) depends on FreeType, which can be solved as
follows in case HarfBuzz is not yet installed on your system.
Note that there is a chicken-and-egg problem currently since the
HarfBuzz library (used by the auto-hinter to improve support of
OpenType fonts) depends on FreeType, which can be solved as
follows in case HarfBuzz is not yet installed on your system.
1. Call FreeType's `configure
'
script with option
`--without-harfbuzz
'
, then compile and install FreeType.
1.
Call FreeType's
`configure
`
script with option
`--without-harfbuzz
`
, then compile and install FreeType.
2. Compile and install HarfBuzz.
2.
Compile and install HarfBuzz.
3. Call FreeType's `configure
'
script without option
`--without-harfbuzz
'
(after executing `make distclean
'
), then
compile and install FreeType again.
3.
Call FreeType's
`configure
`
script without option
`--without-harfbuzz
`
(after executing
`make distclean
`
), then
compile and install FreeType again.
----------------------------------------------------------------------
...
...
@@ -135,5 +137,5 @@ license, LICENSE.TXT. By continuing to use, modify, or distribute
this file you indicate that you have read the license and understand
and accept it fully.
--- end of INSTALL.UNIX ---
<!---->
[
INSTALL.md
]:
./INSTALL.md
docs/INSTALL
.
VMS
→
docs/INSTALL
_
VMS
.md
View file @
5a60d2ef
File moved