Anurag Thakur pushed to branch gsoc-anurag-docs-2023 at FreeType / FreeType
Commits:
-
45d3ff99
by Anurag Thakur at 2023-08-02T01:42:57+05:30
[docs] Migrate all INSTALL files to Markdown
-
64b2b80b
by Anurag Thakur at 2023-08-02T01:43:03+05:30
[docs] Add documentation on adding new modules to FreeType
-
d1eaaa9e
by Anurag Thakur at 2023-08-02T01:43:03+05:30
[docs] Add documentation on compiling FreeType on an Android Device
-
4f196332
by Anurag Thakur at 2023-08-02T01:43:03+05:30
[docs] Add documentation on FreeType development, benchmarking
-
cb7f7760
by Anurag Thakur at 2023-08-02T01:43:03+05:30
[docs] Add documentation on FreeType smooth raster algorithm
16 changed files:
Changes:
docs/.gitignore
... |
... |
@@ -6,6 +6,16 @@ reference/ |
6
|
6
|
*.md
|
7
|
7
|
|
8
|
8
|
!INSTALL.md
|
|
9
|
+!INSTALL_ANY.md
|
|
10
|
+!INSTALL_CROSS.md
|
|
11
|
+!INSTALL_GNU.md
|
|
12
|
+!INSTALL_MAC.md
|
|
13
|
+!INSTALL_UNIX.md
|
|
14
|
+!INSTALL_VMS.md
|
|
15
|
+!INSTALL_ANDROID.md
|
|
16
|
+!MODIFYING.md
|
|
17
|
+!DEVELOPING.md
|
|
18
|
+!Raster_Algorithm.md
|
9
|
19
|
|
10
|
20
|
# MkDocs Config file
|
11
|
21
|
mkdocs.yml
|
docs/DEVELOPING.md
|
1
|
+TODO: Add details on setting up a development environment, benchmarking and debugging freetype on various platforms |
docs/INSTALL.ANY
deleted
1
|
|
-Instructions on how to build FreeType with your own build tool
|
2
|
|
-==============================================================
|
3
|
|
-
|
4
|
|
-See the file `CUSTOMIZE' to learn how to customize FreeType to
|
5
|
|
-specific environments.
|
6
|
|
-
|
7
|
|
-
|
8
|
|
-I. Standard procedure
|
9
|
|
----------------------
|
10
|
|
-
|
11
|
|
- * If you use macro names for FreeType header files (while mandatory
|
12
|
|
- in earlier versions, this is now optional since FreeType version
|
13
|
|
- 2.6.1) it is necessary to disable pre-compiled headers. This is
|
14
|
|
- very important for Visual C++, because lines like
|
15
|
|
-
|
16
|
|
- #include FT_FREETYPE_H
|
17
|
|
-
|
18
|
|
- are not correctly supported by this compiler while being ISO C
|
19
|
|
- compliant!
|
20
|
|
-
|
21
|
|
- * You need to add the directory `include' to your include path when
|
22
|
|
- compiling the library.
|
23
|
|
-
|
24
|
|
- * FreeType 2 is made of several components; each of them is located
|
25
|
|
- in a subdirectory of `freetype/src'. For example,
|
26
|
|
- `freetype/src/truetype/' contains the TrueType font driver.
|
27
|
|
-
|
28
|
|
- * DO NOT COMPILE ALL C FILES! Rather, compile the following ones.
|
29
|
|
-
|
30
|
|
- -- base components (required)
|
31
|
|
-
|
32
|
|
- src/base/ftsystem.c
|
33
|
|
- src/base/ftinit.c
|
34
|
|
- src/base/ftdebug.c
|
35
|
|
-
|
36
|
|
- src/base/ftbase.c
|
37
|
|
-
|
38
|
|
- src/base/ftbbox.c -- recommended, see <ftbbox.h>
|
39
|
|
- src/base/ftglyph.c -- recommended, see <ftglyph.h>
|
40
|
|
-
|
41
|
|
- src/base/ftbdf.c -- optional, see <ftbdf.h>
|
42
|
|
- src/base/ftbitmap.c -- optional, see <ftbitmap.h>
|
43
|
|
- src/base/ftcid.c -- optional, see <ftcid.h>
|
44
|
|
- src/base/ftfstype.c -- optional
|
45
|
|
- src/base/ftgasp.c -- optional, see <ftgasp.h>
|
46
|
|
- src/base/ftgxval.c -- optional, see <ftgxval.h>
|
47
|
|
- src/base/ftmm.c -- optional, see <ftmm.h>
|
48
|
|
- src/base/ftotval.c -- optional, see <ftotval.h>
|
49
|
|
- src/base/ftpatent.c -- optional
|
50
|
|
- src/base/ftpfr.c -- optional, see <ftpfr.h>
|
51
|
|
- src/base/ftstroke.c -- optional, see <ftstroke.h>
|
52
|
|
- src/base/ftsynth.c -- optional, see <ftsynth.h>
|
53
|
|
- src/base/fttype1.c -- optional, see <t1tables.h>
|
54
|
|
- src/base/ftwinfnt.c -- optional, see <ftwinfnt.h>
|
55
|
|
-
|
56
|
|
- src/base/ftmac.c -- only on the Macintosh
|
57
|
|
-
|
58
|
|
- -- font drivers (optional; at least one is needed)
|
59
|
|
-
|
60
|
|
- src/bdf/bdf.c -- BDF font driver
|
61
|
|
- src/cff/cff.c -- CFF/OpenType font driver
|
62
|
|
- src/cid/type1cid.c -- Type 1 CID-keyed font driver
|
63
|
|
- src/pcf/pcf.c -- PCF font driver
|
64
|
|
- src/pfr/pfr.c -- PFR/TrueDoc font driver
|
65
|
|
- src/sfnt/sfnt.c -- SFNT files support
|
66
|
|
- (TrueType & OpenType)
|
67
|
|
- src/truetype/truetype.c -- TrueType font driver
|
68
|
|
- src/type1/type1.c -- Type 1 font driver
|
69
|
|
- src/type42/type42.c -- Type 42 font driver
|
70
|
|
- src/winfonts/winfnt.c -- Windows FONT / FNT font driver
|
71
|
|
-
|
72
|
|
- -- rasterizers (optional; at least one is needed for vector
|
73
|
|
- formats)
|
74
|
|
-
|
75
|
|
- src/raster/raster.c -- monochrome rasterizer
|
76
|
|
- src/sdf/sdf.c -- Signed Distance Field driver
|
77
|
|
- src/smooth/smooth.c -- anti-aliasing rasterizer
|
78
|
|
-
|
79
|
|
- -- auxiliary modules (optional)
|
80
|
|
-
|
81
|
|
- src/autofit/autofit.c -- auto hinting module
|
82
|
|
- src/cache/ftcache.c -- cache sub-system (in beta)
|
83
|
|
- src/gzip/ftgzip.c -- support for compressed fonts (.gz)
|
84
|
|
- src/lzw/ftlzw.c -- support for compressed fonts (.Z)
|
85
|
|
- src/bzip2/ftbzip2.c -- support for compressed fonts (.bz2)
|
86
|
|
- src/gxvalid/gxvalid.c -- TrueTypeGX/AAT table validation
|
87
|
|
- src/otvalid/otvalid.c -- OpenType table validation
|
88
|
|
- src/psaux/psaux.c -- PostScript Type 1 parsing
|
89
|
|
- src/pshinter/pshinter.c -- PS hinting module
|
90
|
|
- src/psnames/psnames.c -- PostScript glyph names support
|
91
|
|
-
|
92
|
|
-
|
93
|
|
- Notes:
|
94
|
|
-
|
95
|
|
- `ftcache.c' needs `ftglyph.c'
|
96
|
|
- `ftfstype.c' needs `fttype1.c'
|
97
|
|
- `ftglyph.c' needs `ftbitmap.c'
|
98
|
|
- `ftstroke.c' needs `ftglyph.c'
|
99
|
|
- `ftsynth.c' needs `ftbitmap.c'
|
100
|
|
-
|
101
|
|
- `cff.c' needs `sfnt.c', `pshinter.c', and `psnames.c'
|
102
|
|
- `truetype.c' needs `sfnt.c' and `psnames.c'
|
103
|
|
- `type1.c' needs `psaux.c' `pshinter.c', and `psnames.c'
|
104
|
|
- `type1cid.c' needs `psaux.c', `pshinter.c', and `psnames.c'
|
105
|
|
- `type42.c' needs `truetype.c'
|
106
|
|
-
|
107
|
|
- Please consult the central `include/freetype/config/ftoption.h'
|
108
|
|
- configuration file for details on additional libraries necessary
|
109
|
|
- for some optional features.
|
110
|
|
-
|
111
|
|
-
|
112
|
|
- Read the file `CUSTOMIZE' in case you want to compile only a subset
|
113
|
|
- of the drivers, renderers, and optional modules; a detailed
|
114
|
|
- description of the various base extension is given in the top-level
|
115
|
|
- file `modules.cfg'.
|
116
|
|
-
|
117
|
|
- You are done. In case of problems, see the archives of the FreeType
|
118
|
|
- development mailing list.
|
119
|
|
-
|
120
|
|
-
|
121
|
|
-II. Support for flat-directory compilation
|
122
|
|
-------------------------------------------
|
123
|
|
-
|
124
|
|
- It is possible to put all FreeType 2 source files into a single
|
125
|
|
- directory, with the *exception* of the `include' hierarchy.
|
126
|
|
-
|
127
|
|
- 1. Copy all files in current directory
|
128
|
|
-
|
129
|
|
- cp freetype/src/base/*.[hc] .
|
130
|
|
- cp freetype/src/raster1/*.[hc] .
|
131
|
|
- cp freetype/src/smooth/*.[hc] .
|
132
|
|
- etc.
|
133
|
|
-
|
134
|
|
- 2. Compile sources
|
135
|
|
-
|
136
|
|
- cc -c -Iinclude -DFT2_BUILD_LIBRARY ftsystem.c
|
137
|
|
- cc -c -Iinclude -DFT2_BUILD_LIBRARY ftinit.c
|
138
|
|
- cc -c -Iinclude -DFT2_BUILD_LIBRARY ftdebug.c
|
139
|
|
- cc -c -Iinclude -DFT2_BUILD_LIBRARY ftbase.c
|
140
|
|
- etc.
|
141
|
|
-
|
142
|
|
- You don't need to define the FT_FLAT_COMPILATION macro (as this
|
143
|
|
- was required in previous releases of FreeType 2).
|
144
|
|
-
|
145
|
|
-----------------------------------------------------------------------
|
146
|
|
-
|
147
|
|
-Copyright (C) 2003-2023 by
|
148
|
|
-David Turner, Robert Wilhelm, and Werner Lemberg.
|
149
|
|
-
|
150
|
|
-This file is part of the FreeType project, and may only be used,
|
151
|
|
-modified, and distributed under the terms of the FreeType project
|
152
|
|
-license, LICENSE.TXT. By continuing to use, modify, or distribute
|
153
|
|
-this file you indicate that you have read the license and understand
|
154
|
|
-and accept it fully.
|
155
|
|
-
|
156
|
|
-
|
157
|
|
---- end of INSTALL.ANY --- |
docs/INSTALL.CROSS
deleted
1
|
|
-This document contains instructions on how to cross-build the FreeType
|
2
|
|
-library on Unix systems, for example, building binaries for Linux/MIPS
|
3
|
|
-on FreeBSD/i386. Before reading this document, please consult the
|
4
|
|
-file `INSTALL.UNIX' for required tools and the basic self-building
|
5
|
|
-procedure.
|
6
|
|
-
|
7
|
|
-
|
8
|
|
- 1. Required Tools
|
9
|
|
- -----------------
|
10
|
|
-
|
11
|
|
- For self-building the FreeType library on a Unix system, GNU Make
|
12
|
|
- 3.81 or newer is required. `INSTALL.UNIX' contains hints how to
|
13
|
|
- check the installed `make'.
|
14
|
|
-
|
15
|
|
- The GNU C compiler to cross-build the target system is required.
|
16
|
|
- Currently, using a non-GNU cross compiler is untested. The cross
|
17
|
|
- compiler is expected to be installed with a system prefix. For
|
18
|
|
- example, if your building system is FreeBSD/i386 and the target
|
19
|
|
- system is Linux/MIPS, the cross compiler should be installed with
|
20
|
|
- the name `mips-ip22-linuxelf-gcc'.
|
21
|
|
-
|
22
|
|
- A C compiler for a self-build is required also, to build a tool
|
23
|
|
- (`apinames') that is executed during the build procedure. Non-GNU
|
24
|
|
- self compilers are acceptable, but such a setup is untested.
|
25
|
|
-
|
26
|
|
-
|
27
|
|
- 2. Configuration
|
28
|
|
- ----------------
|
29
|
|
-
|
30
|
|
- 2.1. Building and target system
|
31
|
|
-
|
32
|
|
- To configure a cross-build, the options `--host=<system>' and
|
33
|
|
- `--build=<system>' must be passed to the `configure' script.
|
34
|
|
- For example, if your build system is FreeBSD/i386 and the target
|
35
|
|
- system is Linux/MIPS, say
|
36
|
|
-
|
37
|
|
- ./configure \
|
38
|
|
- --build=i386-unknown-freebsd \
|
39
|
|
- --host=mips-ip22-linuxelf \
|
40
|
|
- [other options]
|
41
|
|
-
|
42
|
|
- It should be noted that `--host=<system>' specifies the system
|
43
|
|
- where the built binaries will be executed, not the system where
|
44
|
|
- the build actually happens. Older versions of GNU autoconf use
|
45
|
|
- the option pair `--host=' and `--target='. This is broken and
|
46
|
|
- doesn't work. Similarly, an explicit CC specification like
|
47
|
|
-
|
48
|
|
- env CC=mips-ip22-linux-gcc ./configure # BAD
|
49
|
|
-
|
50
|
|
- or
|
51
|
|
-
|
52
|
|
- env CC=/usr/local/mips-ip22-linux/bin/gcc ./configure # BAD
|
53
|
|
-
|
54
|
|
- doesn't work either; such a configuration confuses the
|
55
|
|
- `configure' script while trying to find the cross and native C
|
56
|
|
- compilers.
|
57
|
|
-
|
58
|
|
-
|
59
|
|
- 2.2. The prefix to install FreeType2
|
60
|
|
-
|
61
|
|
- Setting `--prefix=<prefix>' properly is important. The prefix
|
62
|
|
- to install FreeType2 is written into the `freetype-config'
|
63
|
|
- script and `freetype2.pc' configuration file.
|
64
|
|
-
|
65
|
|
- If the built FreeType 2 library is used as a part of the
|
66
|
|
- cross-building system, the prefix is expected to be different
|
67
|
|
- from the self-building system. For example, a configuration
|
68
|
|
- with `--prefix=/usr/local' installs binaries into the
|
69
|
|
- system-wide `/usr/local' directory, which then can't be executed
|
70
|
|
- due to the incorrect architecture. This causes confusion in
|
71
|
|
- configuration of all applications that use FreeType2. Instead,
|
72
|
|
- use a prefix to install the cross-build into a separate system
|
73
|
|
- tree, for example, `--prefix=/usr/local/mips-ip22-linux/'.
|
74
|
|
-
|
75
|
|
- On the other hand, if the built FreeType 2 library is used as a
|
76
|
|
- part of the target system, the prefix to install should reflect
|
77
|
|
- the file system structure of the target system.
|
78
|
|
-
|
79
|
|
-
|
80
|
|
- 2.3. Library dependencies
|
81
|
|
-
|
82
|
|
- FreeType normally depends on external libraries like `libpng' or
|
83
|
|
- `libharfbuzz'. The easiest case is to deactivate all such
|
84
|
|
- dependencies using the `--without-XXX' configuration options.
|
85
|
|
- However, if you want to use those libraries, you should ensure
|
86
|
|
- that they are available both on the target system and as
|
87
|
|
- (cross-compiled) libraries on the build system.
|
88
|
|
-
|
89
|
|
- FreeType uses `pkg-config' to find most of the libraries; the
|
90
|
|
- other libraries it links to are expected in the standard system
|
91
|
|
- directories. Since the default pkg-config's meta-information
|
92
|
|
- files (like `harfbuzz.pc') of the build platform don't work, use
|
93
|
|
- one of the two possible solutions below.
|
94
|
|
-
|
95
|
|
- o Use pkg-config's meta-information files that are adjusted to
|
96
|
|
- cross-compile and cross-link with the target platform's
|
97
|
|
- libraries. Make sure those files are found before the build
|
98
|
|
- system's default files. Example:
|
99
|
|
-
|
100
|
|
- ./configure \
|
101
|
|
- --build=i386-unknown-freebsd \
|
102
|
|
- --host=mips-ip22-linuxelf \
|
103
|
|
- PKG_CONFIG_LIBDIR="/usr/local/mips-ip22-linux/lib/pkgconfig" \
|
104
|
|
- [other options]
|
105
|
|
-
|
106
|
|
- See the manpage of `pkg-config' for more details.
|
107
|
|
-
|
108
|
|
- o Set variables like LIBPNG_LIBS as additional options to the
|
109
|
|
- `configure' script, overriding the values `pkg-config' would
|
110
|
|
- provide. `configure --help' shows the available environment
|
111
|
|
- variables. Example:
|
112
|
|
-
|
113
|
|
- ./configure \
|
114
|
|
- --build=i386-unknown-freebsd \
|
115
|
|
- --host=mips-ip22-linuxelf \
|
116
|
|
- LIBPNG_CFLAGS="-I/usr/local/mips-ip22-linux/include" \
|
117
|
|
- LIBPNG_LIBS="-L/usr/local/mips-ip22-linux/lib -lpng12" \
|
118
|
|
- [other options]
|
119
|
|
-
|
120
|
|
-
|
121
|
|
- 3. Building command
|
122
|
|
- -------------------
|
123
|
|
-
|
124
|
|
- If the configuration finishes successfully, invoking GNU make
|
125
|
|
- builds FreeType2. Just say
|
126
|
|
-
|
127
|
|
- make
|
128
|
|
-
|
129
|
|
- or
|
130
|
|
-
|
131
|
|
- gmake
|
132
|
|
-
|
133
|
|
- depending on the name the GNU make binary actually has.
|
134
|
|
-
|
135
|
|
-
|
136
|
|
- 4. Installation
|
137
|
|
- ---------------
|
138
|
|
-
|
139
|
|
- Saying
|
140
|
|
-
|
141
|
|
- make install
|
142
|
|
-
|
143
|
|
- as usual to install FreeType2 into the directory tree specified by
|
144
|
|
- the argument of the `--prefix' option.
|
145
|
|
-
|
146
|
|
- As noted in section 2.2, FreeType2 is sometimes configured to be
|
147
|
|
- installed into the system directory of the target system, and
|
148
|
|
- should not be installed in the cross-building system. In such
|
149
|
|
- cases, the make variable `DESTDIR' is useful to change the root
|
150
|
|
- directory in the installation. For example, after
|
151
|
|
-
|
152
|
|
- make DESTDIR=/mnt/target_system_root/ install
|
153
|
|
-
|
154
|
|
- the built FreeType2 library files are installed into the directory
|
155
|
|
- `/mnt/target_system_root/<prefix_in_configure>/lib'.
|
156
|
|
-
|
157
|
|
-
|
158
|
|
- 5. TODO
|
159
|
|
- -------
|
160
|
|
-
|
161
|
|
- Cross building between Cygwin (or MSys) and Unix must be tested.
|
162
|
|
-
|
163
|
|
-
|
164
|
|
-----------------------------------------------------------------------
|
165
|
|
-
|
166
|
|
-Copyright (C) 2006-2023 by
|
167
|
|
-suzuki toshiya, David Turner, Robert Wilhelm, and Werner Lemberg.
|
168
|
|
-
|
169
|
|
-
|
170
|
|
-This file is part of the FreeType project, and may only be used,
|
171
|
|
-modified, and distributed under the terms of the FreeType project
|
172
|
|
-license, LICENSE.TXT. By continuing to use, modify, or distribute
|
173
|
|
-this file you indicate that you have read the license and understand
|
174
|
|
-and accept it fully.
|
175
|
|
-
|
176
|
|
-
|
177
|
|
---- end of INSTALL.CROSS --- |
docs/INSTALL.GNU
deleted
1
|
|
-This document contains instructions how to build the FreeType library
|
2
|
|
-on non-Unix systems with the help of GNU Make. Note that if you are
|
3
|
|
-running Cygwin or MinGW/MSYS in Windows, you should follow the
|
4
|
|
-instructions in the file `INSTALL.UNIX' instead.
|
5
|
|
-
|
6
|
|
-
|
7
|
|
- FreeType 2 includes a powerful and flexible build system that allows
|
8
|
|
- you to easily compile it on a great variety of platforms from the
|
9
|
|
- command line. To do so, just follow these simple instructions.
|
10
|
|
-
|
11
|
|
- 1. Install GNU Make
|
12
|
|
- -------------------
|
13
|
|
-
|
14
|
|
- The FreeType 2 build system relies on many features special to GNU
|
15
|
|
- Make.
|
16
|
|
-
|
17
|
|
- NEARLY ALL OTHER MAKE TOOLS FAIL, INCLUDING `BSD MAKE', SO REALLY
|
18
|
|
- INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM!
|
19
|
|
-
|
20
|
|
- Note that make++, a make tool written in Perl, supports enough
|
21
|
|
- features of GNU make to compile FreeType. See
|
22
|
|
-
|
23
|
|
- https://makepp.sourceforge.net
|
24
|
|
-
|
25
|
|
- for more information; you need version 2.0 or newer, and you must
|
26
|
|
- pass option `--norc-substitution'.
|
27
|
|
-
|
28
|
|
- Make sure that you are invoking GNU Make from the command line, by
|
29
|
|
- typing something like:
|
30
|
|
-
|
31
|
|
- make -v
|
32
|
|
-
|
33
|
|
- to display its version number.
|
34
|
|
-
|
35
|
|
- VERSION 3.81 OR NEWER IS NEEDED!
|
36
|
|
-
|
37
|
|
-
|
38
|
|
- 2. Invoke `make'
|
39
|
|
- ----------------
|
40
|
|
-
|
41
|
|
- Go to the root directory of FreeType 2, then simply invoke GNU
|
42
|
|
- Make from the command line. This will launch the FreeType 2 host
|
43
|
|
- platform detection routines. A summary will be displayed, for
|
44
|
|
- example, on Win32.
|
45
|
|
-
|
46
|
|
-
|
47
|
|
- ==============================================================
|
48
|
|
- FreeType build system -- automatic system detection
|
49
|
|
-
|
50
|
|
- The following settings are used:
|
51
|
|
-
|
52
|
|
- platform windows
|
53
|
|
- compiler gcc
|
54
|
|
- configuration directory .\builds\windows
|
55
|
|
- configuration rules .\builds\windows\w32-gcc.mk
|
56
|
|
-
|
57
|
|
- If this does not correspond to your system or settings please
|
58
|
|
- remove the file 'config.mk' from this directory then read the
|
59
|
|
- INSTALL file for help.
|
60
|
|
-
|
61
|
|
- Otherwise, simply type 'make' again to build the library
|
62
|
|
- or 'make refdoc' to build the API reference (the latter needs
|
63
|
|
- Python >= 3.5).
|
64
|
|
- =============================================================
|
65
|
|
-
|
66
|
|
-
|
67
|
|
- If the detected settings correspond to your platform and compiler,
|
68
|
|
- skip to step 5. Note that if your platform is completely alien to
|
69
|
|
- the build system, the detected platform will be `ansi'.
|
70
|
|
-
|
71
|
|
-
|
72
|
|
- 3. Configure the build system for a different compiler
|
73
|
|
- ------------------------------------------------------
|
74
|
|
-
|
75
|
|
- If the build system correctly detected your platform, but you want
|
76
|
|
- to use a different compiler than the one specified in the summary
|
77
|
|
- (for most platforms, gcc is the default compiler), invoke GNU Make
|
78
|
|
- with
|
79
|
|
-
|
80
|
|
- make setup <compiler>
|
81
|
|
-
|
82
|
|
- Examples:
|
83
|
|
-
|
84
|
|
- to use Visual C++ on Win32, type: `make setup visualc'
|
85
|
|
- to use Borland C++ on Win32, type `make setup bcc32'
|
86
|
|
- to use Watcom C++ on Win32, type `make setup watcom'
|
87
|
|
- to use Intel C++ on Win32, type `make setup intelc'
|
88
|
|
- to use LCC-Win32 on Win32, type: `make setup lcc'
|
89
|
|
- to use Watcom C++ on OS/2, type `make setup watcom'
|
90
|
|
- to use VisualAge C++ on OS/2, type `make setup visualage'
|
91
|
|
-
|
92
|
|
- The <compiler> name to use is platform-dependent. The list of
|
93
|
|
- available compilers for your system is available in the file
|
94
|
|
- `builds/<system>/detect.mk'.
|
95
|
|
-
|
96
|
|
- If you are satisfied by the new configuration summary, skip to
|
97
|
|
- step 5.
|
98
|
|
-
|
99
|
|
-
|
100
|
|
- 3a. Use clang instead of gcc
|
101
|
|
- ----------------------------
|
102
|
|
-
|
103
|
|
- The `clang' compiler can use FreeType's setup for `gcc'; it is
|
104
|
|
- sufficient to set the `CC' variable, for example
|
105
|
|
-
|
106
|
|
- make CC=clang
|
107
|
|
-
|
108
|
|
-
|
109
|
|
- 3b. Compiling with a C++ compiler
|
110
|
|
- ---------------------------------
|
111
|
|
-
|
112
|
|
- FreeType can be built with a C++ compiler, for example
|
113
|
|
-
|
114
|
|
- make CC="g++"
|
115
|
|
-
|
116
|
|
- If `clang++' should be used it is necessary to also override the
|
117
|
|
- `ANSIFLAGS' variable:
|
118
|
|
-
|
119
|
|
- make CC="clang++" ANSIFLAGS=""
|
120
|
|
-
|
121
|
|
-
|
122
|
|
- 4. Configure the build system for an unknown platform/compiler
|
123
|
|
- --------------------------------------------------------------
|
124
|
|
-
|
125
|
|
- The auto-detection/setup phase of the build system copies a file
|
126
|
|
- to the current directory under the name `config.mk'.
|
127
|
|
-
|
128
|
|
- For example, on OS/2+gcc, it would simply copy
|
129
|
|
- `builds/os2/os2-gcc.mk' to `./config.mk'.
|
130
|
|
-
|
131
|
|
- If for some reason your platform isn't correctly detected, copy
|
132
|
|
- manually the configuration sub-makefile to `./config.mk' and go to
|
133
|
|
- step 5.
|
134
|
|
-
|
135
|
|
- Note that this file is a sub-Makefile used to specify Make
|
136
|
|
- variables for compiler and linker invocation during the build.
|
137
|
|
- You can easily create your own version from one of the existing
|
138
|
|
- configuration files, then copy it to the current directory under
|
139
|
|
- the name `./config.mk'.
|
140
|
|
-
|
141
|
|
-
|
142
|
|
- 5. Build the library
|
143
|
|
- --------------------
|
144
|
|
-
|
145
|
|
- The auto-detection/setup phase should have copied a file in the
|
146
|
|
- current directory, called `./config.mk'. This file contains
|
147
|
|
- definitions of various Make variables used to invoke the compiler
|
148
|
|
- and linker during the build. [It has also generated a file called
|
149
|
|
- `ftmodule.h' in the objects directory (which is normally
|
150
|
|
- `<toplevel>/objs/'); please read the file `docs/CUSTOMIZE' for
|
151
|
|
- customization of FreeType.]
|
152
|
|
-
|
153
|
|
- To launch the build, simply invoke GNU Make again: The top
|
154
|
|
- Makefile will detect the configuration file and run the build with
|
155
|
|
- it. If you have used variables in step 3, you must use the same
|
156
|
|
- variables here, too.
|
157
|
|
-
|
158
|
|
-
|
159
|
|
- Final note
|
160
|
|
-
|
161
|
|
- The above instructions build a _statically_ linked library of the
|
162
|
|
- font engine in the `objs' directory. On Windows, you can build a
|
163
|
|
- DLL either with MinGW (within an MSYS shell, following the
|
164
|
|
- instructions in `INSTALL.UNIX'), or you use one of the Visual C++
|
165
|
|
- project files; see the subdirectories of `builds/windows'. For
|
166
|
|
- everything else, you are on your own, and you might follow the
|
167
|
|
- instructions in `INSTALL.ANY' to create your own Makefiles.
|
168
|
|
-
|
169
|
|
-----------------------------------------------------------------------
|
170
|
|
-
|
171
|
|
-Copyright (C) 2003-2023 by
|
172
|
|
-David Turner, Robert Wilhelm, and Werner Lemberg.
|
173
|
|
-
|
174
|
|
-This file is part of the FreeType project, and may only be used,
|
175
|
|
-modified, and distributed under the terms of the FreeType project
|
176
|
|
-license, LICENSE.TXT. By continuing to use, modify, or distribute
|
177
|
|
-this file you indicate that you have read the license and understand
|
178
|
|
-and accept it fully.
|
179
|
|
-
|
180
|
|
-
|
181
|
|
---- end of INSTALL.GNU --- |
docs/INSTALL.MAC
deleted
1
|
|
-Please follow the instructions in INSTALL.UNIX to install FreeType on
|
2
|
|
-Mac OS X.
|
3
|
|
-
|
4
|
|
-Currently FreeType2 functions based on some deprecated Carbon APIs
|
5
|
|
-return `FT_Err_Unimplemented_Feature' always, even if FreeType2 is
|
6
|
|
-configured and built on the system that deprecated Carbon APIs are
|
7
|
|
-available. To enable deprecated FreeType2 functions as far as
|
8
|
|
-possible, replace `src/base/ftmac.c' by `builds/mac/ftmac.c'.
|
9
|
|
-
|
10
|
|
-Starting with Mac OS X 10.5, gcc defaults the deployment target to
|
11
|
|
-10.5. In previous versions of Mac OS X, this defaulted to 10.1. If
|
12
|
|
-you want your built binaries to run only on 10.5, this change does not
|
13
|
|
-concern you. If you want them to also run on older versions of Mac
|
14
|
|
-OS X, then you must either set the MACOSX_DEPLOYMENT_TARGET
|
15
|
|
-environment variable or pass `-mmacosx-version-min' to gcc. You
|
16
|
|
-should specify the oldest version of Mac OS you want the code to run
|
17
|
|
-on. For example, if you use Bourne shell:
|
18
|
|
-
|
19
|
|
- export MACOSX_DEPLOYMENT_TARGET=10.2
|
20
|
|
-
|
21
|
|
-or, if you use C shell:
|
22
|
|
-
|
23
|
|
- setenv MACOSX_DEPLOYMENT_TARGET 10.2
|
24
|
|
-
|
25
|
|
-Alternatively, you could pass `-mmacosx-version-min=10.2' to gcc.
|
26
|
|
-
|
27
|
|
-Here the number 10.2 is the lowest version that the built binaries can
|
28
|
|
-run on. In the above cases, the built binaries will run on Mac OS X
|
29
|
|
-10.2 and later, but _not_ earlier. If you want to run on earlier, you
|
30
|
|
-have to set lower version, e.g., 10.0.
|
31
|
|
-
|
32
|
|
-For classic Mac OS (Mac OS 7, 8, 9) please refer to builds/mac/README. |
docs/INSTALL.UNIX
deleted
1
|
|
-This document contains instructions on how to build the FreeType
|
2
|
|
-library on Unix systems. This also works for emulations like Cygwin
|
3
|
|
-or MSys on Win32:
|
4
|
|
-
|
5
|
|
-
|
6
|
|
- 1. Ensure that you are using GNU Make
|
7
|
|
- -------------------------------------
|
8
|
|
-
|
9
|
|
- The FreeType build system _exclusively_ works with GNU Make. You
|
10
|
|
- will not be able to compile the library with the instructions
|
11
|
|
- below using any other alternative (including BSD Make).
|
12
|
|
-
|
13
|
|
- Check that you have GNU make by running the command:
|
14
|
|
-
|
15
|
|
- make -v
|
16
|
|
-
|
17
|
|
- This should dump some text that begins with:
|
18
|
|
-
|
19
|
|
- GNU Make <version number>
|
20
|
|
- Copyright (C) <year> Free Software Foundation Inc.
|
21
|
|
-
|
22
|
|
- Note that version 3.81 or higher is *required* or the build will
|
23
|
|
- fail.
|
24
|
|
-
|
25
|
|
- It is also fine to have GNU Make under another name (e.g. 'gmake')
|
26
|
|
- if you use the MAKE variable as described below.
|
27
|
|
-
|
28
|
|
- As a special exception, 'makepp' can also be used to build
|
29
|
|
- FreeType 2. See the file docs/MAKEPP for details.
|
30
|
|
-
|
31
|
|
- For builds with `cmake' please check file `CMakeLists.txt'; this
|
32
|
|
- is a contributed file not directly supported by the FreeType team.
|
33
|
|
-
|
34
|
|
-
|
35
|
|
- 2. Regenerate the configure script if needed
|
36
|
|
- --------------------------------------------
|
37
|
|
-
|
38
|
|
- This only applies if you are building a git snapshot or checkout,
|
39
|
|
- *not* if you grabbed the sources of an official release.
|
40
|
|
-
|
41
|
|
- You need to invoke the `autogen.sh' script in the top-level
|
42
|
|
- directory in order to create the `configure' script for your
|
43
|
|
- platform. Normally, this simply means typing:
|
44
|
|
-
|
45
|
|
- sh autogen.sh
|
46
|
|
-
|
47
|
|
- In case of problems, you may need to install or upgrade Automake,
|
48
|
|
- Autoconf or Libtool. See `README.git' in the top-level directory
|
49
|
|
- for more information.
|
50
|
|
-
|
51
|
|
-
|
52
|
|
- 3. Build and install the library
|
53
|
|
- --------------------------------
|
54
|
|
-
|
55
|
|
- Say
|
56
|
|
-
|
57
|
|
- ./configure --help
|
58
|
|
-
|
59
|
|
- to see the list of possible configuration options and important
|
60
|
|
- environment variables. The ./configure script will detect some
|
61
|
|
- prerequisite system libraries (libpng, brotli, etc.) if their
|
62
|
|
- headers are available at the default locations.
|
63
|
|
-
|
64
|
|
- The following should work on all Unix systems where the `make'
|
65
|
|
- command invokes GNU Make:
|
66
|
|
-
|
67
|
|
- ./configure [options]
|
68
|
|
- make
|
69
|
|
- make install (as root)
|
70
|
|
-
|
71
|
|
- The default installation path is `/usr/local'. It can be changed
|
72
|
|
- with the `--prefix=<path>' option. Example:
|
73
|
|
-
|
74
|
|
- ./configure --prefix=/usr
|
75
|
|
-
|
76
|
|
- When using a different command to invoke GNU Make, use the MAKE
|
77
|
|
- variable. For example, if `gmake' is the command to use on your
|
78
|
|
- system, do something like:
|
79
|
|
-
|
80
|
|
- MAKE=gmake ./configure [options]
|
81
|
|
- gmake
|
82
|
|
- gmake install (as root)
|
83
|
|
-
|
84
|
|
- If this still doesn't work, there must be a problem with your
|
85
|
|
- system (e.g., you are using a very old version of GNU Make).
|
86
|
|
-
|
87
|
|
- For library identification, FreeType's `configure' script uses the
|
88
|
|
- `pkg-config' interface: Assuming it needs library `foo', it calls
|
89
|
|
- the `pkg-config' program to find information on library `foo',
|
90
|
|
- which in turn looks for a `foo.pc' file installed at the system.
|
91
|
|
- Some platforms, however, don't come with `pkg-support'; you then
|
92
|
|
- have to use environment variables as described by `configure
|
93
|
|
- --help'. Example:
|
94
|
|
-
|
95
|
|
- LIBPNG_CFLAGS="-I/path/to/libpng/include/directory" \
|
96
|
|
- LIBPNG_LIBS="-L/path/to/libpng/lib/directory" \
|
97
|
|
- configure ...
|
98
|
|
-
|
99
|
|
- It is possible to compile FreeType in a different directory.
|
100
|
|
- Assuming the FreeType source files in directory `/src/freetype' a
|
101
|
|
- compilation in directory `foo' works as follows:
|
102
|
|
-
|
103
|
|
- cd foo
|
104
|
|
- /src/freetype/configure [options]
|
105
|
|
- make
|
106
|
|
- make install
|
107
|
|
-
|
108
|
|
-
|
109
|
|
- 3.1 Interdependency with HarfBuzz
|
110
|
|
- .................................
|
111
|
|
-
|
112
|
|
- Note that there is a chicken-and-egg problem currently since the
|
113
|
|
- HarfBuzz library (used by the auto-hinter to improve support of
|
114
|
|
- OpenType fonts) depends on FreeType, which can be solved as
|
115
|
|
- follows in case HarfBuzz is not yet installed on your system.
|
116
|
|
-
|
117
|
|
- 1. Call FreeType's `configure' script with option
|
118
|
|
- `--without-harfbuzz', then compile and install FreeType.
|
119
|
|
-
|
120
|
|
- 2. Compile and install HarfBuzz.
|
121
|
|
-
|
122
|
|
- 3. Call FreeType's `configure' script without option
|
123
|
|
- `--without-harfbuzz' (after executing `make distclean'), then
|
124
|
|
- compile and install FreeType again.
|
125
|
|
-
|
126
|
|
-
|
127
|
|
-----------------------------------------------------------------------
|
128
|
|
-
|
129
|
|
-Copyright (C) 2003-2023 by
|
130
|
|
-David Turner, Robert Wilhelm, and Werner Lemberg.
|
131
|
|
-
|
132
|
|
-This file is part of the FreeType project, and may only be used,
|
133
|
|
-modified, and distributed under the terms of the FreeType project
|
134
|
|
-license, LICENSE.TXT. By continuing to use, modify, or distribute
|
135
|
|
-this file you indicate that you have read the license and understand
|
136
|
|
-and accept it fully.
|
137
|
|
-
|
138
|
|
-
|
139
|
|
---- end of INSTALL.UNIX --- |
docs/INSTALL_ANDROID.md
|
1
|
+# Compiling FreeType on Android using Termux
|
|
2
|
+
|
|
3
|
+If you want to test FreeType on arm devices, compiling it on an Android
|
|
4
|
+phone is one of the easiest ways.
|
|
5
|
+
|
|
6
|
+## 1. Compiling FreeType
|
|
7
|
+
|
|
8
|
+1. Install and open termux
|
|
9
|
+
|
|
10
|
+2. Update termux packages using:
|
|
11
|
+
|
|
12
|
+ ```bash
|
|
13
|
+ pkg update
|
|
14
|
+ pkg upgrade
|
|
15
|
+ ```
|
|
16
|
+ Select `y` if any configuration changes are asked
|
|
17
|
+
|
|
18
|
+3. Install `git`:
|
|
19
|
+
|
|
20
|
+ ```bash
|
|
21
|
+ pkg install git
|
|
22
|
+ ```
|
|
23
|
+4. Install packages required for compilation:
|
|
24
|
+
|
|
25
|
+ ```bash
|
|
26
|
+ pkg install automake autoconf libtool make clang binutils
|
|
27
|
+ ```
|
|
28
|
+
|
|
29
|
+5. Clone FreeType's git repository:
|
|
30
|
+
|
|
31
|
+ ```bash
|
|
32
|
+ git clone https://gitlab.freedesktop.org/freetype/freetype.git
|
|
33
|
+ ```
|
|
34
|
+
|
|
35
|
+6. Enter into the source directory:
|
|
36
|
+
|
|
37
|
+ ```
|
|
38
|
+ cd freetype/
|
|
39
|
+ ```
|
|
40
|
+
|
|
41
|
+7. Now you can compile FreeType according to [INSTALL_UNIX.md]:
|
|
42
|
+
|
|
43
|
+ ```bash
|
|
44
|
+ ./autogen.sh
|
|
45
|
+ ./configure
|
|
46
|
+ make -j$(nproc)
|
|
47
|
+ ```
|
|
48
|
+ The compiled binaries can be accessed under `objs/.libs`
|
|
49
|
+
|
|
50
|
+## 2. Compiling FreeType Demo programs
|
|
51
|
+If you need to test your changes you may want to use ft-demo
|
|
52
|
+programs. They can be compiled and run by follwing these steps:
|
|
53
|
+
|
|
54
|
+1. First compile FreeType using the steps above.
|
|
55
|
+
|
|
56
|
+2. Clone FreeType demos adjacent to the `freetype/` directory:
|
|
57
|
+
|
|
58
|
+ ```bash
|
|
59
|
+ git clone https://gitlab.freedesktop.org/freetype/freetype-demos.git
|
|
60
|
+ ```
|
|
61
|
+ i.e. If you can access FreeType repo under `~/freetype`, you should
|
|
62
|
+ be able to access `~/freetype-demos`.
|
|
63
|
+
|
|
64
|
+3. Enter into the ft-demos directory:
|
|
65
|
+
|
|
66
|
+ ```bash
|
|
67
|
+ cd freetype-demos
|
|
68
|
+ ```
|
|
69
|
+
|
|
70
|
+4. Compile the programs:
|
|
71
|
+
|
|
72
|
+ ```bash
|
|
73
|
+ make
|
|
74
|
+ ```
|
|
75
|
+
|
|
76
|
+5. The compiled binaries can be accessed and executed under `bin/` like:
|
|
77
|
+
|
|
78
|
+ ```bash
|
|
79
|
+ cd bin
|
|
80
|
+ ./ftlint
|
|
81
|
+ ```
|
|
82
|
+
|
|
83
|
+<!---->
|
|
84
|
+
|
|
85
|
+[INSTALL_UNIX.md]: ./INSTALL_UNIX.md |
docs/INSTALL_ANY.md
|
1
|
+# Instructions on how to build FreeType with your own build tool
|
|
2
|
+
|
|
3
|
+See the file [docs/CUSTOMIZE][CUSTOMIZE] to learn how to
|
|
4
|
+customize FreeType to specific environments.
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+## A. Standard procedure
|
|
8
|
+
|
|
9
|
+If you use macro names for FreeType header files (while mandatory
|
|
10
|
+in earlier versions, this is now optional since FreeType version
|
|
11
|
+2.6.1) it is necessary to disable pre-compiled headers. This is
|
|
12
|
+very important for Visual C++, because lines like
|
|
13
|
+
|
|
14
|
+```C
|
|
15
|
+ #include FT_FREETYPE_H
|
|
16
|
+```
|
|
17
|
+are not correctly supported by this compiler while being ISO C
|
|
18
|
+compliant!
|
|
19
|
+
|
|
20
|
+You need to add the directory `include` to your include path when
|
|
21
|
+compiling the library.
|
|
22
|
+
|
|
23
|
+FreeType 2 is made of several components; each of them is located
|
|
24
|
+in a subdirectory of `freetype/src`. For example,
|
|
25
|
+`freetype/src/truetype/` contains the TrueType font driver.
|
|
26
|
+
|
|
27
|
+## DO NOT COMPILE ALL C FILES! Rather, compile the following ones.
|
|
28
|
+
|
|
29
|
+### base components (required):
|
|
30
|
+
|
|
31
|
+ src/base/ftsystem.c
|
|
32
|
+ src/base/ftinit.c
|
|
33
|
+ src/base/ftdebug.c
|
|
34
|
+
|
|
35
|
+ src/base/ftbase.c
|
|
36
|
+
|
|
37
|
+ src/base/ftbbox.c -- recommended, see <ftbbox.h>
|
|
38
|
+ src/base/ftglyph.c -- recommended, see <ftglyph.h>
|
|
39
|
+
|
|
40
|
+ src/base/ftbdf.c -- optional, see <ftbdf.h>
|
|
41
|
+ src/base/ftbitmap.c -- optional, see <ftbitmap.h>
|
|
42
|
+ src/base/ftcid.c -- optional, see <ftcid.h>
|
|
43
|
+ src/base/ftfstype.c -- optional
|
|
44
|
+ src/base/ftgasp.c -- optional, see <ftgasp.h>
|
|
45
|
+ src/base/ftgxval.c -- optional, see <ftgxval.h>
|
|
46
|
+ src/base/ftmm.c -- optional, see <ftmm.h>
|
|
47
|
+ src/base/ftotval.c -- optional, see <ftotval.h>
|
|
48
|
+ src/base/ftpatent.c -- optional
|
|
49
|
+ src/base/ftpfr.c -- optional, see <ftpfr.h>
|
|
50
|
+ src/base/ftstroke.c -- optional, see <ftstroke.h>
|
|
51
|
+ src/base/ftsynth.c -- optional, see <ftsynth.h>
|
|
52
|
+ src/base/fttype1.c -- optional, see <t1tables.h>
|
|
53
|
+ src/base/ftwinfnt.c -- optional, see <ftwinfnt.h>
|
|
54
|
+
|
|
55
|
+ src/base/ftmac.c -- only on the Macintosh
|
|
56
|
+
|
|
57
|
+### font drivers (optional; at least one is needed)
|
|
58
|
+
|
|
59
|
+ src/bdf/bdf.c -- BDF font driver
|
|
60
|
+ src/cff/cff.c -- CFF/OpenType font driver
|
|
61
|
+ src/cid/type1cid.c -- Type 1 CID-keyed font driver
|
|
62
|
+ src/pcf/pcf.c -- PCF font driver
|
|
63
|
+ src/pfr/pfr.c -- PFR/TrueDoc font driver
|
|
64
|
+ src/sfnt/sfnt.c -- SFNT files support
|
|
65
|
+ (TrueType & OpenType)
|
|
66
|
+ src/truetype/truetype.c -- TrueType font driver
|
|
67
|
+ src/type1/type1.c -- Type 1 font driver
|
|
68
|
+ src/type42/type42.c -- Type 42 font driver
|
|
69
|
+ src/winfonts/winfnt.c -- Windows FONT / FNT font driver
|
|
70
|
+
|
|
71
|
+### rasterizers (optional; at least one is needed for vector formats)
|
|
72
|
+
|
|
73
|
+ src/raster/raster.c -- monochrome rasterizer
|
|
74
|
+ src/sdf/sdf.c -- Signed Distance Field driver
|
|
75
|
+ src/smooth/smooth.c -- anti-aliasing rasterizer
|
|
76
|
+
|
|
77
|
+### auxiliary modules (optional)
|
|
78
|
+
|
|
79
|
+ src/autofit/autofit.c -- auto hinting module
|
|
80
|
+ src/cache/ftcache.c -- cache sub-system (in beta)
|
|
81
|
+ src/gzip/ftgzip.c -- support for compressed fonts (.gz)
|
|
82
|
+ src/lzw/ftlzw.c -- support for compressed fonts (.Z)
|
|
83
|
+ src/bzip2/ftbzip2.c -- support for compressed fonts (.bz2)
|
|
84
|
+ src/gxvalid/gxvalid.c -- TrueTypeGX/AAT table validation
|
|
85
|
+ src/otvalid/otvalid.c -- OpenType table validation
|
|
86
|
+ src/psaux/psaux.c -- PostScript Type 1 parsing
|
|
87
|
+ src/pshinter/pshinter.c -- PS hinting module
|
|
88
|
+ src/psnames/psnames.c -- PostScript glyph names support
|
|
89
|
+
|
|
90
|
+
|
|
91
|
+## Notes:
|
|
92
|
+
|
|
93
|
+ `ftcache.c` needs `ftglyph.c`
|
|
94
|
+ `ftfstype.c` needs `fttype1.c`
|
|
95
|
+ `ftglyph.c` needs `ftbitmap.c`
|
|
96
|
+ `ftstroke.c` needs `ftglyph.c`
|
|
97
|
+ `ftsynth.c` needs `ftbitmap.c`
|
|
98
|
+
|
|
99
|
+ `cff.c` needs `sfnt.c`, `pshinter.c`, and `psnames.c`
|
|
100
|
+ `truetype.c` needs `sfnt.c` and `psnames.c`
|
|
101
|
+ `type1.c` needs `psaux.c` `pshinter.c`, and `psnames.c`
|
|
102
|
+ `type1cid.c` needs `psaux.c`, `pshinter.c`, and `psnames.c`
|
|
103
|
+ `type42.c` needs `truetype.c`
|
|
104
|
+
|
|
105
|
+Please consult the central `include/freetype/config/ftoption.h`
|
|
106
|
+configuration file for details on additional libraries necessary
|
|
107
|
+for some optional features.
|
|
108
|
+
|
|
109
|
+Read the file `CUSTOMIZE` in case you want to compile only a subset
|
|
110
|
+of the drivers, renderers, and optional modules; a detailed
|
|
111
|
+description of the various base extension is given in the top-level
|
|
112
|
+file `modules.cfg`.
|
|
113
|
+
|
|
114
|
+You are done. In case of problems, see the archives of the FreeType
|
|
115
|
+development mailing list.
|
|
116
|
+
|
|
117
|
+
|
|
118
|
+## B. Support for flat-directory compilation
|
|
119
|
+
|
|
120
|
+It is possible to put all FreeType 2 source files into a single
|
|
121
|
+directory, with the *exception* of the `include` hierarchy.
|
|
122
|
+
|
|
123
|
+Copy all files in current directory
|
|
124
|
+
|
|
125
|
+ cp freetype/src/base/*.[hc] .
|
|
126
|
+ cp freetype/src/raster1/*.[hc] .
|
|
127
|
+ cp freetype/src/smooth/*.[hc] .
|
|
128
|
+ etc.
|
|
129
|
+
|
|
130
|
+Compile sources
|
|
131
|
+
|
|
132
|
+ cc -c -Iinclude -DFT2_BUILD_LIBRARY ftsystem.c
|
|
133
|
+ cc -c -Iinclude -DFT2_BUILD_LIBRARY ftinit.c
|
|
134
|
+ cc -c -Iinclude -DFT2_BUILD_LIBRARY ftdebug.c
|
|
135
|
+ cc -c -Iinclude -DFT2_BUILD_LIBRARY ftbase.c
|
|
136
|
+ etc.
|
|
137
|
+
|
|
138
|
+You don't need to define the FT_FLAT_COMPILATION macro (as this
|
|
139
|
+was required in previous releases of FreeType 2).
|
|
140
|
+
|
|
141
|
+---
|
|
142
|
+```
|
|
143
|
+Copyright (C) 2003-2023 by
|
|
144
|
+David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
145
|
+
|
|
146
|
+This file is part of the FreeType project, and may only be used,
|
|
147
|
+modified, and distributed under the terms of the FreeType project
|
|
148
|
+license, LICENSE.TXT. By continuing to use, modify, or distribute
|
|
149
|
+this file you indicate that you have read the license and understand
|
|
150
|
+and accept it fully.
|
|
151
|
+```
|
|
152
|
+
|
|
153
|
+<!---->
|
|
154
|
+[CUSTOMIZE]: ./CUSTOMIZE |
docs/INSTALL_CROSS.md
|
1
|
+# Cross-Compiling FreeType
|
|
2
|
+
|
|
3
|
+This document contains instructions on how to cross-build the FreeType
|
|
4
|
+library on Unix systems, for example, building binaries for Linux/MIPS
|
|
5
|
+on FreeBSD/i386. Before reading this document, please consult the
|
|
6
|
+file [INSTALL_UNIX.md] for required tools and the basic self-building
|
|
7
|
+procedure.
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+## 1. Required Tools
|
|
11
|
+
|
|
12
|
+For self-building the FreeType library on a Unix system, GNU Make
|
|
13
|
+3.81 or newer is required. [INSTALL_UNIX.md contains hints how to
|
|
14
|
+check the installed `make`.
|
|
15
|
+
|
|
16
|
+The GNU C compiler to cross-build the target system is required.
|
|
17
|
+Currently, using a non-GNU cross compiler is untested. The cross
|
|
18
|
+compiler is expected to be installed with a system prefix. For
|
|
19
|
+example, if your building system is FreeBSD/i386 and the target
|
|
20
|
+system is Linux/MIPS, the cross compiler should be installed with
|
|
21
|
+the name `mips-ip22-linuxelf-gcc`.
|
|
22
|
+
|
|
23
|
+A C compiler for a self-build is required also, to build a tool
|
|
24
|
+(`apinames`) that is executed during the build procedure. Non-GNU
|
|
25
|
+self compilers are acceptable, but such a setup is untested.
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+## 2. Configuration
|
|
29
|
+
|
|
30
|
+### 2.1 Building and target system
|
|
31
|
+
|
|
32
|
+To configure a cross-build, the options `--host=<system>` and
|
|
33
|
+`--build=<system>` must be passed to the `configure` script.
|
|
34
|
+For example, if your build system is FreeBSD/i386 and the target
|
|
35
|
+system is Linux/MIPS, say
|
|
36
|
+
|
|
37
|
+```bash
|
|
38
|
+ ./configure \
|
|
39
|
+ --build=i386-unknown-freebsd \
|
|
40
|
+ --host=mips-ip22-linuxelf \
|
|
41
|
+ [other options]
|
|
42
|
+```
|
|
43
|
+
|
|
44
|
+It should be noted that `--host=<system>` specifies the system
|
|
45
|
+where the built binaries will be executed, not the system where
|
|
46
|
+the build actually happens. Older versions of GNU autoconf use
|
|
47
|
+the option pair `--host=` and `--target=`. This is broken and
|
|
48
|
+doesn't work. Similarly, an explicit CC specification like
|
|
49
|
+
|
|
50
|
+```bash
|
|
51
|
+ env CC=mips-ip22-linux-gcc ./configure # BAD
|
|
52
|
+```
|
|
53
|
+or
|
|
54
|
+
|
|
55
|
+```bash
|
|
56
|
+ env CC=/usr/local/mips-ip22-linux/bin/gcc ./configure # BAD
|
|
57
|
+```
|
|
58
|
+
|
|
59
|
+doesn't work either; such a configuration confuses the
|
|
60
|
+`configure` script while trying to find the cross and native C
|
|
61
|
+compilers.
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+### 2.2. The prefix to install FreeType2
|
|
65
|
+
|
|
66
|
+Setting `--prefix=<prefix>` properly is important. The prefix
|
|
67
|
+to install FreeType2 is written into the `freetype-config`
|
|
68
|
+script and `freetype2.pc` configuration file.
|
|
69
|
+
|
|
70
|
+If the built FreeType 2 library is used as a part of the
|
|
71
|
+cross-building system, the prefix is expected to be different
|
|
72
|
+from the self-building system. For example, a configuration
|
|
73
|
+with `--prefix=/usr/local` installs binaries into the
|
|
74
|
+system-wide `/usr/local` directory, which then can't be executed
|
|
75
|
+due to the incorrect architecture. This causes confusion in
|
|
76
|
+configuration of all applications that use FreeType2. Instead,
|
|
77
|
+use a prefix to install the cross-build into a separate system
|
|
78
|
+tree, for example, `--prefix=/usr/local/mips-ip22-linux/`.
|
|
79
|
+
|
|
80
|
+On the other hand, if the built FreeType 2 library is used as a
|
|
81
|
+part of the target system, the prefix to install should reflect
|
|
82
|
+the file system structure of the target system.
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+### 2.3. Library dependencies
|
|
86
|
+
|
|
87
|
+FreeType normally depends on external libraries like `libpng` or
|
|
88
|
+`libharfbuzz`. The easiest case is to deactivate all such
|
|
89
|
+dependencies using the `--without-XXX` configuration options.
|
|
90
|
+However, if you want to use those libraries, you should ensure
|
|
91
|
+that they are available both on the target system and as
|
|
92
|
+(cross-compiled) libraries on the build system.
|
|
93
|
+
|
|
94
|
+FreeType uses `pkg-config` to find most of the libraries; the
|
|
95
|
+other libraries it links to are expected in the standard system
|
|
96
|
+directories. Since the default pkg-config's meta-information
|
|
97
|
+files (like `harfbuzz.pc`) of the build platform don't work, use
|
|
98
|
+one of the two possible solutions below.
|
|
99
|
+
|
|
100
|
+- Use pkg-config's meta-information files that are adjusted to
|
|
101
|
+ cross-compile and cross-link with the target platform's
|
|
102
|
+ libraries. Make sure those files are found before the build
|
|
103
|
+ system's default files. Example:
|
|
104
|
+ ```bash
|
|
105
|
+ ./configure \
|
|
106
|
+ --build=i386-unknown-freebsd \
|
|
107
|
+ --host=mips-ip22-linuxelf \
|
|
108
|
+ PKG_CONFIG_LIBDIR="/usr/local/mips-ip22-linux/lib/pkgconfig" \
|
|
109
|
+ [other options]
|
|
110
|
+ ```
|
|
111
|
+
|
|
112
|
+ See the manpage of `pkg-config` for more details.
|
|
113
|
+
|
|
114
|
+- Set variables like LIBPNG_LIBS as additional options to the
|
|
115
|
+ `configure` script, overriding the values `pkg-config` would
|
|
116
|
+ provide. `configure --help` shows the available environment
|
|
117
|
+ variables. Example:
|
|
118
|
+ ```bash
|
|
119
|
+ ./configure \
|
|
120
|
+ --build=i386-unknown-freebsd \
|
|
121
|
+ --host=mips-ip22-linuxelf \
|
|
122
|
+ LIBPNG_CFLAGS="-I/usr/local/mips-ip22-linux/include" \
|
|
123
|
+ LIBPNG_LIBS="-L/usr/local/mips-ip22-linux/lib -lpng12" \
|
|
124
|
+ [other options]
|
|
125
|
+ ```
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+## 3. Building command
|
|
129
|
+
|
|
130
|
+If the configuration finishes successfully, invoking GNU make
|
|
131
|
+builds FreeType2. Just say
|
|
132
|
+
|
|
133
|
+ make
|
|
134
|
+
|
|
135
|
+or
|
|
136
|
+
|
|
137
|
+ gmake
|
|
138
|
+
|
|
139
|
+depending on the name the GNU make binary actually has.
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+## 4. Installation
|
|
143
|
+
|
|
144
|
+Saying
|
|
145
|
+
|
|
146
|
+ make install
|
|
147
|
+
|
|
148
|
+as usual to install FreeType2 into the directory tree specified by
|
|
149
|
+the argument of the `--prefix` option.
|
|
150
|
+
|
|
151
|
+As noted in section 2.2, FreeType2 is sometimes configured to be
|
|
152
|
+installed into the system directory of the target system, and
|
|
153
|
+should not be installed in the cross-building system. In such
|
|
154
|
+cases, the make variable `DESTDIR` is useful to change the root
|
|
155
|
+directory in the installation. For example, after
|
|
156
|
+
|
|
157
|
+```bash
|
|
158
|
+ make DESTDIR=/mnt/target_system_root/ install
|
|
159
|
+```
|
|
160
|
+
|
|
161
|
+the built FreeType2 library files are installed into the directory
|
|
162
|
+`/mnt/target_system_root/<prefix_in_configure>/lib`.
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+## 5. TODO
|
|
166
|
+
|
|
167
|
+Cross building between Cygwin (or MSys) and Unix must be tested.
|
|
168
|
+
|
|
169
|
+---
|
|
170
|
+```
|
|
171
|
+Copyright (C) 2006-2023 by
|
|
172
|
+suzuki toshiya, David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
173
|
+
|
|
174
|
+This file is part of the FreeType project, and may only be used,
|
|
175
|
+modified, and distributed under the terms of the FreeType project
|
|
176
|
+license, LICENSE.TXT. By continuing to use, modify, or distribute
|
|
177
|
+this file you indicate that you have read the license and understand
|
|
178
|
+and accept it fully.
|
|
179
|
+```
|
|
180
|
+
|
|
181
|
+<!---->
|
|
182
|
+[INSTALL_UNIX.md]: ./INSTALL_UNIX.md |
docs/INSTALL_GNU.md
|
1
|
+# Compiling FreeType with GNU Make
|
|
2
|
+
|
|
3
|
+This document contains instructions how to build the FreeType library
|
|
4
|
+on non-Unix systems with the help of GNU Make. Note that if you are
|
|
5
|
+running Cygwin or MinGW/MSYS in Windows, you should follow the
|
|
6
|
+instructions in the file [INSTALL_UNIX.md] instead.
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+FreeType 2 includes a powerful and flexible build system that allows
|
|
10
|
+you to easily compile it on a great variety of platforms from the
|
|
11
|
+command line. To do so, just follow these simple instructions.
|
|
12
|
+
|
|
13
|
+## 1. Install GNU Make
|
|
14
|
+
|
|
15
|
+The FreeType 2 build system relies on many features special to GNU
|
|
16
|
+Make.
|
|
17
|
+
|
|
18
|
+NEARLY ALL OTHER MAKE TOOLS FAIL, INCLUDING `BSD MAKE`, SO REALLY
|
|
19
|
+INSTALL A RECENT VERSION OF GNU MAKE ON YOUR SYSTEM!
|
|
20
|
+
|
|
21
|
+Note that make++, a make tool written in Perl, supports enough
|
|
22
|
+features of GNU make to compile FreeType. See
|
|
23
|
+
|
|
24
|
+>https://makepp.sourceforge.net
|
|
25
|
+
|
|
26
|
+for more information; you need version 2.0 or newer, and you must
|
|
27
|
+pass option `--norc-substitution`.
|
|
28
|
+
|
|
29
|
+Make sure that you are invoking GNU Make from the command line, by
|
|
30
|
+typing something like:
|
|
31
|
+
|
|
32
|
+ make -v
|
|
33
|
+
|
|
34
|
+to display its version number.
|
|
35
|
+
|
|
36
|
+VERSION 3.81 OR NEWER IS NEEDED!
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+## 2. Invoke `make`
|
|
40
|
+
|
|
41
|
+Go to the root directory of FreeType 2, then simply invoke GNU
|
|
42
|
+Make from the command line. This will launch the FreeType 2 host
|
|
43
|
+platform detection routines. A summary will be displayed, for
|
|
44
|
+example, on Win32.
|
|
45
|
+
|
|
46
|
+ FreeType build system -- automatic system detection
|
|
47
|
+
|
|
48
|
+ The following settings are used:
|
|
49
|
+
|
|
50
|
+ platform windows
|
|
51
|
+ compiler gcc
|
|
52
|
+ configuration directory .\builds\windows
|
|
53
|
+ configuration rules .\builds\windows\w32-gcc.mk
|
|
54
|
+
|
|
55
|
+ If this does not correspond to your system or settings please
|
|
56
|
+ remove the file 'config.mk' from this directory then read the
|
|
57
|
+ INSTALL file for help.
|
|
58
|
+
|
|
59
|
+ Otherwise, simply type 'make' again to build the library
|
|
60
|
+ or 'make refdoc' to build the API reference (the latter needs
|
|
61
|
+ Python >= 3.5).
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+If the detected settings correspond to your platform and compiler,
|
|
65
|
+skip to step 5. Note that if your platform is completely alien to
|
|
66
|
+the build system, the detected platform will be `ansi`.
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+## 3. Configure the build system for a different compiler
|
|
70
|
+
|
|
71
|
+If the build system correctly detected your platform, but you want
|
|
72
|
+to use a different compiler than the one specified in the summary
|
|
73
|
+(for most platforms, gcc is the default compiler), invoke GNU Make
|
|
74
|
+with
|
|
75
|
+
|
|
76
|
+ make setup <compiler>
|
|
77
|
+
|
|
78
|
+Examples:
|
|
79
|
+
|
|
80
|
+ to use Visual C++ on Win32, type: `make setup visualc`
|
|
81
|
+ to use Borland C++ on Win32, type `make setup bcc32`
|
|
82
|
+ to use Watcom C++ on Win32, type `make setup watcom`
|
|
83
|
+ to use Intel C++ on Win32, type `make setup intelc`
|
|
84
|
+ to use LCC-Win32 on Win32, type: `make setup lcc`
|
|
85
|
+ to use Watcom C++ on OS/2, type `make setup watcom`
|
|
86
|
+ to use VisualAge C++ on OS/2, type `make setup visualage`
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+The `<compiler>` name to use is platform-dependent. The list of
|
|
90
|
+available compilers for your system is available in the file
|
|
91
|
+`builds/<system>/detect.mk`.
|
|
92
|
+
|
|
93
|
+If you are satisfied by the new configuration summary, skip to
|
|
94
|
+step 5.
|
|
95
|
+
|
|
96
|
+### 3a. Use clang instead of gcc
|
|
97
|
+
|
|
98
|
+The `clang` compiler can use FreeType's setup for `gcc`; it is
|
|
99
|
+sufficient to set the `CC` variable, for example
|
|
100
|
+
|
|
101
|
+ make CC=clang
|
|
102
|
+
|
|
103
|
+### 3b. Compiling with a C++ compiler
|
|
104
|
+
|
|
105
|
+FreeType can be built with a C++ compiler, for example
|
|
106
|
+
|
|
107
|
+ make CC="g++"
|
|
108
|
+
|
|
109
|
+If `clang++` should be used it is necessary to also override the
|
|
110
|
+`ANSIFLAGS` variable:
|
|
111
|
+
|
|
112
|
+ make CC="clang++" ANSIFLAGS=""
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+## 4. Configure the build system for an unknown platform/compiler
|
|
116
|
+
|
|
117
|
+The auto-detection/setup phase of the build system copies a file
|
|
118
|
+to the current directory under the name `config.mk`.
|
|
119
|
+
|
|
120
|
+For example, on OS/2+gcc, it would simply copy
|
|
121
|
+`builds/os2/os2-gcc.mk` to `./config.mk`.
|
|
122
|
+
|
|
123
|
+If for some reason your platform isn't correctly detected, copy
|
|
124
|
+manually the configuration sub-makefile to `./config.mk` and go to
|
|
125
|
+step 5.
|
|
126
|
+
|
|
127
|
+Note that this file is a sub-Makefile used to specify Make
|
|
128
|
+variables for compiler and linker invocation during the build.
|
|
129
|
+You can easily create your own version from one of the existing
|
|
130
|
+configuration files, then copy it to the current directory under
|
|
131
|
+the name `./config.mk`.
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+## 5. Build the library
|
|
135
|
+
|
|
136
|
+The auto-detection/setup phase should have copied a file in the
|
|
137
|
+current directory, called `./config.mk`. This file contains
|
|
138
|
+definitions of various Make variables used to invoke the compiler
|
|
139
|
+and linker during the build. [It has also generated a file called
|
|
140
|
+`ftmodule.h` in the objects directory (which is normally
|
|
141
|
+`<toplevel>/objs/`); please read the file [docs/CUSTOMIZE][CUSTOMIZE]
|
|
142
|
+for customization of FreeType.]
|
|
143
|
+
|
|
144
|
+To launch the build, simply invoke GNU Make again: The top
|
|
145
|
+Makefile will detect the configuration file and run the build with
|
|
146
|
+it. If you have used variables in step 3, you must use the same
|
|
147
|
+variables here, too.
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+Final note
|
|
151
|
+
|
|
152
|
+The above instructions build a _statically_ linked library of the
|
|
153
|
+font engine in the `objs` directory. On Windows, you can build a
|
|
154
|
+DLL either with MinGW (within an MSYS shell, following the
|
|
155
|
+instructions in `INSTALL.UNIX`), or you use one of the Visual C++
|
|
156
|
+project files; see the subdirectories of `builds/windows`. For
|
|
157
|
+everything else, you are on your own, and you might follow the
|
|
158
|
+instructions in `INSTALL.ANY` to create your own Makefiles.
|
|
159
|
+
|
|
160
|
+---
|
|
161
|
+```
|
|
162
|
+Copyright (C) 2003-2023 by
|
|
163
|
+David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
164
|
+
|
|
165
|
+This file is part of the FreeType project, and may only be used,
|
|
166
|
+modified, and distributed under the terms of the FreeType project
|
|
167
|
+license, LICENSE.TXT. By continuing to use, modify, or distribute
|
|
168
|
+this file you indicate that you have read the license and understand
|
|
169
|
+and accept it fully.
|
|
170
|
+```
|
|
171
|
+
|
|
172
|
+<!---->
|
|
173
|
+[INSTALL_UNIX.md]: ./INSTALL_UNIX.md
|
|
174
|
+[CUSTOMIZE]: ./CUSTOMIZE |
docs/INSTALL_MAC.md
|
1
|
+# Compiling FreeType on Mac OS X
|
|
2
|
+
|
|
3
|
+Please follow the instructions in INSTALL.UNIX to install FreeType on
|
|
4
|
+Mac OS X.
|
|
5
|
+
|
|
6
|
+Currently FreeType2 functions based on some deprecated Carbon APIs
|
|
7
|
+return `FT_Err_Unimplemented_Feature` always, even if FreeType2 is
|
|
8
|
+configured and built on the system that deprecated Carbon APIs are
|
|
9
|
+available. To enable deprecated FreeType2 functions as far as
|
|
10
|
+possible, replace `src/base/ftmac.` by `builds/mac/ftmac.c`.
|
|
11
|
+
|
|
12
|
+Starting with Mac OS X 10.5, gcc defaults the deployment target to
|
|
13
|
+10.5. In previous versions of Mac OS X, this defaulted to 10.1. If
|
|
14
|
+you want your built binaries to run only on 10.5, this change does not
|
|
15
|
+concern you. If you want them to also run on older versions of Mac
|
|
16
|
+OS X, then you must either set the MACOSX_DEPLOYMENT_TARGET
|
|
17
|
+environment variable or pass `-mmacosx-version-min` to gcc. You
|
|
18
|
+should specify the oldest version of Mac OS you want the code to run
|
|
19
|
+on. For example, if you use Bourne shell:
|
|
20
|
+
|
|
21
|
+```bash
|
|
22
|
+ export MACOSX_DEPLOYMENT_TARGET=10.2
|
|
23
|
+```
|
|
24
|
+
|
|
25
|
+or, if you use C shell:
|
|
26
|
+
|
|
27
|
+```bash
|
|
28
|
+ setenv MACOSX_DEPLOYMENT_TARGET 10.2
|
|
29
|
+```
|
|
30
|
+
|
|
31
|
+Alternatively, you could pass `-mmacosx-version-min=10.2` to gcc.
|
|
32
|
+
|
|
33
|
+Here the number 10.2 is the lowest version that the built binaries can
|
|
34
|
+run on. In the above cases, the built binaries will run on Mac OS X
|
|
35
|
+10.2 and later, but _not_ earlier. If you want to run on earlier, you
|
|
36
|
+have to set lower version, e.g., 10.0.
|
|
37
|
+
|
|
38
|
+For classic Mac OS (Mac OS 7, 8, 9) please refer to builds/mac/README.
|
|
39
|
+
|
|
40
|
+---
|
|
41
|
+```
|
|
42
|
+Copyright (C) 2003-2023 by
|
|
43
|
+David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
44
|
+
|
|
45
|
+This file is part of the FreeType project, and may only be used,
|
|
46
|
+modified, and distributed under the terms of the FreeType project
|
|
47
|
+license, LICENSE.TXT. By continuing to use, modify, or distribute
|
|
48
|
+this file you indicate that you have read the license and understand
|
|
49
|
+and accept it fully.
|
|
50
|
+``` |
docs/INSTALL_UNIX.md
|
1
|
+# Building FreeType on Unix Systems
|
|
2
|
+
|
|
3
|
+This also works for emulations like Cygwin or MSys on Win32:
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+## 1. Ensure that you are using GNU Make
|
|
7
|
+
|
|
8
|
+The FreeType build system _exclusively_ works with GNU Make. You
|
|
9
|
+will not be able to compile the library with the instructions
|
|
10
|
+below using any other alternative (including BSD Make).
|
|
11
|
+
|
|
12
|
+Check that you have GNU make by running the command:
|
|
13
|
+
|
|
14
|
+ make -v
|
|
15
|
+
|
|
16
|
+This should dump some text that begins with:
|
|
17
|
+
|
|
18
|
+ GNU Make <version number>
|
|
19
|
+ Copyright (C) <year> Free Software Foundation Inc.
|
|
20
|
+
|
|
21
|
+Note that version 3.81 or higher is *required* or the build will
|
|
22
|
+fail.
|
|
23
|
+
|
|
24
|
+It is also fine to have GNU Make under another name (e.g. 'gmake')
|
|
25
|
+if you use the MAKE variable as described below.
|
|
26
|
+
|
|
27
|
+As a special exception, 'makepp' can also be used to build
|
|
28
|
+FreeType 2. See the file `docs/MAKEPP` for details.
|
|
29
|
+
|
|
30
|
+For builds with `cmake` please check file `CMakeLists.txt`; this
|
|
31
|
+is a contributed file not directly supported by the FreeType team.
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+## 2. Regenerate the configure script if needed
|
|
35
|
+
|
|
36
|
+This only applies if you are building a git snapshot or checkout,
|
|
37
|
+*not* if you grabbed the sources of an official release.
|
|
38
|
+
|
|
39
|
+You need to invoke the `autogen.sh` script in the top-level
|
|
40
|
+directory in order to create the `configure` script for your
|
|
41
|
+platform. Normally, this simply means typing:
|
|
42
|
+```bash
|
|
43
|
+ sh autogen.sh
|
|
44
|
+```
|
|
45
|
+
|
|
46
|
+In case of problems, you may need to install or upgrade Automake,
|
|
47
|
+Autoconf or Libtool. See [INSTALL.md] for more information.
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+## 3. Build and install the library
|
|
51
|
+
|
|
52
|
+Say
|
|
53
|
+```bash
|
|
54
|
+ ./configure --help
|
|
55
|
+```
|
|
56
|
+
|
|
57
|
+to see the list of possible configuration options and important
|
|
58
|
+environment variables. The `./configure` script will detect some
|
|
59
|
+prerequisite system libraries (libpng, brotli, etc.) if their
|
|
60
|
+headers are available at the default locations.
|
|
61
|
+
|
|
62
|
+The following should work on all Unix systems where the `make`
|
|
63
|
+command invokes GNU Make:
|
|
64
|
+
|
|
65
|
+```bash
|
|
66
|
+ ./configure [options]
|
|
67
|
+ make
|
|
68
|
+ make install (as root)
|
|
69
|
+```
|
|
70
|
+
|
|
71
|
+The default installation path is `/usr/local`. It can be changed
|
|
72
|
+with the `--prefix=<path>` option. Example:
|
|
73
|
+
|
|
74
|
+```bash
|
|
75
|
+ ./configure --prefix=/usr
|
|
76
|
+```
|
|
77
|
+
|
|
78
|
+When using a different command to invoke GNU Make, use the MAKE
|
|
79
|
+variable. For example, if `gmake` is the command to use on your
|
|
80
|
+system, do something like:
|
|
81
|
+
|
|
82
|
+```bash
|
|
83
|
+ MAKE=gmake ./configure [options]
|
|
84
|
+ gmake
|
|
85
|
+ gmake install (as root)
|
|
86
|
+```
|
|
87
|
+
|
|
88
|
+If this still doesn't work, there must be a problem with your
|
|
89
|
+system (e.g., you are using a very old version of GNU Make).
|
|
90
|
+
|
|
91
|
+For library identification, FreeType's `configure` script uses the
|
|
92
|
+`pkg-config` interface: Assuming it needs library `foo`, it calls
|
|
93
|
+the `pkg-config` program to find information on library `foo`,
|
|
94
|
+which in turn looks for a `foo.pc` file installed at the system.
|
|
95
|
+Some platforms, however, don't come with `pkg-support`; you then
|
|
96
|
+have to use environment variables as described by `configure
|
|
97
|
+--help`. Example:
|
|
98
|
+
|
|
99
|
+```bash
|
|
100
|
+ LIBPNG_CFLAGS="-I/path/to/libpng/include/directory" \
|
|
101
|
+ LIBPNG_LIBS="-L/path/to/libpng/lib/directory" \
|
|
102
|
+ configure ...
|
|
103
|
+```
|
|
104
|
+
|
|
105
|
+It is possible to compile FreeType in a different directory.
|
|
106
|
+Assuming the FreeType source files in directory `/src/freetype` a
|
|
107
|
+compilation in directory `foo` works as follows:
|
|
108
|
+
|
|
109
|
+```bash
|
|
110
|
+ cd foo
|
|
111
|
+ /src/freetype/configure [options]
|
|
112
|
+ make
|
|
113
|
+ make install
|
|
114
|
+```
|
|
115
|
+
|
|
116
|
+
|
|
117
|
+### 3.1 Interdependency with HarfBuzz
|
|
118
|
+
|
|
119
|
+Note that there is a chicken-and-egg problem currently since the
|
|
120
|
+HarfBuzz library (used by the auto-hinter to improve support of
|
|
121
|
+OpenType fonts) depends on FreeType, which can be solved as
|
|
122
|
+follows in case HarfBuzz is not yet installed on your system.
|
|
123
|
+
|
|
124
|
+1. Call FreeType's `configure` script with option
|
|
125
|
+ `--without-harfbuzz`, then compile and install FreeType.
|
|
126
|
+
|
|
127
|
+2. Compile and install HarfBuzz.
|
|
128
|
+
|
|
129
|
+3. Call FreeType's `configure` script without option
|
|
130
|
+ `--without-harfbuzz` (after executing `make distclean`), then
|
|
131
|
+ compile and install FreeType again.
|
|
132
|
+
|
|
133
|
+---
|
|
134
|
+```
|
|
135
|
+Copyright (C) 2003-2023 by
|
|
136
|
+David Turner, Robert Wilhelm, and Werner Lemberg.
|
|
137
|
+
|
|
138
|
+This file is part of the FreeType project, and may only be used,
|
|
139
|
+modified, and distributed under the terms of the FreeType project
|
|
140
|
+license, LICENSE.TXT. By continuing to use, modify, or distribute
|
|
141
|
+this file you indicate that you have read the license and understand
|
|
142
|
+and accept it fully.
|
|
143
|
+```
|
|
144
|
+
|
|
145
|
+<!---->
|
|
146
|
+[INSTALL.md]: ./INSTALL.md |
docs/INSTALL.VMS
→
docs/INSTALL_VMS.md
1
|
|
-How to build the FreeType library on VMS
|
2
|
|
-----------------------------------------
|
|
1
|
+# How to build the FreeType library on VMS
|
3
|
2
|
|
4
|
3
|
It is actually very straightforward to install the FreeType library.
|
5
|
|
-Just execute `vms_make.com from` the toplevel directory to build the
|
|
4
|
+Just execute `vms_make.com` from the toplevel directory to build the
|
6
|
5
|
library. This procedure currently accepts the following options:
|
7
|
6
|
|
8
|
|
-* `DEBUG`
|
|
7
|
+- `DEBUG`
|
9
|
8
|
Build the library with debug information and without optimization.
|
10
|
9
|
|
11
|
|
-* `lopts=<value>`
|
|
10
|
+- `lopts=<value>`
|
12
|
11
|
Options to pass to the link command, e.g., `lopts=/traceback`.
|
13
|
12
|
|
14
|
|
-* `ccopt=<value>`
|
|
13
|
+- `ccopt=<value>`
|
15
|
14
|
Options to pass to the C compiler, e.g., `ccopt=/float=ieee`.
|
16
|
15
|
|
17
|
16
|
In case you did download the demos, place them in a separate directory
|
... |
... |
@@ -20,23 +19,25 @@ same instructions as above for the demos from there. The build |
20
|
19
|
process relies on this to figure out the location of the FreeType
|
21
|
20
|
include files.
|
22
|
21
|
|
23
|
|
-
|
24
|
22
|
To rebuild the sources it is necessary to have MMS/MMK installed on
|
25
|
23
|
the system.
|
26
|
24
|
|
27
|
25
|
The library is available in the directory
|
28
|
|
-
|
|
26
|
+```
|
29
|
27
|
[.LIB]
|
|
28
|
+```
|
30
|
29
|
|
31
|
30
|
To compile applications using FreeType you have to define the logical
|
32
|
31
|
`FREETYPE` pointing to the directory
|
33
|
|
-
|
|
32
|
+```
|
34
|
33
|
[.INCLUDE.FREETYPE]
|
|
34
|
+```
|
35
|
35
|
|
36
|
36
|
i.e., if the directory in which this `INSTALL.VMS` file is located is
|
37
|
37
|
`$disk:[freetype.docs]`, then define the logical with
|
38
|
|
-
|
|
38
|
+```
|
39
|
39
|
define freetype $disk:[freetype.include.freetype]
|
|
40
|
+```
|
40
|
41
|
|
41
|
42
|
See http://nchrem.tnw.tudelft.nl/openvms/software2.html#Freetype for
|
42
|
43
|
the packages FreeType depends on.
|
... |
... |
@@ -45,7 +46,6 @@ The latest versions were tested using |
45
|
46
|
- VSI C V7.4-002 and DECWindows V1.7-F on OpenVMS Alpha V8.4-2L1
|
46
|
47
|
- VSI C V7.4-001 and DECWindows V1.7-E on OpenVMS IA64 V8.4-2L3
|
47
|
48
|
|
48
|
|
-
|
49
|
49
|
Any problems can be reported to
|
50
|
50
|
|
51
|
51
|
Jouk Jansen <joukj@hrem.nano.tudelft.nl> or
|
... |
... |
@@ -54,8 +54,8 @@ Orginal version of the build procedures was created by |
54
|
54
|
|
55
|
55
|
Martin P.J. Zinser <zinser@zinser.no-ip.info>
|
56
|
56
|
|
57
|
|
-------------------------------------------------------------------------
|
58
|
|
-
|
|
57
|
+---
|
|
58
|
+```
|
59
|
59
|
Copyright (C) 2000-2023 by
|
60
|
60
|
David Turner, Robert Wilhelm, and Werner Lemberg.
|
61
|
61
|
|
... |
... |
@@ -64,6 +64,4 @@ modified, and distributed under the terms of the FreeType project |
64
|
64
|
license, LICENSE.TXT. By continuing to use, modify, or distribute this
|
65
|
65
|
file you indicate that you have read the license and understand and
|
66
|
66
|
accept it fully.
|
67
|
|
-
|
68
|
|
-
|
69
|
|
---- end of INSTALL.VMS --- |
|
67
|
+``` |
docs/MODIFYING.md
|
1
|
+# Modifying FreeType
|
|
2
|
+
|
|
3
|
+FreeType follows a modular architecture, i.e. all the features are
|
|
4
|
+implemented as separate modules. There are separate modules for
|
|
5
|
+rasterizers, font parsers, hinting etc. located under the `src/` directory.
|
|
6
|
+
|
|
7
|
+(See https://freetype.org/freetype2/docs/design/design-5.html)
|
|
8
|
+
|
|
9
|
+To add new features you have to either modify the existing modules or
|
|
10
|
+add a new module to FreeType.
|
|
11
|
+
|
|
12
|
+## Adding a new module to FreeType
|
|
13
|
+
|
|
14
|
+Suppose we want to add a new module "example" to FreeType:
|
|
15
|
+
|
|
16
|
+1. Create a directory under `src/` having the same name as the module.
|
|
17
|
+ i.e. `src/example/`
|
|
18
|
+
|
|
19
|
+2. Add source files under src/example having `#define FT_MAKE_OPTION_SINGLE_OBJECT`
|
|
20
|
+ which includes the other files to create the module.
|
|
21
|
+
|
|
22
|
+ (See `src/sdf/sdf.c` for reference)
|
|
23
|
+
|
|
24
|
+3. Add the module to `include/freetype/config/ftmodule.h` according to whether
|
|
25
|
+ it is a renderer, font driver or another module like:
|
|
26
|
+
|
|
27
|
+ ```C
|
|
28
|
+ FT_USE_MODULE( FT_Renderer_Class, ft_example_renderer_class )
|
|
29
|
+ ```
|
|
30
|
+
|
|
31
|
+4. Add the module to `modules.cfg` in the toplevel directory:
|
|
32
|
+ ```
|
|
33
|
+ RASTER_MODULES += example
|
|
34
|
+ ```
|
|
35
|
+
|
|
36
|
+5. Under `src/example` add `module.mk` and `rules.mk` files to enable compilation
|
|
37
|
+ with `make`. (See `src/smooth/rules.mk` for reference).
|
|
38
|
+
|
|
39
|
+6. Now you can simply compile by using `make` in the toplevel directory and the module
|
|
40
|
+ should compile.
|
|
41
|
+
|
|
42
|
+ You can check out pre-existing modules for reference under `src/` |
docs/Raster_Algorithm.md
|
1
|
+TODO: add details on how the freetype smooth anti-aliasing rasterizer works |
|