Fix freetype compilation. Add tests.