Skip to content

Instantly share code, notes, and snippets.

@MrSmith33
Last active August 29, 2015 14:09
Show Gist options
  • Save MrSmith33/ce631a31dd434f3a0970 to your computer and use it in GitHub Desktop.
Save MrSmith33/ce631a31dd434f3a0970 to your computer and use it in GitHub Desktop.
How to build a dll for freetype 2.5.3 to use with DerelictFT
  1. Go to freetype-2.5.3\include\config folder and open ftoption.h file.
  2. Inside add following lines. You may do it at DLL export compilation section, or anywhere else.
#define FT_EXPORT(x) __declspec(dllexport) x
#define FT_EXPORT_DEF(x) __declspec(dllexport) x
  1. Open Visual Studio 2010, and load freetype.sln from the freetype-2.5.3\builds\win32\vc2010 directory.
  2. Open the project config, and in the General tab, change Configuration Type to Dynamic Library (.dll).
  3. Change the project compilation configuration to Release.
  4. Add following files to the project (Source Files -> Add existing). Derelict loads FT_Get_BDF_Charset_ID and provided sln file doesn't contain that file, so you need to add it. (Similarly you can add any other file if it will be needed in any more recent version of DerelictFT).
src\base\ftdbf.c
src\bzip2\ftbzip2.c
src\base\ftcid.c

###Links: DerelictFT

@ArminWf
Copy link

ArminWf commented Mar 21, 2015

thanks MrSmith, as none c++ programmer this was some nice help to make things easy.

btw. it's src\base\ftbdf.c and not ftdbf.c

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment