Giter Site home page Giter Site logo

fontforgebuilds's Introduction

A FontForge build script for Windows.

This script was based on Matthew Petroff's work, although it has
been practically rewritten since.

Matthew Petroff is the author of the icons and graphics used:
* The icons and graphics are licensed under the
  Creative Commons Attribution 3.0 Unported license.

See here for more information: 
https://bitbucket.org/mpetroff/unofficial-fontforge-mingw-sdk/wiki/Home

The build script (ffbuild.sh) and installer is licensed under the 
BSD 2-clause license.

--------------------------------------------------------------------------------

Build instructions:
See https://sourceforge.net/p/fontforgebuilds/wiki/Using%20the%20build%20script/

--------------------------------------------------------------------------------

CHANGELOG:
02/06/19
* I've removed the previous options to build X11/with the X11 backend.
  FontForge is now always built with the GDK3 backend. For both the 32 bit
  and 64 bit builds, FontForge now also uses Python 3 over Python 2.
01/07/15
* Another overhaul to use precompiled X11, libspiro and libuninameslist
  libraries by default. This should speed up compiling FontForge from
  complete scratch. Cairo and Pango are still compiled by default, since
  these libraries may be used by other programs, and the versions compiled
  against X11 are not completely compatible with these programs.
14/06/14
* Overhauled the build system to allow building 32 and 64 bit builds in one
  MSYS2 installation.
  -  Compiled files are now built to the prefix target/mingw[32/64]/ so that 
     the MSYS2 system so it's reusable / easy to remove/redo compilation of
	 the files.
  - If you were using an older build script, it's highly recommended to
    start with a fresh MSYS2 installation.
* Patched libxcb (courtesy of the VcXsrv project) so that FontForge now
  works with the latest version of libX11. Probably fixes a fair few GUI
  bugs.
* Added a 'msys2-configs' branch that patches the MSYS2 configuration
  to make using the terminal and git nicer.

fontforgebuilds's People

Contributors

caketrim avatar ctrlcctrlv avatar jtanx avatar yurks avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fontforgebuilds's Issues

Add build package for python module

I was able to build just the fontforge dll and python modules with the following configure:

        ./configure \
        --disable-programs \
        --disable-native-scripting \
        --without-x \
        --without-cairo \
        --without-giflib \
        --without-libjpeg \
        --without-libtiff \
        --without-libpng \
        --without-libspiro \
        --without-libuninameslist \
        --without-libunicodenames \
        --without-iconv \
        --datarootdir=/usr/share/share_ff \
        --without-libzmq \
        --without-libreadline \
        --enable-python-scripting \
        --enable-python-extension \

However, this only runs on the mingw-GCC built python (of the same architecture, etc), and does not run on the MSC built python (it crashes). Would it be possible to strip out all of the code required to make the DLL and python module and compile with MSVC90 compiler to generate a 'regular' windows python module (or is it possible to get mingw-GCC to output a dll that MSC python can link to?)?

I'd be interested in doing some of the legwork, but I figured it would be worth asking someone who knows the code base better first.

ffbuild calls bootstrap that's not there

I was trying to build 32-bit fontforge from scratch on a new-installed msys2. After hours running, ffbuild gave me this:

image

The current dir was /g/fontforge_src/work/mingw32/fontforge/. I searched and found only one bootstrap in /g/fontforge_src/work/mingw32/fontforge/gnulib/build-aux/, but I think that's not the right one.

Did I do anything wrong?

Install cmake and ccache in ffbuild.sh?

As Fontforge had switched to CMake build system some time ago, I suggest to add the following to ffbuild.sh to make the build process work out of the box:

pacman $IOPTS $PMPREFIX-{cmake,ccache}

Thank you!

What is the -d ffbuild option supposed to mean?

I have the following gdb interaction
(gdb) b main
Breakpoint 1 at 0x401584: file main.c, line 39.
(gdb) run
Starting program: C:\msys64\home\NateJoe\ff-build\ReleasePackage\bin\fontfoerge.exe -nosplash Accordance.tff
[New Thread 33488.0x3a44]
[New Thread 33488.0x80e4]
[New Thread 33488.0x831c]
[New Thread 33488.0x7564]
warning: Can not parse XML library list; XML support was disabled at compile time

Thread 1 hit Breakpoint 1, main (argc=3, argv=0x131ef00) at main.c:39
39 return fontforge_main( argc, argv );
(gdb) b fontforge_run
Breakpoint 2 at 0x4015a0
(gdb) continue
Cpontinuing.

Thread 1 hit Breakpoint 2, 0x00000000004015a0 in fontforge_main ()
(gdb) next
Single stepping until exit from function fontforge_main,
which has no line number information.
0x0000000063632f4a in ?? ()
(gdb)

HELP, I did build with the -d option, but what is that really supposed to mean?

I'm having some kind of key trust issue running ./ffbuild.sh

The following sequence would seem to indicate that it wanted me to answer yes or no,
but it didn't wait for a reply and then got into some kind of trouble. Do I have to tweak my firewall?
Here is the console listing:
$ ./ffbuild.sh -d
MSYS2 FontForge build script...
Building 64-bit version!
First time run; installing MSYS and MinGW libraries...
Adding the fontforgelibs repo...
gpg: requesting key 2E618C78 from hkp server pool.sks-keyservers.net
gpg: key 2E618C78: public key "Jeremy Tan [email protected]" imported
gpg: Total number processed: 1
gpg: imported: 1 (RSA: 1)
==> Updating trust database...
gpg: no need for a trustdb check
-> Locally signing key 2E618C78...
==> Updating trust database...
gpg: 3 marginal(s) needed, 1 complete(s) needed, PGP trust model
gpg: depth: 0 valid: 1 signed: 5 trust: 0-, 0q, 0n, 0m, 0f, 1u
gpg: depth: 1 valid: 5 signed: 3 trust: 1-, 0q, 0n, 4m, 0f, 0u
gpg: depth: 2 valid: 3 signed: 0 trust: 3-, 0q, 0n, 0m, 0f, 0u
:: Synchronizing package databases...
mingw32 is up to date
mingw64 is up to date
msys is up to date
fontforgelibs32 14.5 KiB 0.00B/s 00:00 [###############################] 100%
fontforgelibs32.sig 543.0 B 0.00B/s 00:00 [###############################] 100%
error: fontforgelibs32: key "25D7E9C490F90C4A" is unknown
:: Import PGP key 4096R/E10ABC00BD686519D6AC5F5D25D7E9C490F90C4A, "Jeremy Tan [email protected]", created: 2016-08-27? [Y/n]
error: fontforgelibs32: signature from "Jeremy Tan [email protected]" is unknown trust
error: failed to update fontforgelibs32 (invalid or corrupted database (PGP signature))
fontforgelibs64 14.5 KiB 0.00B/s 00:00 [###############################] 100%
fontforgelibs64.sig 543.0 B 0.00B/s 00:00 [###############################] 100%
error: fontforgelibs64: signature from "Jeremy Tan [email protected]" is unknown trust
error: failed to update fontforgelibs64 (invalid or corrupted database (PGP signature))

FontForge without X under windows (vcxsrv)

From the FontForge manpage (fontforge -help)

If a scriptfile is specified then FontForge will not open the X display nor will it process any additional arguments. It will execute the scriptfile and give it any remaining arguments..."

But if i run a fontforge script under windows, the X-Server (vcsrc) starts every time. This prevents that i can start multiple instances of font forge. If already an instance is running i get the following error from the vcsrv.exe:

"cannot establish any listening sockets - make sure an x server isn't already running"

It would be great if somebody could fix this problem, because for me it is indispensable to run the FF Script in parallel.

Missing UCRT64 support in strip-python.sh

Similar to what's done in ffbuild.sh, UCRT64 could be supported by something like:
if [ "$MSYSTEM" == "MINGW32" ]; then
PACKAGE=mingw-w64-i686-python
PIP_PACKAGE=mingw-w64-i686-python-pip
SETUPTOOLS_PACKAGE=mingw-w64-i686-python-setuptools
elif [ "$MSYSTEM" = "MINGW64" ]; then
PACKAGE=mingw-w64-x86_64-python
PIP_PACKAGE=mingw-w64-x86_64-python-pip
SETUPTOOLS_PACKAGE=mingw-w64-x86_64-python-setuptools
elif [ "$MSYSTEM" = "UCRT64" ]; then
PACKAGE=mingw-w64-ucrt-x86_64-python
PIP_PACKAGE=mingw-w64-ucrt-x86_64-python-pip
SETUPTOOLS_PACKAGE=mingw-w64-ucrt-x86_64-python-setuptools
else
exit 2
fi

With this mod and the other fix to strip-python.sh that you just made, I'm getting further, but I suspect an error in line 520 of ffbuild.sh as I see:
.
.
.

removed directory './pycache'
Copying tcl/tk...
Stripping Python cache files (.pyc,.pyo,pycache)...
Copying the Python extension dlls...
The executable: /home/NateJoe/ff-build/target/ucrt64/bin/fontforge.exe
MSYS root: C:\msys64
FFEX root: C:\msys64\home\NateJoe\ff-build\target\ucrt64\bin
C:/msys64/home/NateJoe/ff-build/ReleasePackage/lib/python3.9/lib-dynload/*.dll: not found
Copying the FontForge executable...
Copying the libraries required by FontForge...
Generating the version file...
Adding in debugging utilities...
Build complete.

The only things I have in:
C:\msys64\home\NateJoe\ff-build\ReleasePackage\lib\python3.9\lib-dynload
are .pyd files.

Why can I only import fontforge after "cd bin" ?

I can't import fontforge after running fontforge-console.bat and ffpython, so I added FontForgeBuilds/bin to my PYTHONPATH

image

I don't want to cd bin every time. How to fix this? Oh, I'm on Windows 10 pro.

Making fonttools in 64 bit builds

I changed into ~/ff-build/work/mingw64/fontforge/contrib/fonttools
and ran make. I got the one I wanted to build ok.
For the record though, stripttc.c, wolf.c, dewolf.c, and pcl2ttf.c
get an error like this:

make dewoff
x86_64-w64-mingw32-gcc -DWIN32 -I/home/NateJoe/ff-build/target/mingw64//include -I/mingw64/include -I/usr/local/include -I/include -g -DWIN32 -I/home/NateJoe/ff-build/target/mingw64//include -I/mingw64/include -I/usr/local/include -I/include -g -I../.. -I../.. -L/home/NateJoe/ff-build/target/mingw64//lib -L/mingw64/lib -L/usr/local/lib -L/lib -lws2_32 dewoff.c -o dewoff
dewoff.c:8:10: fatal error: tottf.h: No such file or directory
#include "tottf.h"
^~~~~~~~~
compilation terminated.
make: *** [: dewoff] Error 1

Note also that documentation on https://fontforge.github.io/en-US/documentation/utilities/
I found misleading as it takes one to sourceforge which shows fontforge and fonttools at the same directory level (at least that is the way I took it), but on GitHub the fonttools are actually in contrib/fonttools. A reasonable place, but for a novice like me, I had a hard time finding them.
I thought for a while that they had just gotten dropped in the move to GitHub.

FontForge is now available from MSYS2

As of March 8, 2022, FontForge is available in various binary packages. I would guess it has full documentation along with the binaries. It doesn't seem to make the various utilities though. Adding "-DENABLE_FONTFORGE_EXTRAS=yes" to EXTRA_CMAKE_OPTS in ffbuild.sh for cmake successfully gets them built. Some of these utilities are rather out of date though. While running ffbuild.sh I saw where configure could not find sphinx, and seeing it as a build dependency of the MSYS2 fontfoge binary package for UCRT64, I decided to install "mingw-w64-ucrt-x86_64-python-sphinx" on my system and then build everything via ffbuild.sh. Don't know if this made a difference though as I never went looking for documentation before. Seems sphinx is a python documentation helper of some sort.

Building in debug mode has multiple issues (fixes inside)

The script doesn't install $BINARY/gdb-{32,64}.exe. We need this patch:

diff --git a/ffbuild.sh b/ffbuild.sh
index 4e3edbf..648d808 100644
--- a/ffbuild.sh
+++ b/ffbuild.sh
@@ -541,7 +541,7 @@ if (($makedebug)); then
     log_note "Adding in debugging utilities..."
     cp -f "$PATCH/ffdebugscript.txt" "$RELEASE/" || bail "Couldn't copy debug script"
     cp -f "$PATCH/fontforge-debug.bat" "$RELEASE/" || bail "Couldn't copy fontforge-debug.bat"
-    cp -f "$BINARY/gdb-$ARCHNUM.exe" "$RELEASE/bin/gdb.exe" || bail "Couldn't copy GDB"
+    cp -f "/$MSYSTEM/bin/gdb.exe" "$RELEASE/bin/" || bail "Couldn't copy GDB"
     cp -f "$BINARY/wtee.exe" "$RELEASE/bin/" || bail "Couldn't copy wtee"
     cp -rf "$DBSYMBOLS" "$RELEASE/bin/" || bail "Couldn't copy debugging symbols"
 fi

wtee.exe is missing. I have no idea what it does, but putting this 2008 version in $BINARY fixed the problem for me.

The gdb data directory isn't detected for some reason, perhaps as a consequence of my decision to use MSYS2's gdb. Fix by running as e.g.:

./ReleasePackage/bin/gdb.exe --data-directory=/mingw64/share/gdb ./ReleasePackage/bin/fontforge.exe

Would you like a "Building on Windows" page on the FontForge wiki @jtanx ? I could write it.

import fontforge failed in ffpython

It's been a while since I last ran ffpython in XP. Everything was ok back then. Now I've installed win7 and fontforge (v8-27-2015) and python 2.7. Then I ran:

  1. fontforge-console.bat - ok;
  2. ffpython - ok;
  3. import fontforge - ImportError: DLL load failed ...

Though python scripts can't be run in command prompt, they can, with a few fixes, in GUI.

-- edit --

Again, it's the zlib1.dll that causes this. Some Apps put their own zlib1.dll in windows/system32. It's not the right copy for fontforge. Replacing it with the one from fontforge would fix the abov-mentioned problem. Just don't know what's the side-effects for other apps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.