Commit Graph

827 Commits

Author SHA1 Message Date
Alexei Podtelezhnikov 05089e8a07 [build/windows] Remove logging from default debug configurations.
DLG is rather costly for performance and should be used judiciously.
This removes it from the default configurations but gives an example
how to enable it using the `UserDefines` property.

* builds/windows/vc2010/freetype.vcxproj: Hide FT_DEBUG_LOGGING.
2021-11-08 22:33:12 -05:00
Alexei Podtelezhnikov 7f4b9bfbc9 [dlg] Define DLG_STATIC explicitly.
DLG_STATIC is intended to disable Windows DLL linking attributes.
It does not hurt to define it explicitly when we wrap DLG code.
This fixes tons of LNK4286 and C4273 warnings from MSVC if we
forget to define DLG_STATIC as a compiler option.

* builds/windows/vc2010/freetype.vcxproj: Remove DLG_STATIC option.
* src/dlg/dlgwrap.c [FT_DEBUG_LOGGING]: Define DLG_STATIC.
* include/freetype/internal/ftdebug.h [FT_DEBUG_LOGGING]: Ditto.
2021-11-07 10:20:16 -05:00
Alexei Podtelezhnikov 588a058d9b [builds/windows] Let MSBuild handle DLG copy.
* builds/windows/vc2010/freetype.vcxproj: Specify DlgCopy target.
* builds/windows/vc2010/script.bat: Deleted.
2021-11-02 22:51:51 -04:00
Alexei Podtelezhnikov 31fd054701 [builds/windows] Separate MSVC linker and librarian.
MSVC uses LIB for static and LINK for dynamic libraries. They are
related but the former has much smaller set of options.

* builds/windows/vc2010/freetype.vcxproj: Updated.
2021-10-29 10:13:47 -04:00
Alexei Podtelezhnikov 79b28d3781 [builds/windows] Revise MSVC linking optimizations.
* builds/windows/vc2010/freetype.vcxproj: Optimize DLL linking only.
* builds/windows/visualc/freetype.dsp: Ditto.
* builds/windows/visualc/freetype.vcproj: Ditto.
2021-10-28 22:51:15 -04:00
Alexei Podtelezhnikov f091e60c48 [builds/windows] Add MSVC linker optimazations.
We continue to build static libraries with statically linked C run-
time and add options to optimize references.

* builds/windows/vc2010/freetype.vcxproj: Sort entries, add options.
2021-10-25 22:31:09 -04:00
Alexei Podtelezhnikov 92f5e15f4f * builds/windows/vc2010/freetype.vcxproj: Use MachineARM64. 2021-10-23 09:43:46 -04:00
Alexei Podtelezhnikov 5e6efd6a4c [builds/windows] Prioritize x64.
* builds/windows/vc2010/freetype.sln: Sort entries.
2021-10-22 15:25:10 -04:00
Gabor Kertesz 80bd4cba7e [builds/windows] Add ARM64 platform.
* builds/windows/vc2010/freetype.sln: Updated
* builds/windows/vc2010/freetype.vcxproj: Updated.
* builds/windows/vc2010/freetype.vcxproj.filters: Minor fix.
2021-10-22 10:56:42 -04:00
Alexei Podtelezhnikov a156040600 [builds/unix, builds/vms] Standardize `mmap` failure.
* builds/unix/ftsystem.c (FT_Stream_Open): Check for MAP_FAILED.
* builds/vms/ftsystem.c (FT_Stream_Open): Ditto.

This should cover https://savannah.nongnu.org/patch/?5909 as well.
2021-10-05 14:19:06 -04:00
Alexei Podtelezhnikov 12ef831fc3 [builds/unix] Do not use autoconf SIZEOF.
* builds/unix/ftconfig.h.in [FT_USE_AUTOCONF_SIZEOF_TYPES]: Removed.
* builds/unix/configure.raw: Remove AC_CHECK_SIZEOF and update.

After this commit, autoconf builds will fully rely on <limits.h>
rather than falling back on it if AC_CHECK_SIZEOF failed for some
reason.  There is a risk that misconfigured cross-compilation might
have wrong headers.  Note that Meson and CMake builds always relied on
<limits.h> for sizes and availability of integer types.
2021-09-24 22:27:27 -04:00
Alexei Podtelezhnikov b4dddd8244 [base] Initialize stream memory earlier.
With Windows memory management tracking heap, it is important to use
it during the stream opening fallback. In Unix, the argument is
unused, but it is better to set it correctly.

* src/base/ftobjs.c (FT_Stream_New): Set memory before calling
`FT_Stream_Open`.
* builds/windows/ftsystem.c, builds/unix/ftsystem.c (FT_Stream_Open,
ft_close_stream_by_free): Call `ft_alloc` and `ft_free` with proper
memory argumment.
2021-09-22 00:30:03 -04:00
Alexei Podtelezhnikov 93866bec77 [builds/windows] Revert back to `CreateFileA` only.
Calling `CreateFileW` without making sure that the patname is really
`wchar_t` is a bad idea and can lead to unpredictable overreads. For
Windows CE, we impelemnt the missing API.

Fixes #1098 and !76 again.

* builds/windows/ftsystem.c (FT_Stream_Open): Call `CreateFileA`.
[_WIN32_WCE] (CreateFileA, FileSizeEx): Implement missing interfaces.
2021-09-21 23:14:42 -04:00
Alexei Podtelezhnikov 6190360967 Minor. 2021-09-20 22:18:29 -04:00
Alexei Podtelezhnikov 0b429b609c [builds/windows] Try both wide and narrow `CreateFile`
Windows handles wchar_t* UTF-16 and char* ANSI (presently UTF-8)
filenames using alternative -A and -W API. We'll try them both
when opening a file. This means that you should not worry about
about conversions.

Fixes #1098 and !76.

* builds/windows/ftsystem.c (FT_Stream_Open): Call alternative
`CreateFile` in the case of failure.
2021-09-17 08:31:27 -04:00
Alexei Podtelezhnikov 7e26c7a6da [builds/windows] Use native memory allocation API.
* builds/windows/ftsystem.c (ft_alloc, ft_realloc, ft_free):
Wrap HeapAlloc, HeapReAlloc, and HeapFree.
(FT_New_Memory): Set the heap handle.
2021-09-07 17:06:27 -04:00
Alexei Podtelezhnikov 612925ff22 s/0/NULL/ where appropriate. 2021-09-01 21:37:21 -04:00
Alexei Podtelezhnikov efa1a35907 * builds/windows/ftsystem.c (FT_Stream_Open): Fix double-close. 2021-08-30 09:38:25 -04:00
Alexei Podtelezhnikov 6804ce2986 [builds/windows] Revise SSE2 settings.
* builds/windows/vc2010/freetype.vcxproj [x64]: Remove explicit SSE2.
* builds/windows/visualc/freetype.vcproj [Win32]: Add explicit SSE2.
2021-08-27 09:46:40 -04:00
Alexei Podtelezhnikov 78f2bd0bd3 Whitespace formatting. 2021-08-22 22:32:07 -04:00
Carlo Bramini f0f00f7c16 * builds/windows/ftsystem.c (FT_Stream_Open): Support legacy Windows. 2021-08-19 22:14:42 -04:00
Alexei Podtelezhnikov e2cceed857 [builds/windows] Do not set CharacterSet for VC++.
* builds/windows/vc2010/freetype.vcxproj: s/Unicode/NotSet/.
* builds/windows/visualc/freetype.vcproj: s/"1"/"0"/.
2021-08-18 11:36:33 -04:00
Alexei Podtelezhnikov 536a10aca8 * builds/windows/ftsystem.c (FT_Stream_Open): Cast to remove warning. 2021-08-17 22:24:46 -04:00
Alexei Podtelezhnikov 5116f12963 * builds/windows/ftsystem.c (FT_Stream_Open): Support UNICODE compilation. 2021-08-17 22:08:45 -04:00
Werner Lemberg 801cd842e2 * Version 2.11.0 released.
==========================

Tag sources with `VER-2-11-0'.

* docs/VERSION.TXT: Add entry for version 2.11.0.
* docs/CHANGES: Updated.

* README, src/base/ftver.rc, builds/windows/vc2010/index.html,
builds/windows/visualc/index.html,
builds/windows/visualce/index.html,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
s/2.10.4/2.11.0/, s/2104/2110/.

* include/freetype/freetype.h (FREETYPE_MINOR): Set to 11.
(FREETYPE_PATCH): Set to 0.

* builds/unix/configure.raw (version_info): Set to 24:0:18.
* CMakeLists.txt (VERSION_MINOR): Set to 11.
(VERSION_PATCH): Set to 0.

* builds/toplevel.mk (dist): Ignore more git-related files.
2021-07-19 18:07:51 +02:00
Werner Lemberg 2bfdc161fb [build] Allow overriding of `ANSIFLAGS` for GNU make build.
* builds/*: Implement it.
2021-05-29 00:27:40 +02:00
Nikolaus Waxweiler ebf9e5ac71 [CMake] Update dependency finders.
1. Fixes CMake using any found HarfBuzz version lower than the minimum
required. This is based on HALX99's merge request at
https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests/31
2. Update FindHarfBuzz.cmake from
https://github.com/WebKit/WebKit/blob/1ce32454/Source/cmake/FindHarfBuzz.cmake
and guard post-CMake-3.1 features to keep the minimum version unchanged
3. Update FindBrotliDec.cmake to stop the warnings, based on what
https://github.com/google/woff2/blob/a0d0ed7d/cmake/FindBrotliDec.cmake
is doing

* CMakeLists.txt, builds/cmake/FindHarfBuzz.cmake: Implement 1 and 2.
* builds/cmake/FindBrotliDec.cmake: Implement 3.
2021-05-19 21:53:21 +01:00
Issam E. Maghni f998eaf972 * builds/meson/process_ftoption_h.py: Add LF at EOF.
This fixes

  .../ftoption.h:1030:10: error:
    no newline at end of file [-Werror,-Wnewline-eof]

for the generated `ftoption.h` file.
2021-04-25 20:30:43 +02:00
Alexei Podtelezhnikov 0bd5d95d66 * src/base/ftobjs.c (Mac_Read_POST_Resource): s/FT_ALLOC/FT_QALLOC/.
* builds/mac/ftmac.c (FT_New_Face_From_SFNT, read_lwfn): Ditto.
2021-04-23 22:04:05 -04:00
Werner Lemberg 6f6ad87638 * builds/unix/freetype2.m4: Fix help string formatting.
The indented `dnl` macros inserted unwanted horizontal space.

Problem reported by Ozkan Sezer <sezeroz@gmail.com>.
2021-04-16 20:50:27 +02:00
Werner Lemberg 111f2f27b5 * builds/unix/ax_pthread.m4: Update from 'autoconf-archive'.
A bunch of fixes were added recently to its git repository.
2021-02-19 20:33:50 +01:00
Werner Lemberg eca35e04fc [unix] Updates for autoconf 2.71.
This fixes warnings reported by autoupdate.

* builds/unix/ax_pthread.m4: Replace `as_echo` with `AS_ECHO`.

* builds/unix/configure.raw: Remove obsolete `AC_HEADER_STDC`.
Don't escape back quotes in messages for `AC_MSG_WARN`.
2021-02-17 21:10:34 +01:00
Werner Lemberg 635d394fe3 * builds/toplevel.mk: Fix previous commit.
<top_level>: Use `TOP_DIR` in `wildcard` function.
(check_out_submodule, copy_submodule): Move down to come after
definition of `all` rule.
Call `mkdir` conditionally.
2021-02-16 19:24:15 +01:00
Werner Lemberg c3a0b43ec6 * builds/toplevel.mk: Use rules for handling 'dlg'.
Suggested by Alexei.

(check_out_submodule, copy_submodule): New targets.
<top-level>: Replace calls to `shell` with rules.
2021-02-16 17:04:51 +01:00
Werner Lemberg dfa7cca5f3 * builds/toplevel.mk: Avoid side effects of `shell`.
We use a dummy variable to catch its output.  Otherwise the `make`
program is going to interpret the return value of `shell`; this can
cause obscure warning or error messages or even be harmful.
2021-02-16 14:29:45 +01:00
Werner Lemberg 92bd99bd25 Move 'dlg' submodule to `subprojects` directory.
This is for future changes with Meson, which doesn't allow a
different name for its `subprojects` directory.  Having both a
`submodules` and a `subprojects` directory is confusing.

* .gitmodules, autogen.sh (copy_submodule_files, DLG_INC_DIR,
DLG_SRC_DIR): Updated.

* builds/toplevel.mk (<top-level>, do-dist),
builds/windows/vc2010/script.bat: Updated.

* src/tools/no-copyright: Updated.
2021-02-16 14:07:18 +01:00
Alexei Podtelezhnikov fd7f92b6f0 * builds/unix/configure.raw [mmap]: Restore default path.
Fixes #1023.
2021-02-03 14:44:14 -05:00
Alexei Podtelezhnikov d3befe1c72 * builds/unix/configure.raw [mmap support]: Explicitly handle Windows.
Fixes #1024.
2021-02-02 23:02:54 -05:00
Werner Lemberg 5635d5edc4 * builds/unix/configure.raw [mmap support]: Correctly handle Windows.
Fixes #1024.
2021-02-02 10:33:53 +01:00
Werner Lemberg 689402418f builds/{unix,windows}/ftsystem.c: Sync comments with `src/base/ftsystem.c`.
Also some minor code formatting.
2021-02-02 09:44:42 +01:00
Werner Lemberg 4554c6da42 * builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c`. 2021-01-31 17:17:40 +01:00
Werner Lemberg 939e844468 * builds/unix/configure.raw: Fix typo.
Bug introduced in Vincent's last commit bb33f03.

Fixes issue #1021.
2021-01-30 06:32:38 +01:00
Vincent Torri bb33f03a71 * builds/windows/ftsystem.c: Add shared memory support on Windows. 2021-01-27 06:43:41 -05:00
Werner Lemberg 209e9841f2 Require HarfBuzz 2.0.0.
This is needed to make commit f1f9705f9 work.

* CMakeLists.txt (HARFBUZZ_MIN_VERSION), builds/unix/configure.raw
(harfbuzz_pkg), meson.build (harfbuzz_dep): Updated.
2021-01-23 14:15:29 +01:00
Werner Lemberg b6e8a71266 Update all copyright notices. 2021-01-17 07:18:48 +01:00
Alexei Podtelezhnikov 4e7a01840d * builds/unix/unixddef.mk: Remove the second DEVEL_DIR definition. 2021-01-16 12:04:35 -05:00
Werner Lemberg 5e4ed8ba2b Documentation update for repository move to 'freedesktop.org'. 2021-01-16 15:45:13 +01:00
Werner Lemberg 03ceda9701 * builds/*: s/BUILD_DIR/PLATFORM_DIR/.
The old variable name caused confusion.
2021-01-10 15:34:46 +01:00
Alexei Podtelezhnikov 3431553836 [builds] Revert `FTMODULE_H' changes.
* builds/toplevel.mk, builds/freetype.mk: Revert changes.
2021-01-08 13:22:34 -05:00
Alexei Podtelezhnikov 6f24bab68c [builds/windows] Fix up DLG build with VC++.
* builds/windows/vc2010/script.bat: Copy headers to include/.
* builds/windows/vc2010/freetype.vcxproj: Remove DLG paths.
2021-01-07 16:57:13 -05:00
Alexei Podtelezhnikov 576403f22b [builds] Relocate `FTMODULE_H'.
* builds/toplevel.mk: Place `FTMODULE_H' in include/.
* builds/freetype.mk: Simplify included path.
2021-01-07 16:02:32 -05:00
Alexei Podtelezhnikov 6369058eee [dlg] Move the headers to include/dlg to simplify their use.
* autogen.sh, builds/toplevel.mk: Copy headers to incluide/dlg.
* builds/freetype.mk, builds/windows/vc2010/freetype.vcxproj:
Simplify included path.
* include/freetype/internal/ftdebug.h: Simplify #include.
* src/dlg/rules.mk, .gitignore: Updated.
2021-01-07 00:13:23 -05:00
Alexei Podtelezhnikov 74f1b6be4a [builds/windows] Add SDF to VC2010 project.
* builds/windows/vc2010/freetype.vcxproj: Updated;
AfterBuild conveniences.
2021-01-04 23:35:01 -05:00
Werner Lemberg 2373074a2c * builds/windows/detect.mk (COPY): Make it work with `shell`.
Without this patch, we get the error

  builds/toplevel.mk:127: *** missing separator.  Stop.

Reported by Anuj, with a solution from Alexei.
2020-12-23 22:02:48 +01:00
Werner Lemberg 505943a6a4 * builds/unix/configure.raw: Don't set `FT_DEBUG_LOGGING`.
All debug options are handled exclusively in `ftoption.h`.
2020-12-07 17:08:37 +01:00
Werner Lemberg 015a9b8d8f */*: s/FT_LOGGING/FT_DEBUG_LOGGING/. 2020-12-07 10:27:42 +01:00
Werner Lemberg 7d3ab6a7db * builds/toplevel.mk (do-dist): Remove `submodules` directory. 2020-12-05 09:43:45 +01:00
Werner Lemberg 74822f64b0 [base] Don't close 'stderr' after logging.
* src/base/ftdebug.c, builds/windows/ftdebug.c (ft_logging_deinit):
Fix it.
2020-12-05 09:43:45 +01:00
Werner Lemberg f6b0fd7b79 Improve setup for 'dlg' library.
* autogen.sh (copy_submodule_file), builds/toplevel.mk: Redirect
stderr to `/dev/null`.

* builds/toplevel.mk: Move code block to handle 'dlg' stuff into
`check_platform` conditional.
Also fix wildcard expressions for guarding `git submodule` commands.
Also make file copying work with non-Unix platforms (untested).
2020-12-05 09:43:45 +01:00
Werner Lemberg fcdab61ed1 [build] Use gcc (and clang) in C99 mode.
Other compilers are unchanged.

* builds/compiler/gcc-dev.mk, builds/compiler/gcc.mk (ANSIFLAGS):
s/-ansi/-std=c99/.

* builds/freetype.mk (FT_CFLAGS): Remove `-std=c99`.

* builds/unix/configure.raw: Handle C99.
Remove no longer needed test for gcc 4.6 and earlier.
2020-12-05 09:43:42 +01:00
Werner Lemberg 047f295fac Typos. 2020-12-04 16:19:42 +01:00
Priyesh Kumar 33bd25ca07 [builds/unix] Check for 'pthread' library.
* builds/unix/ax_pthread.m4: New file, taken from 'autoconf-archive'
git repository.

* builds/unix/configure.raw: Check for 'pthread'; also check whether
it works.
2020-12-04 16:19:42 +01:00
Werner Lemberg ce43d808dc [base] Implement vertical alignment of log printing.
Based on a patch by Priyesh.

* include/freetype/internal/fttrace.h (FT_MAX_TRACE_LEVEL_LENGTH):
New macro.

* src/base/ftdebug.c, builds/windows/ftdebug.c (ft_log_handler):
Print logs after a fixed width to handle different lengths of
`FT_COMPONENT` entries.
Use `ft_strrchr` to check for final newline character.
2020-12-04 16:19:42 +01:00
Priyesh Kumar 2a5d8e8ff8 [builds/windows] Changes to build 'dlg' with FreeType on Windows.
We only support Visual C++ 2010 and newer.

* builds/windows/vc2010/script.bat: New windows batch file to copy
necessary 'dlg' files from `submodules/dlg` to `src/dlg`.  This file
is used as a pre-built event in Visual C++.

* builds/windows/ftdebug.c: Synchronize with `src/base/ftdebug.c`.

* builds/windows/vc2010/freetype.vcxproj.filters: Add
`src/dlgwrap.c`.

* builds/windows/vc2010/freetype.vcxproj
(AdditionalIncludeDirectories): Add include files of dlg for 'Debug'
and 'Debug Static' configurations on both 'x64' and 'win32'
platforms.
(PreprocessorDefinitions): Add `FT_LOGGING` for 'Debug' and 'Debug
Static' configurations on both 'x64' and 'win32' platforms.
Add `DLG_STATIC' for 'Debug' configuration on 'x64' and 'win32'
platforms.
(DisableLanguageExtensions): We need to disable the `/Za` option
when building 'dlg' with FreeType as 'dlg' strictly follows the C99
standard.  Visual C++ produces behaves unexpectedly when
compiling a C99 file with `/Za` option enabled.
2020-12-04 16:19:42 +01:00
Priyesh Kumar 34b1c897c1 [builds] Necessary changes to make 'dlg' compile.
* autogen.sh (copy_submodule_files): New script to copy all the
necessary source and include files from `submodules/dlg` to
`src/dlg`.

* src/dlg/dlgwrap.c: New wrapper file for `src/dlg.c`.  It enables
the build of 'dlg' if the `FT_LOGGING` macro is defined.

* src/dlg/rules.mk: New sub-Makefile.

* builds/freetype.mk (DLG_DIR): New variable to include the
header files of the 'dlg' library.
(INCLUDES): Add `DLG_DIR`.
(FT_CFLAGS): Add `-std=c99' flag.
Include `src/dlg/rules.mk` file to build 'dlg' library.
(OBJ_S, OBJ_M): Add `DLG_OBJS_M` and `DLG_OBJS_S`.

* builds/toplevel.mk: For builds directly from the git repository
we need to copy files from `submodule/dlg` to `src/dlg`.

* include/freetype/config/ftoption.h, devel/ftoption.h (FT_LOGGING):
New macro to enable or disable the logging facility in FreeType.
2020-12-01 09:20:32 +01:00
Werner Lemberg 56c610b145 builds/meson/*: Add copyright boilerplate. 2020-11-27 15:37:41 +01:00
Werner Lemberg 6a2b3e4007 * Version 2.10.4 released.
==========================

Tag sources with `VER-2-10-4'.

* docs/VERSION.TXT: Add entry for version 2.10.4.
* docs/CHANGES: Updated.

* README, src/base/ftver.rc, builds/windows/vc2010/index.html,
builds/windows/visualc/index.html,
builds/windows/visualce/index.html,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
s/2.10.3/2.10.4/, s/2103/2104/.

* include/freetype/freetype.h (FREETYPE_PATCH): Set to 4.

* builds/unix/configure.raw (version_info): Set to 23:4:17.
* CMakeLists.txt (VERSION_PATCH): Set to 4.
2020-10-20 07:13:33 +02:00
Werner Lemberg 337670af0a * Version 2.10.3 released.
==========================

Tag sources with `VER-2-10-3'.

* docs/VERSION.TXT: Add entry for version 2.10.3.

* README, src/base/ftver.rc, builds/windows/vc2010/index.html,
builds/windows/visualc/index.html,
builds/windows/visualce/index.html,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
s/2.10.2/2.10.3/, s/2102/2103/.

* include/freetype/freetype.h (FREETYPE_PATCH): Set to 3.

* builds/unix/configure.raw (version_info): Set to 23:3:17.
* CMakeLists.txt (VERSION_PATCH): Set to 3.
2020-10-10 18:14:57 +02:00
Werner Lemberg c9f588be56 Document changes to last release. 2020-10-10 12:48:18 +02:00
Werner Lemberg 3ce0df52e2 [meson] Move auxiliary scripts to `builds/meson`.
Suggested by Alexei.

* scripts/*.py: Move meson scripts to...
* builds/meson/*.py: ... this new location.

* meson.build: Updated.
2020-09-22 20:05:37 +02:00
David Turner 66978a5887 Add Meson build project file.
Example usage:

  # Configure Meson build in directory `build-meson` to generate
  # release binaries comparable to to the ones from the
  # autotools/make build system.
  meson setup build-meson \
        --prefix=/usr/local \
        --buildtype=debugoptimized \
        --strip \
        -Db_ndebug=true

  # After configuring the Meson build with the above command,
  # compile and install to `/usr/local/`; this includes a pkg-config
  # file.
  ninja -C build-meson install

  # Alternatively, compile and install to `/tmp/aa/usr/local/...`
  # for packaging.
  DESTDIR=/tmp/aa ninja -C build-meson install

  # Generate documentation under `build-meson/docs`.
  ninja -C build-meson docs

Library size comparison for stripped `libfreetype.so` generated by
all three build systems:

  - Default build (autotools + libtool): 712 KiB
  - CMake build (RelWithDebInfo):        712 KiB
  - Meson build:                         712 KiB

* meson.build: New top-level Meson build file for the library.

* meson_options.txt: New file.  It holds user-selectable options for
the build, which can be printed with `meson configure`, and selected
at `meson setup` or `meson --reconfigure` time with
`-D<option>=<value>`.

* scripts/parse_modules_cfg.py: A script invoked by `meson.build` to
parse `modules.cfg` and extract important information out of it
(i.e., the list of modules).

* scripts/process_ftoption_h.py: New script invoked by `meson.build`
to process the original `ftoption.h` file.  It enables or disables
configuration macro variables based on the available dependencies.
This is similar to what other build systems are using (i.e., Meson's
`configure_file()` command is not used here).

* scripts/extract_freetype_version.py: New script invoked by
`meson.build` to extract the FreeType version number from
`<freetype/freetype.h>`.

* scripts/extract_libtool_version.py: New script invoked by
`meson.build` to extract the libtool `revision_info` data from
`builds/unix/configure.raw`, and to generate the corresponding
shared library suffix.

* scripts/generate_reference_docs.py: New script invoked by
`meson.build` to generate the FreeType 2 reference documentation
(using the `docwriter` and `mkdocs` packages, which must be already
installed).
2020-09-21 07:53:02 +02:00
Priyesh Kumar 53be1753de Fix `-Wformat' compiler warnings.
* src/*: Fix format specifiers.

* builds/unix/ftsystem.c (FT_Stream_Open): Ditto.
2020-07-28 07:33:40 +02:00
Werner Lemberg c922ffa5d2 * builds/unix/configure.raw: Fix inclusion of `ftoption.h'. 2020-07-12 07:52:55 +02:00
David Turner bb66c8d8cf [build] Split off more stuff from `ftconfig.h'.
* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
include/freetype/config/ftconfig.h: Split off macro definitions
required by the FreeType API headers to...
* include/freetype/config/public-macros.h: ...this new file.

* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
include/freetype/config/ftconfig.h: Split off macro definitions used
by the library but not to be exposed to clients to...
* include/freetype/config/compiler-macros.h: ...this new file.

* include/freetype/internal/*.h, src/raster/ftraster.h: Include
`compiler-macros.h' where needed.
2020-07-05 10:42:23 +02:00
David Turner 0322efb5e5 [build] Move mac support code to `mac-support.h'.
* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
include/freetype/config/ftconfig.h: Split off mac-specific stuff
to...
* include/freetype/config/mac-support.h: ...this new file.

* CMakeLists.txt, builds/unix/configure.raw: Remove `/undef ->
#undef' string replacement; the affected code is no longer part of
the `ftconfig.h' template.
2020-07-05 09:59:29 +02:00
David Turner bd7251ac97 [build] Put integer type definitions into `integer-types.h'.
Refactor some of the `ftconfig.h' headers and template to move the
definition of the FreeType integer types (e.g., `FT_Int16') to a
common header file `freetype/config/integer-types.h'.

* builds/unix/ftconfig.h.in, builds/vms/ftconfig.h,
include/freetype/config/ftconfig.h: Split off integer type
definition stuff to...
* include/freetype/config/integer-types.h: ...this new file.

* builds/unix/ftconfig.h.in: Control the definition of
`FT_SIZEOF_INT' and `FT_SIZEOF_LONG' with macro
`FT_USE_AUTOCONF_SIZEOF_TYPES'.  If these are not defined, auto
detection happens in `integer-types.h' as usual based on `INTXX_MAX'
values.  Otherwise the autoconf-detected values are used.

* builds/unix/configure.raw (CPPFLAGS): Don't include path to
`config' directory.  Instead, ...
(FT_CONFIG_STANDARD_LIBRARY_H): Use complete path.
2020-07-05 09:52:23 +02:00
David Turner a4d9206754 [build] Rename `build/unix/ftconfig.in' to `ftconfig.h.in'.
Since we are no longer limited to 8.3 file names, it is simpler to
follow the usual conventions for template files.

* builds/unix/ftconfig.in: Renamed to...
* builds/unix/ftconfig.h.in: ...this.

* CMakeLists.txt, builds/unix/configure.raw: Updated.
2020-07-05 09:51:38 +02:00
Werner Lemberg 1658685967 Remove redundant inclusion of `ft2build.h'.
* */*: Remove `#include <ft2build.h>' where possible.

* include/freetype/freetype.h: Remove cpp error about missing
inclusion of `ft2build.h'.
2020-06-13 21:15:45 +02:00
David Turner e13391333f Make macros for header file names optional.
We no longer have to take care of the 8.3 file name limit; this
allows us (a) to introduce longer, meaningful file names, and (b) to
avoid macro names in `#include' lines altogether since some
compilers (most notably Visual C++) doesn't support this properly.

*/*: Replace

   #include FOO_H

with

   #include <freetype/foo.h>

or something similar.  Also update the documentation.
2020-06-08 13:31:55 +02:00
David Turner 62fea391fa Remove obsolete HAVE_STDINT_H probing macro.
This macro was updated by the unix configure script and the
`CMakeLists.txt' one, but is never used in the source tree (nor is
<stdint.h> included anywhere).

* CMakeLists.txt, builds/unix/ftconfig.in: Don't handle
`HAVE_STDINT_H'.
2020-05-18 18:42:57 +02:00
David Turner 4eee13404d Remove Jamfile files from the tree.
These have not been used in a very, very long time, so better remove
them.  A corresponding patch will be submitted to the
`freetype2-demos' repository.

* src/Jamfile, src/*/Jamfile, Jamrules: Delete.
2020-05-18 17:56:06 +02:00
Alexei Podtelezhnikov 652f886319 [smooth] Stop using dedicated LCD modules and classes.
The LCD modules were never truly independent. They mostly served as
a way to disable patented LCD rendering, which is no longer necessary.
The `smooth' module now handles LCD modes as well.

* src/smooth/ftsmooth.c (ft_smooth_lcd_renderer_class.
ft_smooth_lcdv_renderer_class): Deleted.
(ft_render_smooth): Reworked from `ft_render_smooth_generic'.
* src/smooth/ftsmooth.h: Remove dedicated LCD classes.
* src/smooth/module.mk: Remove dedicated LCD modules.
* include/freetype/config/ftmodule.h: Ditto.
* builds/amiga/include/config/ftmodule.h: Ditto.
* include/freetype/ftmodapi.h: Do not mention LCD modules.
2020-05-11 23:30:37 -04:00
Alexei Podtelezhnikov 093f87bfe4 Formatting. 2020-05-09 22:32:03 -04:00
Werner Lemberg 132f19b779 * Version 2.10.2 released. ==========================
Tag sources with `VER-2-10-2'.

* docs/VERSION.TXT: Add entry for version 2.10.2.

* README, Jamfile (RefDoc), src/base/ftver.rc,
builds/windows/vc2010/index.html, builds/windows/visualc/index.html,
builds/windows/visualce/index.html,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/index.html, docs/freetype-config.1:
s/2.10.1/2.10.2/, s/2101/2102/.

* include/freetype/freetype.h (FREETYPE_PATCH): Set to 2.

* builds/unix/configure.raw (version_info): Set to 23:2:17.
* CMakeLists.txt (VERSION_PATCH): Set to 2.

* docs/CHANGES: Updated.
2020-05-09 07:09:40 +02:00
Alexei Podtelezhnikov ed62b12d6c Typo and comment. 2020-05-03 23:22:08 -04:00
Alexei Podtelezhnikov de60e7d3f8 * builds/freetype.mk: Refactor for readability. 2020-05-03 17:11:20 -04:00
Alexei Podtelezhnikov 49967cb610 [builds] Clean up Windows CE project files.
Remove version from filenames that caused a lot of polution in the
release process. Use VERSIONINFO resource instead.

* builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2008-ce/freetype.vcproj,
builds/windows/visualce/freetype.vcproj,
builds/windows/visualce/freetype.dsp: s/2101//g, but add `ftver.rc'.
* builds/wince/vc2008-ce/index.html,
builds/wince/vc2005-ce/index.html,
builds/windows/visualce/index.html: s/2101//g.
2020-05-02 13:50:33 -04:00
Alexei Podtelezhnikov 9c850f5611 [builds/unix] Consolidate marco overrides (for the demos to see them).
* builds/unix/unix-cc.in (FT_CONFIG_MODULES_H, FT_CONFIG_OPTIONS_H):
Override them here...
* builds/freetype.mk: ... instead of here.
2020-05-01 22:30:15 -04:00
Werner Lemberg 11beee855e Allow setting `CC' in Unix build (#58051).
* builds/unix/unix-cc.in (CC): Use `override'.  The command line
  value of `CC' (if any) is stored already in `CCraw'.
2020-04-08 09:05:32 +02:00
Nikhil Ramakrishnan 13c0df80dc [docs] Fix building docs if `srcdir' != `builddir'.
`docs/reference/*' was moved one directory up in commit 237fed6.

* builds/unix/unix-def.in (PIP): Remove variable.

* configure: Create `docs' directory and copy assets from
`docs/markdown'.

* docs/README: Output directory is `reference'.
2020-03-22 23:29:51 +05:30
Nikhil Ramakrishnan 1fd3148713 [docwriter] Drop support for Python < 3.5.
Python versions < 3.5 have reached end-of-life and as such, no
security or bug fixes will be provided for those versions.  See

  https://devguide.python.org/#status-of-python-branches

for more information.

* Jamfile (RefDoc): Add `site' parameter.

* builds/detect.mk (std_setup): Update Python version requirement.

* builds/freetype.mk (refdoc-venv): Use pip as `python -m pip'.

* builds/unix/ax_compare_version.m4,
builds/unix/ax_prog_python_version.m4: Macros to detect Python
version.  New files.

* builds/unix/configure.raw: Check for Python >= 3.5 and remove
check for `pip'.

* docs/CHANGES, docs/INSTALL.GNU, docs/README: Updated.
2020-03-21 20:17:17 +05:30
Werner Lemberg 84d56589f0 Require HarfBuzz 1.8.
* builds/unix/configure.raw, CMakeLists.txt: Request HarfBuzz 1.8.0
or newer.

We are going to add auto-hinter support for Hanifi Rohingya, which
was introduced in Unicode 11.0.
2020-02-19 19:22:49 +01:00
Werner Lemberg e5038be704 Update all copyright notices. 2020-01-19 17:05:19 +01:00
Hugh McMaster 496601e504 [docs] (2/2) Fix generation of API documentation (#56745).
Creating the API Reference in the (new) `reference' sub-directory is
consistent with other documentation sub-topics, such as `design',
`glyphs' and `tutorial'.

This patch fixes broken hyperlinks in the documentation pointing to
and from the API Reference.  It also allows web assets to load from
their relative paths.

* builds/freetype.mk (DOC_DIR): Adjust.
(refdoc, refdoc-venv): Add `--site' argument.

* builds/toplevel.mk (do-dist): Updated.
2019-12-21 19:18:54 +01:00
Werner Lemberg 3de1b8d0b0 [cmake] Add brotli support.
* CMakeLists.txt (FT_WITH_BROTLI): New option.

* builds/cmake/FindBrotliDec.cmake: New file.
2019-09-05 14:10:01 +02:00
Werner Lemberg bbb14361db FindHarfBuzz.cmake: Change indentation to two spaces; shorten lines. 2019-09-05 12:38:17 +02:00
Werner Lemberg 60c52f0edb [woff2] Formatting; some comments. 2019-08-27 10:29:59 +02:00
Nikhil Ramakrishnan 732da8a4b7 * builds/unix/configure.raw: Change argument name to `brotli'. 2019-08-27 09:11:37 +02:00
Nikhil Ramakrishnan 9443a1bc3e Add Brotli dependency and required checks.
Brotli is required for decompressing WOFF2 font directory streams.
The library is thus being added as an optional dependency for
FreeType.

* builds/unix/configure.raw: Add checks for `libbrotlidec'.
(REQUIRES_PRIVATE, LIBS_PRIVATE, LIBSSTATIC_CONFIG): Updated.

* devel/ftoption.h, include/freetype/config/ftoption.h
(FT_CONFIG_OPTION_USE_BROTLI): New macro.
2019-08-27 09:09:48 +02:00
Werner Lemberg 8cf046c38d * Version 2.10.1 released.
==========================

Tag sources with `VER-2-10-1'.

* docs/VERSION.TXT: Add entry for version 2.10.1.

* README, Jamfile (RefDoc), src/base/ftver.rc,
builds/windows/vc2010/freetype.vcxproj,
builds/windows/vc2010/index.html,
builds/windows/visualc/freetype.dsp,
builds/windows/visualc/freetype.vcproj,
builds/windows/visualc/index.html,
builds/windows/visualce/freetype.dsp,
builds/windows/visualce/freetype.vcproj,
builds/windows/visualce/index.html,
builds/wince/vc2005-ce/freetype.vcproj,
builds/wince/vc2005-ce/index.html,
builds/wince/vc2008-ce/freetype.vcproj,
builds/wince/vc2008-ce/index.html: s/2.10.0/2.10.1/, s/2100/2101/.

* include/freetype/freetype.h (FREETYPE_PATCH): Set to 1.

* builds/unix/configure.raw (version_info): Set to 23:1:17.
* CMakeLists.txt (VERSION_PATCH): Set to 1.

* include/freetype/fterrors.h (FT_Error_String): Fix C++ compilation.
2019-07-01 15:56:34 +02:00