2 building and installing ttfautohint from git
3 ============================================
5 Building ttfautohint from the git repository needs some tools that are not
6 required when building from a release:
14 perl (this is a prerequisite of automake also)
16 If you configure to build the documentation files also (which are normally
17 distributed with the release package), the following is necessary:
22 X11 (in particular the `xwininfo' program)
24 xelatex (TeX Live 2018)
26 The version numbers in parentheses are known to work. Newer versions should
29 The main font for the PDF file is `Linux Libertine O'; in addition, we use
30 various sans-serif TrueType fonts from the `Noto' family that are not part
31 of TeX Live. To access them it is recommended to use SVN to clone parts of
32 the huge `noto-fonts' git repository and adjust the `TTFONTS' environment
33 variable accordingly to make xelatex find the fonts in the proper
36 [Yes, we access a github repository with SVN to quickly download just a part
40 https://github.com/googlei18n/noto-fonts/trunk/unhinted/ttf \
43 Here is an example how to set `TTFONTS'.
45 TTFONTS="/your/path/to/noto-fonts/unhinted/ttf//;"
47 Note the double slash ending the path elements; this makes TeX and its tools
48 search all subdirectories. Also note the trailing `;' character to ensure
49 that the directories are prepended to the built-in value of `TTFONTS'
50 (instead of replacing it).
52 For correct conversion of the SVG images to PDF, the `Linux Libertine O'
53 font family must be provided by the OS to inkscape.
59 to clone the `gnulib' repository (which gets installed as a git submodule),
60 to build the `configure' script, and to set up necessary auxiliary files.
61 Then you can proceed with the instructions given in the `INSTALL' file.
64 compilation within the MinGW environment (on Windows)
65 -----------------------------------------------------
67 [https://osdn.net/projects/mingw/]
69 - Since MSYS, the shell of MinGW, uses LF as line endings, `git checkout'
70 should not convert files to CRLF. Before checking out the FreeType and
71 ttfautohint repositories, you should issue the command
73 git config --global core.autocrlf input
75 to avoid any line ending conversion.
77 - At the time of this writing (February 2014), the current MinGW bundle
78 (in particular mingwrt-4.0.3; the gcc version is 4.8.1) contains a
79 number of bugs that need work-arounds. For this reason, you should use
80 FreeType version 2.5.3 (or the git repository) and HarfBuzz version
81 0.9.27 or newer. The configuration scripts work just fine in an MSYS
84 - Only a very special functionality of HarfBuzz is needed; you might thus
85 reduce dependencies by adding the following options to its `configure'
93 - You need bison 2.5 or newer. MinGW doesn't offer this, but you can
94 download a MinGW port of version 3.0.2 from
96 https://sourceforge.net/projects/ezwinports/files/
98 - To compile a stand-alone version of ttfautohintGUI we must compile a
99 static version of Qt 4 first. I've successfully followed these
100 instructions with version 4.8.5
102 https://www.formortals.com/build-qt-static-small-microsoft-intel-gcc-compiler/
104 together with the following minor patch to MinGW
106 https://sourceforge.net/p/mingw/mingw-org-wsl/ci/928ddb53a9623fc38de3997a3acce4a8730f4dc6/
108 Note that these build instructions should be executed in a normal
109 cmd.exe shell, *not* MSYS.
111 An alternative is given at
113 https://wiki.qt.io/Building_a_static_Qt_for_Windows_using_MinGW
115 using a PowerShell script. However, you still need the small MinGW
118 It's not necessary to invoke `make install' for Qt. For ttfautohint's
119 `--with-qt' configure script argument in the next build step, use the
120 `bin' subdirectory of the just built Qt library, for example
122 --with-qt=/path/to/qt-4.8.5/bin
124 - Now configure and compile ttfautohint (within an MSYS shell) using
127 CXX='g++ -static-libgcc' \
130 ac_cv_func__set_invalid_parameter_handler=no
131 make LDFLAGS=-all-static
133 (The `ac_cv_func...' argument is another work-around for a MinGW bug,
134 the `CXX' line is a fix for libtool).
137 compilation with mxe (on Unix, for Windows)
138 -------------------------------------------
142 The following describes installation with Qt version 5.15.2 (as used by mxe
145 - Check out the mxe git repository.
147 - Apply the following two patches to get smaller ttfautohint binaries.
149 diff --git a/src/harfbuzz.mk b/src/harfbuzz.mk
150 index 6b299da..bb56456 100644
151 --- a/src/harfbuzz.mk
152 +++ b/src/harfbuzz.mk
153 @@ -20,6 +20,10 @@ endef
155 cd '$(1)' && ./configure \
156 $(MXE_CONFIGURE_OPTS) \
158 + --with-gobject=no \
162 $(MAKE) -C '$(1)' -j '$(JOBS)' install
164 diff --git a/src/qt.mk b/src/qt.mk
165 index a8268ac4..17e8ead7 100644
168 @@ -41,13 +41,16 @@ define $(PKG)_BUILD
169 -device-option PKG_CONFIG='$(TARGET)-pkg-config' \
176 -prefix '$(PREFIX)/$(TARGET)/qt' \
187 @@ -61,12 +64,7 @@ define $(PKG)_BUILD
196 - -qt-sql-tds -D Q_USE_SYBASE \
202 - Copy the file `mxe/qtlocation-2.patch' into the mxe directory `src'.
204 - mxe's default target is `i686-w64-mingw32.static', which builds a 32bit
205 static executable. We want exactly that for the distributed binaries.
207 [For private builds, however, this can be changed by setting the
208 `MXE_TARGETS' variable in the `settings.mk' file. A template for this
209 file gets automatically generated after calling make the first time, so
210 you should call make, abort the build process after a few seconds,
211 adjust `settings.mk' to your needs, then continue with the instructions
212 below. More details can be found on mxe's homepage.]
214 - Now build the necessary mxe infrastructure with
218 This downloads packages with a total size of approx. 720MBytes.
219 Compilation easily takes some hours on a slower computer; all together
220 it finally occupies slightly more than 3GBytes on the harddisk.
222 - You are now ready to build ttfautohint from the git repository with
224 export PATH=/your/path/to/mxe/usr/bin:$PATH
230 --host=i686-w64-mingw32.static \
231 --with-qt=/your/path/to/mxe/usr/i686-w64-mingw32.static/qt5/bin \
238 Binaries can be found in `out/bin'.