Grab a copy of the base MSYS2 installation. If you have a 64-bit computer, then the default download is fine. If you have a 32-bit computer, you must browse for the 32-bit base archive - see here.
C:\msys64
is fine, but C:\Program Files\msys64
is not ok. The installer will initialise everything that it needs. Start the terminal (Note: See step 3 below which explains which shell can be launched). mingw32_shell.bat
or mingw64_shell.bat
- depending on if you wish to build the 32-bit or 64-bit version of FontForge.ReleasePackage
folder will be reset. Everything else will remain in-tact.Now that MSYS2 is initialised, you should synchronise the package repository:
~~~~~~
pacman -Syy
~~~~~~
The next step is optional, and may break things, but it keeps stuff up to date - update MSYS2:
~~~~~
pacman -Suu
~~~~~
If you see fork
errors, close the terminal and run autorebase.bat
(located in the root of the MSYS2 installation)
Now that's done, install git
:
~~~~~~
pacman -S git
~~~~~~
(Say yes to the prompt)
Once installed, you can now clone the build script:
~~~~~~
git clone https://github.com/jtanx/fontforgebuilds ff-build
cd ff-build
~~~~~~
The next step is optional, but it makes MSYS2 a bit nicer to use. In particular, if you have Notepad++, then this step will set it as the default editor for git, and you can also call Notepad++ with the aliased command, npp
. It will also make pressing Ctrl+Left/Right skip back/forwards one word (mimics cmd behaviour):
~~~~~~
git checkout msys2-configs
./patch-msys2-config.sh
git checkout master
~~~~~~
You will have to restart your terminal for the changes to come into effect.
You must now download the prerequisite source and binary files:
original-archives/binaries/
- either potrace-1.14.win32.tar.gz
or potrace-1.11.win64.tar.gz
, depending on if you're dong 32 or 64 bitoriginal-archives/binaries
- again, choose the one that matches your architecture.original-archives/sources
- the build system currently uses cairo-1.15.6.tar.xz
.original-archives/sources
- the build system currently uses pango-1.40.6.tar.xz
original-archives/sources
- the build system currently uses freetype-2.8.tar.bz2
. This is only required to compile the TTF debugger in FontForge. If all goes well and the stars align, you may now call:
~~~~~~
./ffbuild.sh
~~~~~~
And FontForge (and its dependencies) should just compile, building you your very own copy of FontForge. Note that you will need an internet connection to run the script, as it automatically clones the source repositories of the required X11 libraries.
ReleasePackage
folder. You may launch FontForge either by clicking on run_fontforge.exe
, or by fontforge.bat
. You will need the appropriate version of gdb installed to debug fontforge:
32-bit: mingw-w64-i686-gdb 64-bit: mingw-w64-x86_64-gdb install with, e.g.: pacman -S mingw-w64-i686-gdb
Note: Do not install the msys2 gdb, as this is the wrong one to use, e.g. do not do this:
!!! don't do this !!! pacman -S gdb
Check: Which gdb are you using?
which gdb
It should either be /mingw32/bin/gdb
or /mingw64/bin/gdb
depending on if you are targeting 32 or 64-bit builds.
If you need more help with GDB itself, see [Getting a backtrace with GDB] for more details.
A tip for if you have built fontforge yourself: Copy the debugging symbols from the debugging-symbols/.debug
folder to the bin
folder in ReleasePackage
, e.g.:
cd ReleasePackage/bin cp -r ../../debugging-symbols/.debug . gdb fontforge
Currently there is a (presumed) bug in the readline build on msys2, which means that interactive prompts inside of gdb fail. Thus, if you want to set a breakpoint before you run fontforge, you must execute the following line in the gdb prompt first:
set breakpoint pending on
Make sure that you have an X server running, e.g. Xming or VcXsrv. You can use the supplied version of VcXsrv:
ReleasePackage/bin/VcXsrv
and make a shortcut to VcXsrv.exe
-multiwindow
to it, e.g. target: "C:\ffbuild\ReleasePackage\bin\VcXsrv\vcxsrv.exe" -multiwindow
Note that this build process is subject to change as modifications are made.