Compare commits

..

11 Commits

Author SHA1 Message Date
Priyesh Kumar 2579d0acea [builds] Updates to check for a working pthread library
* builds/unix/configure.raw: Check for `pthread', also check if it
	is working.
2020-08-31 18:02:47 +05:30
Priyesh Kumar 7e6b43edf3 [base] Fix the vertical alignment of printing of logs.
* src/base/ftdebug.c (ft_log_handler): Updates to print logs after
	a fixed width for better vertical alignment.

	* builds/windows/ftdebug.c (ft_log_handler): Updates to print logs after
	a fixed width for better vertical alignment.
2020-08-31 18:02:23 +05:30
Priyeshkkumar 526d973e31 [docs] Updated logging related documentation
* docs/DEBUG: Updates related to `FT_LOGGING'.

	* README.git: Updates related to logging

	* src/sfnt/ttload.c (tt_face_load_font_dir): Changed layout of tracing
    messages.
2020-08-28 11:28:17 +05:30
Priyeshkkumar 968d484cc0 Fixed `-Wformat' warnings.
* src/*: Fixed format specifiers.

	*  src/bdf/bdflib.c (ACMSG3, ACMSG7): Fixed `-Wformat' warnings.
2020-08-28 09:56:38 +05:30
Priyeshkkumar c5dba671aa [builds/windows] Made changes to build dlg with FreeType on Windows.
* 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 studios.

	* builds/windows/ftdebug.c: Added support for logging and logging related
	public APIs.
	(ft_debug_init): Updates to support the change of levels of tracing
	components of FreeType at run-time.
	(FT_Trace_Set_Level): New function to change the levels of tracing
	components at run-time.
	(FT_Trace_Set_Default_Level): New function to reset the levels of
	tracing components back to default.
	(FT_Set_Log_Handler, FT_Set_Default_Log_Handler, FT_Callback): Added
	function definitions.

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

	* builds/windows/vc2010/freetype.vcxproj (AdditionalIncludeDirectories):
	Added include files of dlg for `Debug' and `Debug Static' configurations
	on both `x64' and `win32' platforms.
	(PreprocessorDefinitions): Added `FT_LOGGING' for `Debug' and
	`Debug Static' configurations on both `x64' and `win32' platforms.  Added
	`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 `C99' standards and
	the Visual Studios produces unexpected behaviours when compiling a `C99'
	file with `/Za' option enabled.
2020-08-27 23:28:05 +05:30
Priyeshkkumar 802176853b [base] Added a public API to change the log handling function at run-time.
* include/freetype/ftlogging.h (FT_Custom_Log_Handler): New function
	pointer to store the custom callback logging function.
	(FT_Set_Log_Handler, FT_Set_Default_Log_Handler): New functions to set and
	reset custom log handler.

	* include/freetype/internal/ftdebug.h: Added variables to support custom
	callback logging function.
	(FT_Callback): A function to print log using custom callback logging
	function, which is set using `FT_Set_Log_Handler'.

	* src/base/ftdebug.c: Added support for handling custom logging callback
	function.
	(FT_Set_Log_Handler, FT_Set_Default_Log_Handler, FT_Callback): Added
	function definitions.
2020-08-27 13:01:05 +05:30
Priyeshkkumar 1c095f8174 * include/freetype/ftlogging.h: New header file, it contains logging
related public APIs.

	[base] Added a public API to change the levels of tracing components.

	* src/base/ftdebug.c: Added new variables.
	(ft_debug_init): Updates to support the change of levels of tracing
	components of FreeType at run-time.
	(FT_Trace_Set_Level): New function to change the levels of tracing
	components at run-time.
	(FT_Trace_Set_Default_Level): New function to reset the levels of
	tracing components back to default.

	* include/freetype/ftchapters.h: Added `debugging_apis' section under
        `support_api' chapter.
2020-08-26 21:30:35 +05:30
Priyeshkkumar 806adbe829 [base] Updates to print timestamp and name of `FT_COMPONENT' in logs.
* include/freetype/internal/ftdebug.h (FT_LOGGING_TAG, FT_LOGGING_TAG_):
	New macros to resolve the value of `FT_COMPONENT' into a string.
	(ft_add_tag, ft_remove_tag): New functions to add and remove dlg tags.

	* src/base/ftdebug.c: Added new variables to control the logging of
	timestamp and name of `FT_COMPONENT' along with actual logs.
	(ft_add_tag, ft_remove_tag): Added function definition.
	(ft_log_handler): Updates to print timestamp and name of `FT_COMPONENT'.
	(ft_debug_init): If `FT_LOGGING' macro is defined users can now control
	the logging of timestamp and name of `FT_COMPONENT' by adding tags in
	environment variable `FT2_DEBUG'
2020-08-26 19:44:01 +05:30
Priyeshkkumar 85060d51a1 [base] Added necessary functions and variables to print logs to a files
* include/freetype/internal/ftdebug.h: Added dlg's header files.
	(FT_LOG): New macro to redirect trace logs to dlg's API's whenever
	`FT_LOGGING' macros is defined.
	(ft_logging_init, ft_logging_deinit): New functions to handle
	initialization and uninitialization of logging related variables.
	(ft_log_handler): A new function to handle logs of FreeType.

	* src/base/ftdebug.c: Added necessary logging related variables.
	(ft_logging_init, ft_logging_deinit, ft_log_handler): Added function
	definitions.

	* src/base/ftinit.c(FT_Init_FreeType): If `FT_LOGGING' macro is defined
	call `ft_logging_init' to initialize logging related variables.
	(FT_Done_FreeType): If `FT_LOGGING' macro is defined call
	`ft_logging_deinit' to uninitialize logging related variables.

	* src/base/ftobjs.c (FT_New_Library): Call `ft_debug_init' only if macro
	`FT_LOGGING' is not defined.
2020-08-26 17:41:43 +05:30
Priyeshkkumar c2da552c7f [builds] Make necessary changes to compile dlg along with FreeType.
* autogen.sh (copy_submodule_files): New script to copy all the
	necessary dlg's source and include files from `submodules/dlg' to
	`src/dlg'

	* src/dlg/dlgwrap.c: A wrapper along `src/dlg.c', it enables the
	dlg's build only when `FT_LOGGING' maro is defined.

	* src/dlg/rules.mk: Makefile to compile dlg library along with
	rest of FreeType's modules.

	* builds/freetype.mk (DLG_DIR): New variable to include dlg's
	header files.
	(INCLUDES): Added `DLG_DIR'.
	(FT_CFLAGS): Added `-std=c99' flag.
	Include `src/dlg/rules.mk' file to build dlg.
	(OBJ_S, OBJ_M): Added `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, devel}/ftoption.h (FT_LOGGING): A new
	macro to enable or disable the logging facility in FreeType.
2020-08-26 12:27:52 +05:30
Priyeshkkumar 62e5220edb * .gitmodules: Added a submodule to track dlg logging library. 2020-08-26 10:12:52 +05:30
672 changed files with 12690 additions and 43655 deletions

10
.gitignore vendored
View File

@ -1,7 +1,3 @@
/build/ config.mk
/config.mk objs/vc2010/
include/dlg/ build
src/dlg/dlg.c
subprojects/*
!subprojects/*.wrap
/tests/data/*

View File

@ -1,230 +0,0 @@
# CI setup for FreeType.
stages:
- build
# FIXME: Use --werror once warnings are fixed.
variables:
MESON_ARGS: --fatal-meson-warnings --default-library=both
MESON_ARGS_WINDOWS: ${MESON_ARGS} --force-fallback-for=zlib
.build windows common:
# See
# https://gitlab.freedesktop.org/gstreamer/gst-ci/container_registry/213
image: 'registry.freedesktop.org/gstreamer/gst-ci/amd64/windows:2021-09-09.0-master'
stage: 'build'
tags:
- 'docker'
- 'windows'
- '1809'
- 'gstreamer-windows'
.build linux common:
# See
# https://gitlab.freedesktop.org/freetype/docker-images/container_registry/20896
image: 'registry.freedesktop.org/freetype/docker-images/debian:latest'
stage: 'build'
.build macos common:
stage: 'build'
tags:
- 'gst-macos-11.1'
.build windows meson:
extends: '.build windows common'
variables:
# Make sure any failure in PowerShell scripts is fatal.
ErrorActionPreference: 'Stop'
WarningPreference: 'Stop'
# Uncomment the following key if you need to pass custom args, as well
# with the `$env:MESON_ARGS` line in the `script:` blocks.
# MESON_ARGS: >-
# -Dfoo=enabled
# -Dbar=disabled
before_script:
# Update RootCAs in order to access to some sites.
- certutil -generateSSTFromWU "C:\roots.sst"
- Import-Certificate -CertStoreLocation "Cert:\LocalMachine\Root" "C:\roots.sst"
# Make sure meson is up to date so we don't need to rebuild the image
# with each release.
- pip3 install -U 'meson==0.59.*'
- pip3 install --upgrade certifi
- pip3 install -U ninja
# Generate a UWP cross-file in case it's used
- $PSDefaultParameterValues['Out-File:Encoding'] = 'ASCII'
- echo "[binaries]" > uwp-crossfile.meson
- echo "c = 'cl'" >> uwp-crossfile.meson
- echo "strip = ['true']" >> uwp-crossfile.meson
- echo "[built-in options]" >> uwp-crossfile.meson
- echo "c_args = ['-DWINAPI_FAMILY=WINAPI_FAMILY_APP', '-DUNICODE', '-D_WIN32_WINNT=0x0A00', '-we4013']" >> uwp-crossfile.meson
- echo "c_winlibs = ['windowsapp.lib']" >> uwp-crossfile.meson
script:
# For some reason, options are separated by newlines instead of spaces,
# so we have to replace them first.
#
# - $env:MESON_ARGS = $env:MESON_ARGS.replace("`n"," ")
#
# Gitlab executes PowerShell in docker, but `VsDevCmd.bat` is a batch
# script. Environment variables substitutions is done by PowerShell
# before calling `cmd.exe`, that's why we use `$env:FOO` instead of
# `%FOO%`.
- cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=$env:ARCH $env:VS_UWP &&
meson setup build $env:MESON_ARGS_WINDOWS $env:MESON_ARGS_UWP &&
meson compile --verbose -C build
$env:MESON_WINDOWS_TESTS"
# Format of job names:
# <OS> <Build-Tool> <Build-Params> <Architecture>
# Windows jobs.
windows meson vs2017 amd64:
extends: '.build windows meson'
variables:
ARCH: 'amd64'
MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
windows meson vs2017 x86:
extends: '.build windows meson'
variables:
ARCH: 'x86'
MESON_WINDOWS_TESTS: '&& meson test -C build && meson test -C build --benchmark'
windows meson vs2017 amd64 uwp:
extends: '.build windows meson'
variables:
ARCH: 'amd64'
VS_UWP: '-app_platform=UWP'
MESON_ARGS_UWP: '--cross-file uwp-crossfile.meson -Dc_winlibs="windowsapp.lib"'
# Linux Jobs.
#
# Jobs with "libs" in the name force-enable libraries.
# They are disabled for the remaining jobs.
linux autotools:
extends: '.build linux common'
script: |
./autogen.sh
./configure --with-brotli=no \
--with-bzip2=no \
--with-harfbuzz=no \
--with-png=no \
--with-zlib=no \
CC=gcc
make -j$(nproc) && make install
linux autotools libs:
extends: '.build linux common'
script: |
./autogen.sh
./configure --with-brotli=yes \
--with-bzip2=yes \
--with-harfbuzz=yes \
--with-png=yes \
--with-zlib=yes \
CC=gcc
make -j$(nproc) && make install
linux autotools libs clang:
extends: '.build linux common'
script: |
./autogen.sh
./configure --with-brotli=yes \
--with-bzip2=yes \
--with-harfbuzz=yes \
--with-png=yes \
--with-zlib=yes \
CC=clang
make -j$(nproc) && make install
linux meson:
extends: '.build linux common'
script: |
meson setup build ${MESON_ARGS} \
-Dbrotli=disabled \
-Dbzip2=disabled \
-Dharfbuzz=disabled \
-Dpng=disabled \
-Dzlib=disabled
meson compile --verbose -C build
meson install -C build
linux meson libs:
extends: '.build linux common'
script: |
meson setup build ${MESON_ARGS} \
-Dbrotli=enabled \
-Dbzip2=enabled \
-Dharfbuzz=disabled \
-Dpng=disabled \
-Dzlib=disabled
meson compile --verbose -C build
meson install -C build
linux cmake:
extends: '.build linux common'
script: |
cmake -B build -D FT_DISABLE_BROTLI=TRUE \
-D FT_DISABLE_BZIP2=TRUE \
-D FT_DISABLE_HARFBUZZ=TRUE \
-D FT_DISABLE_PNG=TRUE \
-D FT_DISABLE_ZLIB=TRUE
cmake --build build --target install
linux cmake libs:
extends: '.build linux common'
script: |
cmake -B build -D FT_REQUIRE_BROTLI=TRUE \
-D FT_REQUIRE_BZIP2=TRUE \
-D FT_REQUIRE_HARFBUZZ=TRUE \
-D FT_REQUIRE_PNG=TRUE \
-D FT_REQUIRE_ZLIB=TRUE
cmake --build build --target install
# MacOS jobs.
macos autotools:
extends: '.build macos common'
before_script:
- '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
script:
- brew install autoconf automake libtool
- ./autogen.sh
- ./configure
- 'make -j$(sysctl -n hw.logicalcpu)'
- make install
macos autotools clang:
extends: '.build macos common'
before_script:
- '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"'
script:
- brew install autoconf automake libtool
- ./autogen.sh
- './configure CC=clang'
- 'make -j$(sysctl -n hw.logicalcpu)'
- make install
macos meson:
extends: '.build macos common'
script:
- pip3 install --upgrade pip
- pip3 install -U meson
- pip3 install --upgrade certifi
- pip3 install -U ninja
- meson setup build ${MESON_ARGS}
- meson compile --verbose -C build
- sudo meson install -C build

4
.gitmodules vendored
View File

@ -1,3 +1,3 @@
[submodule "dlg"] [submodule "submodules/dlg"]
path = subprojects/dlg path = submodules/dlg
url = https://github.com/nyorain/dlg.git url = https://github.com/nyorain/dlg.git

View File

@ -1,24 +1,10 @@
Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> <behdad.esfahbod@gmail.com>
Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org> <behdad@google.com>
Behdad Esfahbod (بهداد اسفهبد) <behdad@behdad.org>
Alexander Borsuk <me@alex.bio> <alexander.borsuk@qnective.com>
Ewald Hew (Hew Yih Shiuan 丘毅宣) <ewaldhew@gmail.com>
Moazin Khatti (موؤذن کھٹی) <moazinkhatri@gmail.com>
Priyesh Kumar (प्रियेश कुमार) <priyeshkkumar@gmail.com>
Alexei Podtelezhnikov (Алексей Подтележников) <apodtele@gmail.com> Alexei Podtelezhnikov (Алексей Подтележников) <apodtele@gmail.com>
Nikhil Ramakrishnan (निखिल रामकृष्णन) <ramakrishnan.nikhil@gmail.com> Behdad Esfahbod <behdad@behdad.org> <behdad.esfahbod@gmail.com>
Dominik Röttsches <drott@chromium.org> <drott@google.com>
Kostya Serebryany <kcc@google.com> <konstantin.s.serebryany@gmail.com>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> <sssa@flavor1.ipc.hiroshima-u.ac.jp>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> sssa <sssa@IPA2004-mps.local>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> sssa <sssa@sssas-powerbook-g4-12.local>
Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Bram Tassyns <bramt@enfocus.be> bram tassyns <BramT@enfocus.be> Bram Tassyns <bramt@enfocus.be> bram tassyns <BramT@enfocus.be>
Bram Tassyns <bramt@enfocus.be> <BramT@enfocus.com> Bram Tassyns <bramt@enfocus.be> <BramT@enfocus.com>
David Turner <david@freetype.org> <david.turner.dev@gmail.com> Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> <sssa@flavor1.ipc.hiroshima-u.ac.jp>
David Turner <david@freetype.org> <digit@google.com> Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> sssa <sssa@IPA2004-mps.local>
Anuj Verma (अनुज वर्मा) <anujv@iitbhilai.ac.in> Suzuki, Toshiya (鈴木俊哉) <mpsuzuki@hiroshima-u.ac.jp> suzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>
Ben Wagner <bungeman@gmail.com> Bungeman <bungeman@gmail.com> Ben Wagner <bungeman@gmail.com> Bungeman <bungeman@gmail.com>
Ben Wagner <bungeman@gmail.com> <bungeman@google.com> Ewald Hew (Hew Yih Shiuan 丘毅宣) <ewaldhew@gmail.com>
Ben Wagner <bungeman@gmail.com> <bungeman@chromium.org> Nikhil Ramakrishnan (निखिल रामकृष्णन) <ramakrishnan.nikhil@gmail.com>
Nikolaus Waxweiler <madigens@gmail.com> <nikolaus.waxweiler@daltonmaag.com>

View File

@ -1,6 +1,6 @@
# CMakeLists.txt # CMakeLists.txt
# #
# Copyright (C) 2013-2022 by # Copyright (C) 2013-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# Written originally by John Cary <cary@txcorp.com> # Written originally by John Cary <cary@txcorp.com>
@ -12,17 +12,13 @@
# fully. # fully.
# #
# #
# The following will (1) create a build directory, and (2) change into it and # The following will 1. create a build directory and 2. change into it and
# call cmake to configure the build with default parameters as a static # call cmake to configure the build with default parameters as a static
# library. See # library. See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
# # for information about Debug, Release, etc. builds.
# https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html
#
# for information about debug or release builds, for example
# #
# cmake -B build -D CMAKE_BUILD_TYPE=Release # cmake -B build -D CMAKE_BUILD_TYPE=Release
# #
#
# For a dynamic library, use # For a dynamic library, use
# #
# cmake -B build -D BUILD_SHARED_LIBS=true -D CMAKE_BUILD_TYPE=Release # cmake -B build -D BUILD_SHARED_LIBS=true -D CMAKE_BUILD_TYPE=Release
@ -43,8 +39,7 @@
# #
# cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR64 .. # cmake -E chdir build cmake -G Xcode -D IOS_PLATFORM=SIMULATOR64 ..
# #
# # Finally, build the project with:
# Finally, build the project with
# #
# cmake --build build # cmake --build build
# #
@ -61,66 +56,56 @@
# #
# Some notes. # Some notes.
# #
# - `cmake' creates configuration files in # . `cmake' creates configuration files in
# #
# <build-directory>/include/freetype/config # <build-directory>/include/freetype/config
# #
# which should be further modified if necessary. # which should be further modified if necessary.
# #
# - You can use `cmake' directly on a freshly cloned FreeType git # . You can use `cmake' directly on a freshly cloned FreeType git
# repository. # repository.
# #
# - `CMakeLists.txt' is provided as-is since it is normally not used by the # . `CMakeLists.txt' is provided as-is since it is normally not used by the
# developer team. # developer team.
# #
# - Set the `FT_REQUIRE_ZLIB', `FT_REQUIRE_BZIP2', `FT_REQUIRE_PNG', # . Set the `FT_WITH_ZLIB', `FT_WITH_BZIP2', `FT_WITH_PNG',
# `FT_REQUIRE_HARFBUZZ', and `FT_REQUIRE_BROTLI' CMake variables to `ON' # `FT_WITH_HARFBUZZ', and `FT_WITH_BROTLI' CMake variables to `ON' to
# or `TRUE' to force using a dependency. Leave a variable undefined # force using a dependency. Leave a variable undefined (which is the
# (which is the default) to use the dependency only if it is available. # default) to use the dependency only if it is available. Example:
# Example:
# #
# cmake -B build -D FT_REQUIRE_ZLIB=TRUE \ # cmake -B build -D FT_WITH_ZLIB=ON \
# -D FT_REQUIRE_BZIP2=TRUE \ # -D FT_WITH_BZIP2=ON \
# -D FT_REQUIRE_PNG=TRUE \ # -D FT_WITH_PNG=ON \
# -D FT_REQUIRE_HARFBUZZ=TRUE \ # -D FT_WITH_HARFBUZZ=ON \
# -D FT_REQUIRE_BROTLI=TRUE [...] # -D FT_WITH_BROTLI=ON [...]
# #
# - Set `FT_DISABLE_XXX=TRUE' to disable a dependency completely (where # Set `CMAKE_DISABLE_FIND_PACKAGE_XXX=TRUE' to disable a dependency completely
# `XXX' is a CMake package name like `BZip2'). Example for disabling all # (where `XXX' is a CMake package name like `BZip2'). Example for disabling all
# dependencies: # dependencies:
# #
# cmake -B build -D FT_DISABLE_ZLIB=TRUE \ # cmake -B build -D CMAKE_DISABLE_FIND_PACKAGE_ZLIB=TRUE \
# -D FT_DISABLE_BZIP2=TRUE \ # -D CMAKE_DISABLE_FIND_PACKAGE_BZip2=TRUE \
# -D FT_DISABLE_PNG=TRUE \ # -D CMAKE_DISABLE_FIND_PACKAGE_PNG=TRUE \
# -D FT_DISABLE_HARFBUZZ=TRUE \ # -D CMAKE_DISABLE_FIND_PACKAGE_HarfBuzz=TRUE \
# -D FT_DISABLE_BROTLI=TRUE [...] # -D CMAKE_DISABLE_FIND_PACKAGE_BrotliDec=TRUE [...]
# #
# - NOTE: If a package is set as DISABLED, it cannot be set as REQUIRED # . Installation of FreeType can be controlled with the CMake variables
# without unsetting the DISABLED value first. For example, if
# `FT_DISABLE_HARFBUZZ=TRUE' has been set (Cache is present), you need to
# call `FT_DISABLE_HARFBUZZ=FALSE' before calling
# `FT_REQUIRE_HARFBUZZ=TRUE'.
#
# - Installation of FreeType can be controlled with the CMake variables
# `SKIP_INSTALL_HEADERS', `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL' # `SKIP_INSTALL_HEADERS', `SKIP_INSTALL_LIBRARIES', and `SKIP_INSTALL_ALL'
# (this is compatible with the same CMake variables in zlib's CMake # (this is compatible with the same CMake variables in zlib's CMake
# support). # support).
# To minimize the number of cmake_policy() workarounds, # FreeType explicitly marks the API to be exported and relies on the compiler
# CMake >= 3 is requested. # to hide all other symbols. CMake supports a C_VISBILITY_PRESET property
cmake_minimum_required(VERSION 3.0) # starting with 2.8.12.
cmake_minimum_required(VERSION 2.8.12)
if (NOT CMAKE_VERSION VERSION_LESS 3.3) if (NOT CMAKE_VERSION VERSION_LESS 3.3)
# Allow symbol visibility settings also on static libraries. CMake < 3.3 # Allow symbol visibility settings also on static libraries. CMake < 3.3
# only sets the property on a shared library build. # only sets the property on a shared library build.
cmake_policy(SET CMP0063 NEW) cmake_policy(SET CMP0063 NEW)
# Support new IN_LIST if() operator.
cmake_policy(SET CMP0057 NEW)
endif () endif ()
include(CheckIncludeFile) include(CheckIncludeFile)
include(CMakeDependentOption)
# CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which # CMAKE_TOOLCHAIN_FILE must be set before `project' is called, which
# configures the base build environment and references the toolchain file # configures the base build environment and references the toolchain file
@ -161,8 +146,8 @@ endif ()
project(freetype C) project(freetype C)
set(VERSION_MAJOR "2") set(VERSION_MAJOR "2")
set(VERSION_MINOR "12") set(VERSION_MINOR "10")
set(VERSION_PATCH "1") set(VERSION_PATCH "2")
# Generate LIBRARY_VERSION and LIBRARY_SOVERSION. # Generate LIBRARY_VERSION and LIBRARY_SOVERSION.
set(LIBTOOL_REGEX "version_info='([0-9]+):([0-9]+):([0-9]+)'") set(LIBTOOL_REGEX "version_info='([0-9]+):([0-9]+):([0-9]+)'")
@ -183,37 +168,13 @@ string(REGEX REPLACE
math(EXPR LIBRARY_SOVERSION "${LIBTOOL_CURRENT} - ${LIBTOOL_AGE}") math(EXPR LIBRARY_SOVERSION "${LIBTOOL_CURRENT} - ${LIBTOOL_AGE}")
set(LIBRARY_VERSION "${LIBRARY_SOVERSION}.${LIBTOOL_AGE}.${LIBTOOL_REVISION}") set(LIBRARY_VERSION "${LIBRARY_SOVERSION}.${LIBTOOL_AGE}.${LIBTOOL_REVISION}")
# External dependency library detection is automatic. See the notes at the # External dependency library detection is automatic. See the notes at the top
# top of this file, for how to force or disable dependencies completely. # of this file, for how to force or disable dependencies completely.
option(FT_DISABLE_ZLIB option(FT_WITH_ZLIB "Use system zlib instead of internal library." OFF)
"Disable use of system zlib and use internal zlib library instead." OFF) option(FT_WITH_BZIP2 "Support bzip2 compressed fonts." OFF)
cmake_dependent_option(FT_REQUIRE_ZLIB option(FT_WITH_PNG "Support PNG compressed OpenType embedded bitmaps." OFF)
"Require system zlib instead of internal zlib library." OFF option(FT_WITH_HARFBUZZ "Improve auto-hinting of OpenType fonts." OFF)
"NOT FT_DISABLE_ZLIB" OFF) option(FT_WITH_BROTLI "Support compressed WOFF2 fonts." OFF)
option(FT_DISABLE_BZIP2
"Disable support of bzip2 compressed fonts." OFF)
cmake_dependent_option(FT_REQUIRE_BZIP2
"Require support of bzip2 compressed fonts." OFF
"NOT FT_DISABLE_BZIP2" OFF)
option(FT_DISABLE_PNG
"Disable support of PNG compressed OpenType embedded bitmaps." OFF)
cmake_dependent_option(FT_REQUIRE_PNG
"Require support of PNG compressed OpenType embedded bitmaps." OFF
"NOT FT_DISABLE_PNG" OFF)
option(FT_DISABLE_HARFBUZZ
"Disable HarfBuzz (used for improving auto-hinting of OpenType fonts)." OFF)
cmake_dependent_option(FT_REQUIRE_HARFBUZZ
"Require HarfBuzz for improving auto-hinting of OpenType fonts." OFF
"NOT FT_DISABLE_HARFBUZZ" OFF)
option(FT_DISABLE_BROTLI
"Disable support of compressed WOFF2 fonts." OFF)
cmake_dependent_option(FT_REQUIRE_BROTLI
"Require support of compressed WOFF2 fonts." OFF
"NOT FT_DISABLE_BROTLI" OFF)
# Disallow in-source builds # Disallow in-source builds
@ -238,58 +199,41 @@ if (BUILD_FRAMEWORK)
message(FATAL_ERROR message(FATAL_ERROR
"You should use Xcode generator with BUILD_FRAMEWORK enabled") "You should use Xcode generator with BUILD_FRAMEWORK enabled")
endif () endif ()
set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD)") set(CMAKE_OSX_ARCHITECTURES "$(ARCHS_STANDARD_32_64_BIT)")
set(BUILD_SHARED_LIBS ON) set(BUILD_SHARED_LIBS ON)
endif () endif ()
# Find dependencies # Find dependencies
include(FindPkgConfig) set(HARFBUZZ_MIN_VERSION "1.8.0")
if (FT_WITH_HARFBUZZ)
if (NOT FT_DISABLE_HARFBUZZ) find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION} REQUIRED)
set(HARFBUZZ_MIN_VERSION "2.0.0") else ()
if (FT_REQUIRE_HARFBUZZ) find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION})
find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION} REQUIRED)
else ()
find_package(HarfBuzz ${HARFBUZZ_MIN_VERSION})
endif ()
endif () endif ()
if (NOT FT_DISABLE_PNG) if (FT_WITH_PNG)
if (FT_REQUIRE_PNG) find_package(PNG REQUIRED)
find_package(PNG REQUIRED) else ()
else () find_package(PNG)
find_package(PNG)
endif ()
endif () endif ()
if (NOT FT_DISABLE_ZLIB) if (FT_WITH_ZLIB)
if (FT_REQUIRE_ZLIB) find_package(ZLIB REQUIRED)
find_package(ZLIB REQUIRED) else ()
else () find_package(ZLIB)
find_package(ZLIB)
endif ()
endif () endif ()
if (NOT FT_DISABLE_BZIP2) if (FT_WITH_BZIP2)
# Genuine BZip2 does not provide bzip2.pc, but some platforms have it. find_package(BZip2 REQUIRED)
# For better dependency in freetype2.pc, bzip2.pc is searched else ()
# regardless of the availability of libbz2. If bzip2.pc is found, find_package(BZip2)
# Requires.private is used instead of Libs.private.
if (FT_REQUIRE_BZIP2)
find_package(BZip2 REQUIRED)
else ()
find_package(BZip2)
endif ()
pkg_check_modules(PC_BZIP2 bzip2)
endif () endif ()
if (NOT FT_DISABLE_BROTLI) if (FT_WITH_BROTLI)
if (FT_REQUIRE_BROTLI) find_package(BrotliDec REQUIRED)
find_package(BrotliDec REQUIRED) else ()
else () find_package(BrotliDec)
find_package(BrotliDec)
endif ()
endif () endif ()
# Create the configuration file # Create the configuration file
@ -403,10 +347,8 @@ set(BASE_SRCS
src/pshinter/pshinter.c src/pshinter/pshinter.c
src/psnames/psnames.c src/psnames/psnames.c
src/raster/raster.c src/raster/raster.c
src/sdf/sdf.c
src/sfnt/sfnt.c src/sfnt/sfnt.c
src/smooth/smooth.c src/smooth/smooth.c
src/svg/svg.c
src/truetype/truetype.c src/truetype/truetype.c
src/type1/type1.c src/type1/type1.c
src/type42/type42.c src/type42/type42.c
@ -415,8 +357,6 @@ set(BASE_SRCS
if (UNIX) if (UNIX)
list(APPEND BASE_SRCS "builds/unix/ftsystem.c") list(APPEND BASE_SRCS "builds/unix/ftsystem.c")
elseif (WIN32)
list(APPEND BASE_SRCS "builds/windows/ftsystem.c")
else () else ()
list(APPEND BASE_SRCS "src/base/ftsystem.c") list(APPEND BASE_SRCS "src/base/ftsystem.c")
endif () endif ()
@ -480,7 +420,7 @@ target_include_directories(
PRIVATE PRIVATE
${CMAKE_CURRENT_BINARY_DIR}/include ${CMAKE_CURRENT_BINARY_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/include ${CMAKE_CURRENT_SOURCE_DIR}/include
# Make <ftconfig.h> available for builds/unix/ftsystem.c. # Make <ftconfig.h> available for builds/unix/ftsystem.c.
${CMAKE_CURRENT_BINARY_DIR}/include/freetype/config ${CMAKE_CURRENT_BINARY_DIR}/include/freetype/config
) )
@ -492,55 +432,41 @@ if (BUILD_FRAMEWORK)
) )
set_target_properties(freetype PROPERTIES set_target_properties(freetype PROPERTIES
FRAMEWORK TRUE FRAMEWORK TRUE
MACOSX_FRAMEWORK_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/builds/mac/freetype-Info.plist MACOSX_FRAMEWORK_INFO_PLIST builds/mac/freetype-Info.plist
PUBLIC_HEADER "${PUBLIC_HEADERS}" PUBLIC_HEADER "${PUBLIC_HEADERS}"
XCODE_ATTRIBUTE_INSTALL_PATH "@rpath" XCODE_ATTRIBUTE_INSTALL_PATH "@rpath"
) )
endif () endif ()
# 'freetype-interface' is an interface library, to be accessed with
# `EXPORT_NAME Freetype::Freetype`. This is the target name provided by
# CMake's `FindFreetype.cmake`, so we provide it for compatibility.
add_library(freetype-interface INTERFACE)
set_target_properties(freetype-interface PROPERTIES
EXPORT_NAME Freetype::Freetype
INTERFACE_LINK_LIBRARIES freetype)
set(PKGCONFIG_REQUIRES "") set(PKG_CONFIG_REQUIRED_PRIVATE "")
set(PKGCONFIG_REQUIRES_PRIVATE "")
set(PKGCONFIG_LIBS "-L\${libdir} -lfreetype")
set(PKGCONFIG_LIBS_PRIVATE "")
if (ZLIB_FOUND) if (ZLIB_FOUND)
target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES}) target_link_libraries(freetype PRIVATE ${ZLIB_LIBRARIES})
target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS}) target_include_directories(freetype PRIVATE ${ZLIB_INCLUDE_DIRS})
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "zlib") list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "zlib")
endif () endif ()
if (BZIP2_FOUND) if (BZIP2_FOUND)
target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES}) target_link_libraries(freetype PRIVATE ${BZIP2_LIBRARIES})
target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS target_include_directories(freetype PRIVATE ${BZIP2_INCLUDE_DIR}) # not BZIP2_INCLUDE_DIRS
if (PC_BZIP2_FOUND) list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "bzip2")
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "bzip2")
else ()
list(APPEND PKGCONFIG_LIBS_PRIVATE "-lbz2")
endif ()
endif () endif ()
if (PNG_FOUND) if (PNG_FOUND)
target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES}) target_link_libraries(freetype PRIVATE ${PNG_LIBRARIES})
target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS}) target_compile_definitions(freetype PRIVATE ${PNG_DEFINITIONS})
target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS}) target_include_directories(freetype PRIVATE ${PNG_INCLUDE_DIRS})
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libpng") list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libpng")
endif () endif ()
if (HarfBuzz_FOUND) if (HARFBUZZ_FOUND)
target_link_libraries(freetype PRIVATE ${HarfBuzz_LIBRARY}) target_link_libraries(freetype PRIVATE ${HARFBUZZ_LIBRARIES})
target_include_directories(freetype PRIVATE ${HarfBuzz_INCLUDE_DIRS}) target_include_directories(freetype PRIVATE ${HARFBUZZ_INCLUDE_DIRS})
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}") list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "harfbuzz >= ${HARFBUZZ_MIN_VERSION}")
endif () endif ()
if (BROTLIDEC_FOUND) if (BROTLIDEC_FOUND)
target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES}) target_link_libraries(freetype PRIVATE ${BROTLIDEC_LIBRARIES})
target_compile_definitions(freetype PRIVATE ${BROTLIDEC_DEFINITIONS}) target_compile_definitions(freetype PRIVATE ${BROTLIDEC_DEFINITIONS})
target_include_directories(freetype PRIVATE ${BROTLIDEC_INCLUDE_DIRS}) target_include_directories(freetype PRIVATE ${BROTLIDEC_INCLUDE_DIRS})
list(APPEND PKGCONFIG_REQUIRES_PRIVATE "libbrotlidec") list(APPEND PKG_CONFIG_REQUIRED_PRIVATE "libbrotlidec")
endif () endif ()
@ -565,64 +491,44 @@ endif ()
if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL) if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
# Generate the pkg-config file # Generate the pkg-config file
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN) if (UNIX)
file(READ "${PROJECT_SOURCE_DIR}/builds/unix/freetype2.in" FREETYPE2_PC_IN)
string(REPLACE ";" ", " PKGCONFIG_REQUIRES_PRIVATE "${PKGCONFIG_REQUIRES_PRIVATE}") string(REPLACE ";" ", " PKG_CONFIG_REQUIRED_PRIVATE "${PKG_CONFIG_REQUIRED_PRIVATE}")
string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX} string(REPLACE "%prefix%" ${CMAKE_INSTALL_PREFIX}
FREETYPE2_PC_IN ${FREETYPE2_PC_IN}) FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%exec_prefix%" "\${prefix}" string(REPLACE "%exec_prefix%" "\${prefix}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN}) FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%libdir%" "\${prefix}/${CMAKE_INSTALL_LIBDIR}" string(REPLACE "%libdir%" "\${prefix}/${CMAKE_INSTALL_LIBDIR}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN}) FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%includedir%" "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}" string(REPLACE "%includedir%" "\${prefix}/${CMAKE_INSTALL_INCLUDEDIR}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN}) FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}" string(REPLACE "%ft_version%" "${LIBTOOL_CURRENT}.${LIBTOOL_REVISION}.${LIBTOOL_AGE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN}) FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%REQUIRES_PRIVATE%" "${PKG_CONFIG_REQUIRED_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%LIBS_PRIVATE%" "" # All libs support pkg-config
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
if (BUILD_SHARED_LIBS) set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc")
string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES}" if (EXISTS "${FREETYPE2_PC_IN_NAME}")
FREETYPE2_PC_IN ${FREETYPE2_PC_IN}) file(READ "${FREETYPE2_PC_IN_NAME}" ORIGINAL_FREETYPE2_PC_IN)
string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" "${PKGCONFIG_REQUIRES_PRIVATE}" else ()
FREETYPE2_PC_IN ${FREETYPE2_PC_IN}) set(ORIGINAL_FREETYPE2_PC_IN "")
string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS}" endif ()
FREETYPE2_PC_IN ${FREETYPE2_PC_IN}) if (NOT (ORIGINAL_FREETYPE2_PC_IN STREQUAL FREETYPE2_PC_IN))
string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" "${PKGCONFIG_LIBS_PRIVATE}" file(WRITE "${FREETYPE2_PC_IN_NAME}" ${FREETYPE2_PC_IN})
FREETYPE2_PC_IN ${FREETYPE2_PC_IN}) endif ()
else ()
string(REPLACE "%PKGCONFIG_REQUIRES%" "${PKGCONFIG_REQUIRES} ${PKGCONFIG_REQUIRES_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%PKGCONFIG_REQUIRES_PRIVATE%" ""
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%PKGCONFIG_LIBS%" "${PKGCONFIG_LIBS} ${PKGCONFIG_LIBS_PRIVATE}"
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
string(REPLACE "%PKGCONFIG_LIBS_PRIVATE%" ""
FREETYPE2_PC_IN ${FREETYPE2_PC_IN})
endif ()
set(FREETYPE2_PC_IN_NAME "${PROJECT_BINARY_DIR}/freetype2.pc") install(
if (EXISTS "${FREETYPE2_PC_IN_NAME}") FILES ${PROJECT_BINARY_DIR}/freetype2.pc
file(READ "${FREETYPE2_PC_IN_NAME}" ORIGINAL_FREETYPE2_PC_IN) DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
else () COMPONENT pkgconfig)
set(ORIGINAL_FREETYPE2_PC_IN "")
endif ()
if (NOT (ORIGINAL_FREETYPE2_PC_IN STREQUAL FREETYPE2_PC_IN))
file(WRITE "${FREETYPE2_PC_IN_NAME}" ${FREETYPE2_PC_IN})
endif () endif ()
install( install(
FILES ${PROJECT_BINARY_DIR}/freetype2.pc TARGETS freetype
DESTINATION ${CMAKE_INSTALL_LIBDIR}/pkgconfig
COMPONENT pkgconfig)
include(CMakePackageConfigHelpers)
write_basic_package_version_file(
${PROJECT_BINARY_DIR}/freetype-config-version.cmake
VERSION ${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_PATCH}
COMPATIBILITY SameMajorVersion)
install(
TARGETS freetype freetype-interface
EXPORT freetype-targets EXPORT freetype-targets
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR}
@ -634,10 +540,6 @@ if (NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL)
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
FILE freetype-config.cmake FILE freetype-config.cmake
COMPONENT headers) COMPONENT headers)
install(
FILES ${PROJECT_BINARY_DIR}/freetype-config-version.cmake
DESTINATION ${CMAKE_INSTALL_LIBDIR}/cmake/freetype
COMPONENT headers)
endif () endif ()
@ -645,7 +547,7 @@ endif ()
set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME}) set(CPACK_PACKAGE_NAME ${CMAKE_PROJECT_NAME})
set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The FreeType font rendering library.") set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The FreeType font rendering library.")
set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README") set(CPACK_PACKAGE_DESCRIPTION_FILE "${CMAKE_CURRENT_SOURCE_DIR}/README")
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/LICENSE.TXT") set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/docs/LICENSE.TXT")
set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR}) set(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_MAJOR})
set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) set(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR})

File diff suppressed because it is too large Load Diff

View File

@ -2597,7 +2597,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2000-2022 by Copyright (C) 2000-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -9422,7 +9422,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2002-2022 by Copyright (C) 2002-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -2821,7 +2821,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2005-2022 by Copyright (C) 2005-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -7932,7 +7932,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2006-2022 by Copyright (C) 2006-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -707,7 +707,7 @@
[base] Fix integer overflow. [base] Fix integer overflow.
* src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and * src/base/ftoutln.c (FT_Outline_EmboldenXY): Normalize incoming and
outgoing vectors and use fixed-point arithmetic. outgoing vectors and use fixed point arithmetic.
2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com> 2013-01-23 Alexei Podtelezhnikov <apodtele@gmail.com>
@ -6344,7 +6344,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2010-2022 by Copyright (C) 2010-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -5145,7 +5145,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2013-2022 by Copyright (C) 2013-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -5695,7 +5695,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2015-2022 by Copyright (C) 2015-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -2090,7 +2090,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2016-2022 by Copyright (C) 2016-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -3120,7 +3120,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2016-2022 by Copyright (C) 2016-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -2336,7 +2336,7 @@
---------------------------------------------------------------------------- ----------------------------------------------------------------------------
Copyright (C) 2017-2022 by Copyright (C) 2017-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -1,42 +0,0 @@
FREETYPE LICENSES
-----------------
The FreeType 2 font engine is copyrighted work and cannot be used
legally without a software license. In order to make this project
usable to a vast majority of developers, we distribute it under two
mutually exclusive open-source licenses.
This means that *you* must choose *one* of the two licenses described
below, then obey all its terms and conditions when using FreeType 2 in
any of your projects or products.
- The FreeType License, found in the file `docs/FTL.TXT`, which is
similar to the original BSD license *with* an advertising clause
that forces you to explicitly cite the FreeType project in your
product's documentation. All details are in the license file.
This license is suited to products which don't use the GNU General
Public License.
Note that this license is compatible to the GNU General Public
License version 3, but not version 2.
- The GNU General Public License version 2, found in
`docs/GPLv2.TXT` (any later version can be used also), for
programs which already use the GPL. Note that the FTL is
incompatible with GPLv2 due to its advertisement clause.
The contributed BDF and PCF drivers come with a license similar to
that of the X Window System. It is compatible to the above two
licenses (see files `src/bdf/README` and `src/pcf/README`). The same
holds for the source code files `src/base/fthash.c` and
`include/freetype/internal/fthash.h`; they wer part of the BDF driver
in earlier FreeType versions.
The gzip module uses the zlib license (see `src/gzip/zlib.h`) which
too is compatible to the above two licenses.
The MD5 checksum support (only used for debugging in development
builds) is in the public domain.
--- end of LICENSE.TXT ---

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

116
README
View File

@ -1,100 +1,92 @@
FreeType 2.12.1 FreeType 2.10.2
=============== ===============
Homepage: https://www.freetype.org Homepage: https://www.freetype.org
FreeType is a freely available software library to render fonts. FreeType is a freely available software library to render fonts.
It is written in C, designed to be small, efficient, highly It is written in C, designed to be small, efficient, highly
customizable, and portable while capable of producing high-quality customizable, and portable while capable of producing high-quality
output (glyph images) of most vector and bitmap font formats. output (glyph images) of most vector and bitmap font formats.
Please read the `docs/CHANGES` file, it contains IMPORTANT Please read the docs/CHANGES file, it contains IMPORTANT
INFORMATION. INFORMATION.
Read the files `docs/INSTALL*` for installation instructions; see the Read the files `docs/INSTALL*' for installation instructions; see
file `docs/LICENSE.TXT` for the available licenses. the file `docs/LICENSE.TXT' for the available licenses.
For using FreeType's git repository instead of a distribution bundle, The FreeType 2 API reference is located in `docs/reference/site';
please read file `README.git`. Note that you have to actually clone use the file `index.html' as the top entry point. [Please note that
the repository; using a snapshot will not work (in other words, don't currently the search function for locally installed documentation
use gitlab's 'Download' button). doesn't work due to cross-site scripting issues.]
The FreeType 2 API reference is located in directory `docs/reference`; Additional documentation is available as a separate package from our
use the file `index.html` as the top entry point. [Please note that sites. Go to
currently the search function for locally installed documentation
doesn't work due to cross-site scripting issues.]
Additional documentation is available as a separate package from our https://download.savannah.gnu.org/releases/freetype/
sites. Go to
https://download.savannah.gnu.org/releases/freetype/ and download one of the following files.
and download one of the following files. freetype-doc-2.10.2.tar.xz
freetype-doc-2.10.2.tar.gz
ftdoc2102.zip
freetype-doc-2.12.1.tar.xz To view the documentation online, go to
freetype-doc-2.12.1.tar.gz
ftdoc2121.zip
To view the documentation online, go to https://www.freetype.org/freetype2/docs/
https://www.freetype.org/freetype2/docs/
Mailing Lists Mailing Lists
------------- =============
The preferred way of communication with the FreeType team is using The preferred way of communication with the FreeType team is using
e-mail lists. e-mail lists.
general use and discussion: freetype@nongnu.org general use and discussion: freetype@nongnu.org
engine internals, porting, etc.: freetype-devel@nongnu.org engine internals, porting, etc.: freetype-devel@nongnu.org
announcements: freetype-announce@nongnu.org announcements: freetype-announce@nongnu.org
git repository tracker: freetype-commit@nongnu.org git repository tracker: freetype-commit@nongnu.org
The lists are moderated; see The lists are moderated; see
https://www.freetype.org/contact.html https://www.freetype.org/contact.html
how to subscribe. how to subscribe.
Bugs Bugs
---- ====
Please submit bug reports at Please submit bug reports at
https://gitlab.freedesktop.org/freetype/freetype/-/issues https://savannah.nongnu.org/bugs/?group=freetype
Alternatively, you might report bugs by e-mail to Alternatively, you might report bugs by e-mail to
`freetype-devel@nongnu.org`. Don't forget to send a detailed `freetype-devel@nongnu.org'. Don't forget to send a detailed
explanation of the problem -- there is nothing worse than receiving a explanation of the problem -- there is nothing worse than receiving
terse message that only says 'it doesn't work'. a terse message that only says `it doesn't work'.
Patches Patches
------- =======
For larger changes please provide merge requests at Please submit patches to the `freetype-devel@nongnu.org' mailing
list -- and thank you in advance for your work on improving
FreeType!
https://gitlab.freedesktop.org/freetype/freetype/-/merge_requests Details on the process can be found here:
Alternatively, you can send patches to the `freetype-devel@nongnu.org` https://www.freetype.org/developer.html#patches
mailing list -- and thank you in advance for your work on improving
FreeType!
Details on the process can be found here:
https://www.freetype.org/developer.html#patches
Enjoy! Enjoy!
The FreeType Team
The FreeType Team
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (C) 2006-2022 by Copyright (C) 2006-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, This file is part of the FreeType project, and may only be used,

View File

@ -1,36 +1,4 @@
README.git The git archive doesn't contain pre-built configuration scripts for
==========
repository issues
-----------------
FreeType's official repository site is
https://gitlab.freedesktop.org/freetype ,
from which the 'freetype.git' and 'freetype-demos.git' repositories
can be cloned in the usual way.
git clone https://gitlab.freedesktop.org/freetype/freetype.git
git clone https://gitlab.freedesktop.org/freetype/freetype-demos.git
If you want to use the Savannah mirror instead, you have to do a
slightly different incantation because the repository names contain
digit '2' for historical reasons.
git clone \
https://git.savannah.nongnu.org/git/freetype/freetype2.git \
freetype
git clone \
https://git.savannah.nongnu.org/git/freetype/freetype2-demos.git \
freetype-demos
standard builds with `configure`
--------------------------------
The git repository doesn't contain pre-built configuration scripts for
UNIXish platforms. To generate them say UNIXish platforms. To generate them say
sh autogen.sh sh autogen.sh
@ -42,54 +10,42 @@ which in turn depends on the following packages:
autoconf (2.62) autoconf (2.62)
The versions given in parentheses are known to work. Newer versions The versions given in parentheses are known to work. Newer versions
should work too, of course. Note that `autogen.sh` also sets up should work too, of course. Note that autogen.sh also sets up proper
proper file permissions for the `configure` and auxiliary scripts. file permissions for the `configure' and auxiliary scripts.
The `autogen.sh` script checks whether the versions of the above three The autogen.sh script now checks the version of above three packages
tools match the numbers above. Otherwise it will complain and suggest whether they match the numbers above. Otherwise it will complain and
either upgrading or using environment variables to point to more suggest either upgrading or using an environment variable to point to
recent versions of the required tools. a more recent version of the required tool(s).
Note that `aclocal` is provided by the 'automake' package on Linux, Note that `aclocal' is provided by the `automake' package on Linux,
and that `libtoolize` is called `glibtoolize` on Darwin (OS X). and that `libtoolize' is called `glibtoolize' on Darwin (OS X).
alternative build methods For static builds which don't use platform specific optimizations, no
-------------------------
For static builds that don't use platform-specific optimizations, no
configure script is necessary at all; saying configure script is necessary at all; saying
make setup ansi make setup ansi
make make
should work on all platforms that have GNU `make` (or `makepp`). should work on all platforms which have GNU make (or makepp).
A build with `cmake` or `meson` can be done directly from the git
repository. However, if you want to use the `FT_DEBUG_LOGGING` macro
(see file `docs/DEBUG` for more information) it is currently mandatory
to execute `autogen.sh` in advance; this script clones the 'dlg' git
submodule and copies some files into FreeType's source tree.
Code of Conduct Similarly, a build with `cmake' can be done directly from the git
--------------- repository.
Please note that this project is released with a Contributor Code of
Conduct (CoC). By participating in this project you agree to abide by
its terms, which you can find in the following link:
https://www.freedesktop.org/wiki/CodeOfConduct For using the `FT_LOGGING' macro while debugging(see docs/DEBUG for
more information) use the following git commands to checkout `dlg'
library as a git submodule.
CoC issues may be raised to the project maintainers at the following git submodule init
address: git submodule update
wl@gnu.org
apodtele@gmail.com
---------------------------------------------------------------------- ----------------------------------------------------------------------
Copyright (C) 2005-2022 by Copyright (C) 2005-2020 by
David Turner, Robert Wilhelm, and Werner Lemberg. David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used, This file is part of the FreeType project, and may only be used,

View File

@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
# Copyright (C) 2005-2022 by # Copyright (C) 2005-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -110,10 +110,7 @@ check_tool_version ()
fi fi
} }
# Solaris 10's shell doesn't like the `!` operator to negate the exit status. if test ! -f ./builds/unix/configure.raw; then
if test -f ./builds/unix/configure.raw; then
:
else
echo "You must be in the same directory as \`autogen.sh'." echo "You must be in the same directory as \`autogen.sh'."
echo "Bootstrapping doesn't work if srcdir != builddir." echo "Bootstrapping doesn't work if srcdir != builddir."
exit 1 exit 1
@ -141,25 +138,18 @@ check_tool_version $ACLOCAL aclocal ACLOCAL 1.10.1
check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4 check_tool_version $LIBTOOLIZE libtoolize LIBTOOLIZE 2.2.4
check_tool_version $AUTOCONF autoconf AUTOCONF 2.62 check_tool_version $AUTOCONF autoconf AUTOCONF 2.62
# This sets FREETYPE version. # This sets freetype_major, freetype_minor, and freetype_patch.
eval `sed -n \ eval `sed -nf version.sed include/freetype/freetype.h`
-e 's/^#define *\(FREETYPE_MAJOR\) *\([0-9][0-9]*\).*/\1=\2/p' \
-e 's/^#define *\(FREETYPE_MINOR\) *\([0-9][0-9]*\).*/\1=\2/p' \
-e 's/^#define *\(FREETYPE_PATCH\) *\([0-9][0-9]*\).*/\1=\2/p' \
include/freetype/freetype.h`
if test "$FREETYPE_PATCH" = "0"; then # We set freetype-patch to an empty value if it is zero.
FREETYPE=$FREETYPE_MAJOR.$FREETYPE_MINOR if test "$freetype_patch" = ".0"; then
else freetype_patch=
FREETYPE=$FREETYPE_MAJOR.$FREETYPE_MINOR.$FREETYPE_PATCH
fi fi
echo "FreeType $FREETYPE:"
cd builds/unix cd builds/unix
echo "generating \`configure.ac'" echo "generating \`configure.ac'"
sed -e "s;@VERSION@;$FREETYPE;" \ sed -e "s;@VERSION@;$freetype_major$freetype_minor$freetype_patch;" \
< configure.raw > configure.ac < configure.raw > configure.ac
run aclocal -I . --force run aclocal -I . --force
@ -172,28 +162,28 @@ cd ../..
chmod +x ./configure chmod +x ./configure
# Copy all necessary 'dlg' files.
copy_submodule_files () # Copy all necessary dlg files.
copy_submodule_files()
{ {
echo "Copying files from \`subprojects/dlg' to \`src/dlg' and \`include/dlg'" echo "Copying files from \`submodules/dlg' to \`src/dlg'"
mkdir include/dlg 2> /dev/null mkdir src/dlg/dlg
cp $DLG_INC_DIR/output.h include/dlg cp $DLG_INC_DIR/dlg.h src/dlg/dlg
cp $DLG_INC_DIR/dlg.h include/dlg cp $DLG_INC_DIR/output.h src/dlg/dlg
cp $DLG_SRC_DIR/* src/dlg cp $DLG_SRC_DIR/* src/dlg
} }
if test -e ".git"; then
DLG_INC_DIR=subprojects/dlg/include/dlg
DLG_SRC_DIR=subprojects/dlg/src/dlg
if test -d "$DLG_INC_DIR"; then DLG_INC_DIR=submodules/dlg/include/dlg
: DLG_SRC_DIR=submodules/dlg/src/dlg
else
echo "Checking out submodule in \`subprojects/dlg':"
git submodule init
git submodule update
fi
if ! test -d "$DLG_INC_DIR"; then
echo "Submodule check out in \`submodules/dlg':"
git submodule init
git submodule update
copy_submodule_files
else
copy_submodule_files copy_submodule_files
fi fi

View File

@ -1,7 +1,7 @@
README for the builds/amiga subdirectory. README for the builds/amiga subdirectory.
Copyright (C) 2005-2022 by Copyright (C) 2005-2020 by
Werner Lemberg and Detlef Würkner. Werner Lemberg and Detlef Würkner.
This file is part of the FreeType project, and may only be used, modified, This file is part of the FreeType project, and may only be used, modified,

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Amiga-specific configuration file (specification only). */ /* Amiga-specific configuration file (specification only). */
/* */ /* */
/* Copyright (C) 2005-2022 by */ /* Copyright (C) 2005-2020 by */
/* Werner Lemberg and Detlef Würkner. */ /* Werner Lemberg and Detlef Würkner. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Amiga-specific FreeType module selection. */ /* Amiga-specific FreeType module selection. */
/* */ /* */
/* Copyright (C) 2005-2022 by */ /* Copyright (C) 2005-2020 by */
/* Werner Lemberg and Detlef Würkner. */ /* Werner Lemberg and Detlef Würkner. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */

View File

@ -5,7 +5,7 @@
# #
# Copyright (C) 2005-2022 by # Copyright (C) 2005-2020 by
# Werner Lemberg and Detlef Würkner. # Werner Lemberg and Detlef Würkner.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -4,7 +4,7 @@
# #
# Copyright (C) 2005-2022 by # Copyright (C) 2005-2020 by
# Werner Lemberg and Detlef Würkner. # Werner Lemberg and Detlef Würkner.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 2005-2022 by # Copyright (C) 2005-2020 by
# Werner Lemberg and Detlef Würkner. # Werner Lemberg and Detlef Würkner.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -4,7 +4,7 @@
* *
* Debugging and logging component for amiga (body). * Debugging and logging component for amiga (body).
* *
* Copyright (C) 1996-2022 by * Copyright (C) 1996-2020 by
* David Turner, Robert Wilhelm, Werner Lemberg, and Detlef Wuerkner. * David Turner, Robert Wilhelm, Werner Lemberg, and Detlef Wuerkner.
* *
* This file is part of the FreeType project, and may only be used, * This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
/* */ /* */
/* Amiga-specific FreeType low-level system interface (body). */ /* Amiga-specific FreeType low-level system interface (body). */
/* */ /* */
/* Copyright (C) 1996-2022 by */ /* Copyright (C) 1996-2020 by */
/* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */ /* David Turner, Robert Wilhelm, Werner Lemberg and Detlef Würkner. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -264,7 +264,7 @@ Free_VecPooled( APTR poolHeader,
stream->descriptor.pointer = NULL; stream->descriptor.pointer = NULL;
stream->size = 0; stream->size = 0;
stream->base = NULL; stream->base = 0;
} }

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -13,11 +13,11 @@
# fully. # fully.
DELETE := rm -f DELETE := rm -f
CAT := cat CAT := cat
SEP := / SEP := /
PLATFORM_DIR := $(TOP_DIR)/builds/ansi BUILD_DIR := $(TOP_DIR)/builds/ansi
PLATFORM := ansi PLATFORM := ansi
# This is used for `make refdoc' and `make refdoc-venv' # This is used for `make refdoc' and `make refdoc-venv'
# #
@ -64,14 +64,14 @@ T := -o$(space)
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -c CFLAGS ?= -c
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# #
ANSIFLAGS ?= ANSIFLAGS :=
# EOF # EOF

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -15,7 +15,7 @@ To compile FreeType 2 as a library the following changes must be applied:
INCLUDE;E:\freetype2\include INCLUDE;E:\freetype2\include
- The file `freetype/include/Ft2build.h' must be patched as follows to - The file `freetype2/include/Ft2build.h' must be patched as follows to
include ATARI.H: include ATARI.H:
#ifndef FT2_BUILD_GENERIC_H_ #ifndef FT2_BUILD_GENERIC_H_
@ -40,7 +40,7 @@ ge
INCLUDE;E:\freetype2\include INCLUDE;E:\freetype2\include
- In der Datei freetype/include/Ft2build.h muss zu Beginn - In der Datei freetype2/include/Ft2build.h muss zu Beginn
ein #include "ATARI.H" wie folgt eingef<65>gt werden: ein #include "ATARI.H" wie folgt eingef<65>gt werden:
#ifndef FT2_BUILD_GENERIC_H_ #ifndef FT2_BUILD_GENERIC_H_

View File

@ -5,7 +5,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -15,11 +15,11 @@
# fully. # fully.
DELETE := rm -f DELETE := rm -f
CAT := cat CAT := cat
SEP := / SEP := /
PLATFORM_DIR := $(TOP_DIR)/builds/beos BUILD_DIR := $(TOP_DIR)/builds/beos
PLATFORM := beos PLATFORM := beos
# This is used for `make refdoc' and `make refdoc-venv' # This is used for `make refdoc' and `make refdoc-venv'
# #
@ -66,14 +66,14 @@ T := -o$(space)
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -c CFLAGS ?= -c
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# #
ANSIFLAGS ?= ANSIFLAGS :=
# EOF # EOF

View File

@ -2,7 +2,7 @@
# FreeType 2 configuration rules for a BeOS system # FreeType 2 configuration rules for a BeOS system
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -27,11 +27,11 @@ endif
ifeq ($(PLATFORM),beos) ifeq ($(PLATFORM),beos)
DELETE := rm -f DELETE := rm -f
CAT := cat CAT := cat
SEP := / SEP := /
PLATFORM_DIR := $(TOP_DIR)/builds/beos BUILD_DIR := $(TOP_DIR)/builds/beos
CONFIG_FILE := beos.mk CONFIG_FILE := beos.mk
setup: std_setup setup: std_setup

View File

@ -1,6 +1,6 @@
# FindBrotliDec.cmake # FindBrotliDec.cmake
# #
# Copyright (C) 2019-2022 by # Copyright (C) 2019-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# Written by Werner Lemberg <wl@gnu.org> # Written by Werner Lemberg <wl@gnu.org>
@ -19,8 +19,7 @@
# BROTLIDEC_INCLUDE_DIRS # BROTLIDEC_INCLUDE_DIRS
# BROTLIDEC_LIBRARIES # BROTLIDEC_LIBRARIES
find_package(PkgConfig QUIET) include(FindPkgConfig)
pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec) pkg_check_modules(PC_BROTLIDEC QUIET libbrotlidec)
if (PC_BROTLIDEC_VERSION) if (PC_BROTLIDEC_VERSION)
@ -42,7 +41,7 @@ find_library(BROTLIDEC_LIBRARIES
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args( find_package_handle_standard_args(
BrotliDec brotlidec
REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES REQUIRED_VARS BROTLIDEC_INCLUDE_DIRS BROTLIDEC_LIBRARIES
FOUND_VAR BROTLIDEC_FOUND FOUND_VAR BROTLIDEC_FOUND
VERSION_VAR BROTLIDEC_VERSION) VERSION_VAR BROTLIDEC_VERSION)

View File

@ -1,5 +1,4 @@
# Copyright (c) 2012, Intel Corporation # Copyright (c) 2012, Intel Corporation
# Copyright (c) 2019 Sony Interactive Entertainment Inc.
# #
# Redistribution and use in source and binary forms, with or without # Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met: # modification, are permitted provided that the following conditions are met:
@ -24,180 +23,65 @@
# CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) # CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
# ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
# POSSIBILITY OF SUCH DAMAGE. # POSSIBILITY OF SUCH DAMAGE.
#
# Try to find Harfbuzz include and library directories.
# Try to find HarfBuzz include and library directories.
# #
# After successful discovery, this will set for inclusion where needed: # After successful discovery, this will set for inclusion where needed:
# HarfBuzz_INCLUDE_DIRS - containg the HarfBuzz headers #
# HarfBuzz_LIBRARIES - containg the HarfBuzz library # HARFBUZZ_INCLUDE_DIRS - containg the HarfBuzz headers
# HARFBUZZ_LIBRARIES - containg the HarfBuzz library
#[=======================================================================[.rst: include(FindPkgConfig)
FindHarfBuzz
--------------
Find HarfBuzz headers and libraries.
Imported Targets
^^^^^^^^^^^^^^^^
``HarfBuzz::HarfBuzz``
The HarfBuzz library, if found.
``HarfBuzz::ICU``
The HarfBuzz ICU library, if found.
Result Variables
^^^^^^^^^^^^^^^^
This will define the following variables in your project:
``HarfBuzz_FOUND``
true if (the requested version of) HarfBuzz is available.
``HarfBuzz_VERSION``
the version of HarfBuzz.
``HarfBuzz_LIBRARIES``
the libraries to link against to use HarfBuzz.
``HarfBuzz_INCLUDE_DIRS``
where to find the HarfBuzz headers.
``HarfBuzz_COMPILE_OPTIONS``
this should be passed to target_compile_options(), if the
target is not used for linking
#]=======================================================================]
find_package(PkgConfig QUIET)
pkg_check_modules(PC_HARFBUZZ QUIET harfbuzz) pkg_check_modules(PC_HARFBUZZ QUIET harfbuzz)
set(HarfBuzz_COMPILE_OPTIONS ${PC_HARFBUZZ_CFLAGS_OTHER})
set(HarfBuzz_VERSION ${PC_HARFBUZZ_CFLAGS_VERSION})
find_path(HarfBuzz_INCLUDE_DIR find_path(HARFBUZZ_INCLUDE_DIRS
NAMES hb.h NAMES hb.h
HINTS ${PC_HARFBUZZ_INCLUDEDIR} ${PC_HARFBUZZ_INCLUDE_DIRS} HINTS ${PC_HARFBUZZ_INCLUDEDIR}
PATH_SUFFIXES harfbuzz ${PC_HARFBUZZ_INCLUDE_DIRS}
) PATH_SUFFIXES harfbuzz)
find_library(HarfBuzz_LIBRARY find_library(HARFBUZZ_LIBRARIES
NAMES ${HarfBuzz_NAMES} harfbuzz NAMES harfbuzz
HINTS ${PC_HARFBUZZ_LIBDIR} ${PC_HARFBUZZ_LIBRARY_DIRS} HINTS ${PC_HARFBUZZ_LIBDIR}
) ${PC_HARFBUZZ_LIBRARY_DIRS})
if (HarfBuzz_INCLUDE_DIR AND NOT HarfBuzz_VERSION) if (HARFBUZZ_INCLUDE_DIRS)
if (EXISTS "${HarfBuzz_INCLUDE_DIR}/hb-version.h") if (EXISTS "${HARFBUZZ_INCLUDE_DIRS}/hb-version.h")
file(READ "${HarfBuzz_INCLUDE_DIR}/hb-version.h" _harfbuzz_version_content) file(READ "${HARFBUZZ_INCLUDE_DIRS}/hb-version.h" _harfbuzz_version_content)
string(REGEX MATCH "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\"" _dummy "${_harfbuzz_version_content}") string(REGEX MATCH
set(HarfBuzz_VERSION "${CMAKE_MATCH_1}") "#define +HB_VERSION_STRING +\"([0-9]+\\.[0-9]+\\.[0-9]+)\""
endif () _dummy "${_harfbuzz_version_content}")
endif () set(HARFBUZZ_VERSION "${CMAKE_MATCH_1}")
if ("${HarfBuzz_FIND_VERSION}" VERSION_GREATER "${HarfBuzz_VERSION}")
if (HarfBuzz_FIND_REQUIRED)
message(FATAL_ERROR
"Required version (" ${HarfBuzz_FIND_VERSION} ")"
" is higher than found version (" ${HarfBuzz_VERSION} ")")
else ()
message(WARNING
"Required version (" ${HarfBuzz_FIND_VERSION} ")"
" is higher than found version (" ${HarfBuzz_VERSION} ")")
unset(HarfBuzz_VERSION)
unset(HarfBuzz_INCLUDE_DIRS)
unset(HarfBuzz_LIBRARIES)
return ()
endif () endif ()
endif () endif ()
# Find components if ("${harfbuzz_FIND_VERSION}" VERSION_GREATER "${HARFBUZZ_VERSION}")
if (HarfBuzz_INCLUDE_DIR AND HarfBuzz_LIBRARY) message(FATAL_ERROR
set(_HarfBuzz_REQUIRED_LIBS_FOUND ON) "Required version (" ${harfbuzz_FIND_VERSION} ")"
set(HarfBuzz_LIBS_FOUND "HarfBuzz (required): ${HarfBuzz_LIBRARY}") " is higher than found version (" ${HARFBUZZ_VERSION} ")")
else ()
set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
set(HarfBuzz_LIBS_NOT_FOUND "HarfBuzz (required)")
endif ()
if (NOT CMAKE_VERSION VERSION_LESS 3.3)
if ("ICU" IN_LIST HarfBuzz_FIND_COMPONENTS)
pkg_check_modules(PC_HARFBUZZ_ICU QUIET harfbuzz-icu)
set(HarfBuzz_ICU_COMPILE_OPTIONS ${PC_HARFBUZZ_ICU_CFLAGS_OTHER})
find_path(HarfBuzz_ICU_INCLUDE_DIR
NAMES hb-icu.h
HINTS ${PC_HARFBUZZ_ICU_INCLUDEDIR} ${PC_HARFBUZZ_ICU_INCLUDE_DIRS}
PATH_SUFFIXES harfbuzz
)
find_library(HarfBuzz_ICU_LIBRARY
NAMES ${HarfBuzz_ICU_NAMES} harfbuzz-icu
HINTS ${PC_HARFBUZZ_ICU_LIBDIR} ${PC_HARFBUZZ_ICU_LIBRARY_DIRS}
)
if (HarfBuzz_ICU_LIBRARY)
if (HarfBuzz_FIND_REQUIRED_ICU)
list(APPEND HarfBuzz_LIBS_FOUND "ICU (required): ${HarfBuzz_ICU_LIBRARY}")
else ()
list(APPEND HarfBuzz_LIBS_FOUND "ICU (optional): ${HarfBuzz_ICU_LIBRARY}")
endif ()
else ()
if (HarfBuzz_FIND_REQUIRED_ICU)
set(_HarfBuzz_REQUIRED_LIBS_FOUND OFF)
list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (required)")
else ()
list(APPEND HarfBuzz_LIBS_NOT_FOUND "ICU (optional)")
endif ()
endif ()
endif ()
endif ()
if (NOT HarfBuzz_FIND_QUIETLY)
if (HarfBuzz_LIBS_FOUND)
message(STATUS "Found the following HarfBuzz libraries:")
foreach (found ${HarfBuzz_LIBS_FOUND})
message(STATUS " ${found}")
endforeach ()
endif ()
if (HarfBuzz_LIBS_NOT_FOUND)
message(STATUS "The following HarfBuzz libraries were not found:")
foreach (found ${HarfBuzz_LIBS_NOT_FOUND})
message(STATUS " ${found}")
endforeach ()
endif ()
endif () endif ()
include(FindPackageHandleStandardArgs) include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(HarfBuzz find_package_handle_standard_args(
FOUND_VAR HarfBuzz_FOUND harfbuzz
REQUIRED_VARS HarfBuzz_INCLUDE_DIR HarfBuzz_LIBRARY _HarfBuzz_REQUIRED_LIBS_FOUND REQUIRED_VARS HARFBUZZ_INCLUDE_DIRS HARFBUZZ_LIBRARIES
VERSION_VAR HarfBuzz_VERSION VERSION_VAR HARFBUZZ_VERSION)
)
if (NOT CMAKE_VERSION VERSION_LESS 3.1)
if (HarfBuzz_LIBRARY AND NOT TARGET HarfBuzz::HarfBuzz)
add_library(HarfBuzz::HarfBuzz UNKNOWN IMPORTED GLOBAL)
set_target_properties(HarfBuzz::HarfBuzz PROPERTIES
IMPORTED_LOCATION "${HarfBuzz_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${HarfBuzz_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_INCLUDE_DIR}"
)
endif ()
if (HarfBuzz_ICU_LIBRARY AND NOT TARGET HarfBuzz::ICU)
add_library(HarfBuzz::ICU UNKNOWN IMPORTED GLOBAL)
set_target_properties(HarfBuzz::ICU PROPERTIES
IMPORTED_LOCATION "${HarfBuzz_ICU_LIBRARY}"
INTERFACE_COMPILE_OPTIONS "${HarfBuzz_ICU_COMPILE_OPTIONS}"
INTERFACE_INCLUDE_DIRECTORIES "${HarfBuzz_ICU_INCLUDE_DIR}"
)
endif ()
endif ()
mark_as_advanced( mark_as_advanced(
HarfBuzz_INCLUDE_DIR HARFBUZZ_INCLUDE_DIRS
HarfBuzz_ICU_INCLUDE_DIR HARFBUZZ_LIBRARIES)
HarfBuzz_LIBRARY
HarfBuzz_ICU_LIBRARY
)
if (HarfBuzz_FOUND) # Allow easy linking as in
set(HarfBuzz_LIBRARIES ${HarfBuzz_LIBRARY} ${HarfBuzz_ICU_LIBRARY}) #
set(HarfBuzz_INCLUDE_DIRS ${HarfBuzz_INCLUDE_DIR} ${HarfBuzz_ICU_INCLUDE_DIR}) # target_link_libraries(freetype PRIVATE Harfbuzz::Harfbuzz)
#
if (NOT CMAKE_VERSION VERSION_LESS 3.1)
if (HARFBUZZ_FOUND AND NOT TARGET Harfbuzz::Harfbuzz)
add_library(Harfbuzz::Harfbuzz INTERFACE IMPORTED)
set_target_properties(
Harfbuzz::Harfbuzz PROPERTIES
INTERFACE_INCLUDE_DIRECTORIES "${HARFBUZZ_INCLUDE_DIRS}")
endif ()
endif () endif ()

View File

@ -1,6 +1,6 @@
# iOS.cmake # iOS.cmake
# #
# Copyright (C) 2014-2022 by # Copyright (C) 2014-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# Written by David Wimsey <david@wimsey.us> # Written by David Wimsey <david@wimsey.us>

View File

@ -1,6 +1,6 @@
#!/bin/sh -e #!/bin/sh -e
# Copyright (C) 2015-2022 by # Copyright (C) 2015-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -59,7 +59,7 @@ T := -o$(space)
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -c CFLAGS ?= -c
@ -68,7 +68,7 @@ CFLAGS ?= -c
# #
# we assume the compiler is already strictly ANSI # we assume the compiler is already strictly ANSI
# #
ANSIFLAGS ?= ANSIFLAGS :=
# Library linking # Library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -60,14 +60,14 @@ TE := -e
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus CFLAGS ?= -q -c -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# #
ANSIFLAGS ?= -A ANSIFLAGS := -A
# Library linking # Library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -60,14 +60,14 @@ TE := -e
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus CFLAGS ?= -c -q -y -d -v -Od -w-par -w-ccc -w-rch -w-pro -w-aus
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# #
ANSIFLAGS ?= -A ANSIFLAGS := -A
# Library linking # Library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 2003-2022 by # Copyright (C) 2003-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -58,14 +58,14 @@ T := -o$(space)
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -c -g -O6 -Wall CFLAGS ?= -c -g -O6 -Wall
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# #
ANSIFLAGS ?= ANSIFLAGS :=
# Library linking # Library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -59,7 +59,7 @@ T := -o$(space)
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
ifndef CFLAGS ifndef CFLAGS
@ -82,9 +82,8 @@ ifndef CFLAGS
endif endif
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# You can override this on the command line.
# #
ANSIFLAGS ?= -std=c99 -pedantic ANSIFLAGS := -ansi -pedantic
# Library linking # Library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -58,14 +58,14 @@ T := -o$(space)
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -c -g -O3 -Wall CFLAGS ?= -c -g -O3 -Wall
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# #
ANSIFLAGS ?= -std=c99 -pedantic ANSIFLAGS := -ansi -pedantic
# Library linking # Library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -61,7 +61,7 @@ TE := /Fe
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
# Note that the Intel C/C++ compiler version 4.5 complains about # Note that the Intel C/C++ compiler version 4.5 complains about
@ -74,7 +74,7 @@ CFLAGS ?= /nologo /c /Ox /G5 /W3 /Qwd32
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# #
ANSIFLAGS ?= /Qansi_alias /Za ANSIFLAGS := /Qansi_alias /Za
# Library linking # Library linking
# #

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -60,7 +60,7 @@ T := -o$(space)
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -c -g CFLAGS ?= -c -g
@ -71,7 +71,7 @@ CFLAGS ?= -c -g
# #
# the "-A" flag simply increments verbosity about non ANSI code # the "-A" flag simply increments verbosity about non ANSI code
# #
ANSIFLAGS ?= -A ANSIFLAGS := -A
# library linking # library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -63,14 +63,14 @@ TE := /Fe
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= /nologo /c /Ox /W3 /WX CFLAGS ?= /nologo /c /Ox /W3 /WX
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# #
ANSIFLAGS ?= /Za /D_CRT_SECURE_NO_DEPRECATE ANSIFLAGS := /Za /D_CRT_SECURE_NO_DEPRECATE
# Library linking # Library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -60,14 +60,14 @@ T := -FO=
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -zq CFLAGS ?= -zq
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant. # ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
# #
ANSIFLAGS ?= -za ANSIFLAGS := -za
# Library linking # Library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -60,7 +60,7 @@ T := -Fo
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
CFLAGS ?= -c -g2 -O CFLAGS ?= -c -g2 -O
@ -69,7 +69,7 @@ CFLAGS ?= -c -g2 -O
# #
# LCC is pure ANSI anyway! # LCC is pure ANSI anyway!
# #
ANSIFLAGS ?= ANSIFLAGS :=
# library linking # library linking

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -16,7 +16,7 @@
# This sub-Makefile is in charge of detecting the current platform. It sets # This sub-Makefile is in charge of detecting the current platform. It sets
# the following variables: # the following variables:
# #
# PLATFORM_DIR The configuration and system-specific directory. Usually # BUILD_DIR The configuration and system-specific directory. Usually
# `builds/$(PLATFORM)' but can be different for custom builds # `builds/$(PLATFORM)' but can be different for custom builds
# of the library. # of the library.
# #
@ -49,8 +49,8 @@ SEP := /
BUILD_CONFIG := $(TOP_DIR)/builds BUILD_CONFIG := $(TOP_DIR)/builds
# These two assignments must be delayed. # These two assignments must be delayed.
PLATFORM_DIR = $(BUILD_CONFIG)/$(PLATFORM) BUILD_DIR = $(BUILD_CONFIG)/$(PLATFORM)
CONFIG_RULES = $(PLATFORM_DIR)/$(CONFIG_FILE) CONFIG_RULES = $(BUILD_DIR)/$(CONFIG_FILE)
# We define the BACKSLASH variable to hold a single back-slash character. # We define the BACKSLASH variable to hold a single back-slash character.
# This is needed because a line like # This is needed because a line like
@ -113,7 +113,7 @@ std_setup:
$(info ) $(info )
$(info $(empty) platform $(PLATFORM)) $(info $(empty) platform $(PLATFORM))
$(info $(empty) compiler $(CC)) $(info $(empty) compiler $(CC))
$(info $(empty) configuration directory $(subst /,$(SEP),$(PLATFORM_DIR))) $(info $(empty) configuration directory $(subst /,$(SEP),$(BUILD_DIR)))
$(info $(empty) configuration rules $(subst /,$(SEP),$(CONFIG_RULES))) $(info $(empty) configuration rules $(subst /,$(SEP),$(CONFIG_RULES)))
$(info ) $(info )
$(info If this does not correspond to your system or settings please remove the file) $(info If this does not correspond to your system or settings please remove the file)

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -13,11 +13,11 @@
# fully. # fully.
DELETE := del DELETE := del
CAT := type CAT := type
SEP := $(strip \ ) SEP := $(strip \ )
PLATFORM_DIR := $(TOP_DIR)/builds/dos BUILD_DIR := $(TOP_DIR)/builds/dos
PLATFORM := dos PLATFORM := dos
# This is used for `make refdoc' and `make refdoc-venv' # This is used for `make refdoc' and `make refdoc-venv'
# #

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 2003-2022 by # Copyright (C) 2003-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 2003-2022 by # Copyright (C) 2003-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 2005-2022 by # Copyright (C) 2005-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -20,8 +20,8 @@
# The following variables (set by other Makefile components, in the # The following variables (set by other Makefile components, in the
# environment, or on the command line) are used: # environment, or on the command line) are used:
# #
# PLATFORM_DIR The architecture-dependent directory, # BUILD_DIR The architecture dependent directory,
# e.g., `$(TOP_DIR)/builds/unix'. Added to INCLUDES also. # e.g. `$(TOP_DIR)/builds/unix'. Added to INCLUDES also.
# #
# OBJ_DIR The directory in which object files are created. # OBJ_DIR The directory in which object files are created.
# #
@ -101,6 +101,7 @@ PUBLIC_DIR := $(TOP_DIR)/include/freetype
INTERNAL_DIR := $(PUBLIC_DIR)/internal INTERNAL_DIR := $(PUBLIC_DIR)/internal
SERVICES_DIR := $(INTERNAL_DIR)/services SERVICES_DIR := $(INTERNAL_DIR)/services
CONFIG_DIR := $(PUBLIC_DIR)/config CONFIG_DIR := $(PUBLIC_DIR)/config
DLG_DIR := $(TOP_DIR)/src/dlg
# The documentation directory. # The documentation directory.
# #
@ -121,7 +122,8 @@ PROJECT_LIBRARY := $(LIB_DIR)/$(LIBRARY).$A
# #
INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \ INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
$(DEVEL_DIR) \ $(DEVEL_DIR) \
$(PLATFORM_DIR) \ $(BUILD_DIR) \
$(DLG_DIR) \
$(TOP_DIR)/include) $(TOP_DIR)/include)
INCLUDE_FLAGS := $(INCLUDES:%=$I%) INCLUDE_FLAGS := $(INCLUDES:%=$I%)
@ -150,9 +152,9 @@ endif
# #
# `CPPFLAGS' might be specified by the user in the environment. # `CPPFLAGS' might be specified by the user in the environment.
# #
FT_CFLAGS = $(CPPFLAGS) \ FT_CFLAGS = $(CPPFLAGS) \
$(CFLAGS) \ $(CFLAGS) \
$DFT2_BUILD_LIBRARY $DFT2_BUILD_LIBRARY -std=c99
FT_COMPILE := $(CC) $(ANSIFLAGS) $(INCLUDE_FLAGS) $(FT_CFLAGS) FT_COMPILE := $(CC) $(ANSIFLAGS) $(INCLUDE_FLAGS) $(FT_CFLAGS)
@ -175,16 +177,16 @@ OBJECTS_LIST :=
# changes, the whole library is recompiled. # changes, the whole library is recompiled.
# #
ifneq ($(wildcard $(OBJ_DIR)/ftoption.h),) ifneq ($(wildcard $(OBJ_DIR)/ftoption.h),)
FTOPTION_H := $(OBJ_DIR)/ftoption.h FTOPTION_H := $(OBJ_DIR)/ftoption.h
else ifneq ($(wildcard $(PLATFORM_DIR)/ftoption.h),) else ifneq ($(wildcard $(BUILD_DIR)/ftoption.h),)
FTOPTION_H := $(PLATFORM_DIR)/ftoption.h FTOPTION_H := $(BUILD_DIR)/ftoption.h
endif endif
PUBLIC_H := $(wildcard $(PUBLIC_DIR)/*.h) PUBLIC_H := $(wildcard $(PUBLIC_DIR)/*.h)
INTERNAL_H := $(wildcard $(INTERNAL_DIR)/*.h) \ INTERNAL_H := $(wildcard $(INTERNAL_DIR)/*.h) \
$(wildcard $(SERVICES_DIR)/*.h) $(wildcard $(SERVICES_DIR)/*.h)
CONFIG_H := $(wildcard $(CONFIG_DIR)/*.h) \ CONFIG_H := $(wildcard $(CONFIG_DIR)/*.h) \
$(wildcard $(PLATFORM_DIR)/config/*.h) \ $(wildcard $(BUILD_DIR)/config/*.h) \
$(FTMODULE_H) \ $(FTMODULE_H) \
$(FTOPTION_H) $(FTOPTION_H)
DEVEL_H := $(wildcard $(TOP_DIR)/devel/*.h) DEVEL_H := $(wildcard $(TOP_DIR)/devel/*.h)

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -9,7 +9,7 @@
<string>English</string> <string>English</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
<string>freetype</string> <string>FreeType</string>
<key>CFBundleGetInfoString</key> <key>CFBundleGetInfoString</key>
<string>FreeType ${PROJECT_VERSION}</string> <string>FreeType ${PROJECT_VERSION}</string>

View File

@ -5,7 +5,7 @@
/* Mac FOND support. Written by just@letterror.com. */ /* Mac FOND support. Written by just@letterror.com. */
/* Heavily Fixed by mpsuzuki, George Williams and Sean McBride */ /* Heavily Fixed by mpsuzuki, George Williams and Sean McBride */
/* */ /* */
/* Copyright (C) 1996-2022 by */ /* Copyright (C) 1996-2020 by */
/* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */ /* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -97,7 +97,7 @@
#define FT_DEPRECATED_ATTRIBUTE #define FT_DEPRECATED_ATTRIBUTE
#include <freetype/ftmac.h> #include FT_MAC_H
/* undefine blocking-macros in ftmac.h */ /* undefine blocking-macros in ftmac.h */
#undef FT_GetFile_From_Mac_Name #undef FT_GetFile_From_Mac_Name
@ -447,7 +447,7 @@ typedef short ResourceIndex;
stream->descriptor.pointer = NULL; stream->descriptor.pointer = NULL;
stream->size = 0; stream->size = 0;
stream->base = NULL; stream->base = 0;
} }
@ -939,7 +939,7 @@ typedef short ResourceIndex;
if ( lwfn_file_name[0] ) if ( lwfn_file_name[0] )
{ {
err = lookup_lwfn_by_fond( pathname, lwfn_file_name, err = lookup_lwfn_by_fond( pathname, lwfn_file_name,
buff, sizeof ( buff ) ); buff, sizeof ( buff ) );
if ( !err ) if ( !err )
have_lwfn = 1; have_lwfn = 1;
} }
@ -1011,7 +1011,7 @@ typedef short ResourceIndex;
old_total_size = total_size; old_total_size = total_size;
} }
if ( FT_QALLOC( buffer, (FT_Long)total_size ) ) if ( FT_ALLOC( buffer, (FT_Long)total_size ) )
goto Error; goto Error;
/* Second pass: append all POST data to the buffer, add PFB fields. */ /* Second pass: append all POST data to the buffer, add PFB fields. */
@ -1127,7 +1127,7 @@ typedef short ResourceIndex;
return FT_THROW( Invalid_Handle ); return FT_THROW( Invalid_Handle );
sfnt_size = (FT_ULong)GetHandleSize( sfnt ); sfnt_size = (FT_ULong)GetHandleSize( sfnt );
if ( FT_QALLOC( sfnt_data, (FT_Long)sfnt_size ) ) if ( FT_ALLOC( sfnt_data, (FT_Long)sfnt_size ) )
{ {
ReleaseResource( sfnt ); ReleaseResource( sfnt );
return error; return error;

View File

@ -1,117 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
"""Extract the FreeType version numbers from `<freetype/freetype.h>`.
This script parses the header to extract the version number defined there.
By default, the full dotted version number is printed, but `--major`,
`--minor` or `--patch` can be used to only print one of these values
instead.
"""
from __future__ import print_function
import argparse
import os
import re
import sys
# Expected input:
#
# ...
# #define FREETYPE_MAJOR 2
# #define FREETYPE_MINOR 10
# #define FREETYPE_PATCH 2
# ...
RE_MAJOR = re.compile(r"^ \#define \s+ FREETYPE_MAJOR \s+ (.*) $", re.X)
RE_MINOR = re.compile(r"^ \#define \s+ FREETYPE_MINOR \s+ (.*) $", re.X)
RE_PATCH = re.compile(r"^ \#define \s+ FREETYPE_PATCH \s+ (.*) $", re.X)
def parse_freetype_header(header):
major = None
minor = None
patch = None
for line in header.splitlines():
line = line.rstrip()
m = RE_MAJOR.match(line)
if m:
assert major == None, "FREETYPE_MAJOR appears more than once!"
major = m.group(1)
continue
m = RE_MINOR.match(line)
if m:
assert minor == None, "FREETYPE_MINOR appears more than once!"
minor = m.group(1)
continue
m = RE_PATCH.match(line)
if m:
assert patch == None, "FREETYPE_PATCH appears more than once!"
patch = m.group(1)
continue
assert (
major and minor and patch
), "This header is missing one of FREETYPE_MAJOR, FREETYPE_MINOR or FREETYPE_PATCH!"
return (major, minor, patch)
def main():
parser = argparse.ArgumentParser(description=__doc__)
group = parser.add_mutually_exclusive_group()
group.add_argument(
"--major",
action="store_true",
help="Only print the major version number.",
)
group.add_argument(
"--minor",
action="store_true",
help="Only print the minor version number.",
)
group.add_argument(
"--patch",
action="store_true",
help="Only print the patch version number.",
)
parser.add_argument(
"input",
metavar="FREETYPE_H",
help="The input freetype.h header to parse.",
)
args = parser.parse_args()
with open(args.input) as f:
header = f.read()
version = parse_freetype_header(header)
if args.major:
print(version[0])
elif args.minor:
print(version[1])
elif args.patch:
print(version[2])
else:
print("%s.%s.%s" % version)
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@ -1,115 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
"""Extract the libtool version from `configure.raw`.
This script parses the `configure.raw` file to extract the libtool version
number. By default, the full dotted version number is printed, but
`--major`, `--minor` or `--patch` can be used to only print one of these
values instead.
"""
from __future__ import print_function
import argparse
import os
import re
import sys
# Expected input:
#
# ...
# version_info='23:2:17'
# ...
RE_VERSION_INFO = re.compile(r"^version_info='(\d+):(\d+):(\d+)'")
def parse_configure_raw(header):
major = None
minor = None
patch = None
for line in header.splitlines():
line = line.rstrip()
m = RE_VERSION_INFO.match(line)
if m:
assert major == None, "version_info appears more than once!"
major = m.group(1)
minor = m.group(2)
patch = m.group(3)
continue
assert (
major and minor and patch
), "This input file is missing a version_info definition!"
return (major, minor, patch)
def main():
parser = argparse.ArgumentParser(description=__doc__)
group = parser.add_mutually_exclusive_group()
group.add_argument(
"--major",
action="store_true",
help="Only print the major version number.",
)
group.add_argument(
"--minor",
action="store_true",
help="Only print the minor version number.",
)
group.add_argument(
"--patch",
action="store_true",
help="Only print the patch version number.",
)
group.add_argument(
"--soversion",
action="store_true",
help="Only print the libtool library suffix.",
)
parser.add_argument(
"input",
metavar="CONFIGURE_RAW",
help="The input configure.raw file to parse.",
)
args = parser.parse_args()
with open(args.input) as f:
raw_file = f.read()
version = parse_configure_raw(raw_file)
if args.major:
print(version[0])
elif args.minor:
print(version[1])
elif args.patch:
print(version[2])
elif args.soversion:
# Convert libtool version_info to the library suffix.
# (current,revision, age) -> (current - age, age, revision)
print(
"%d.%s.%s"
% (int(version[0]) - int(version[2]), version[2], version[1])
)
else:
print("%s.%s.%s" % version)
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@ -1,89 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
"""Generate FreeType reference documentation."""
from __future__ import print_function
import argparse
import glob
import os
import subprocess
import sys
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--input-dir",
required=True,
help="Top-level FreeType source directory.",
)
parser.add_argument(
"--version", required=True, help='FreeType version (e.g. "2.x.y").'
)
parser.add_argument(
"--output-dir", required=True, help="Output directory."
)
args = parser.parse_args()
# Get the list of input files of interest.
include_dir = os.path.join(args.input_dir, "include")
include_config_dir = os.path.join(include_dir, "config")
include_cache_dir = os.path.join(include_dir, "cache")
all_headers = (
glob.glob(os.path.join(args.input_dir, "include", "freetype", "*.h"))
+ glob.glob(
os.path.join(
args.input_dir, "include", "freetype", "config", "*.h"
)
)
+ glob.glob(
os.path.join(
args.input_dir, "include", "freetype", "cache", "*.h"
)
)
)
if not os.path.exists(args.output_dir):
os.makedirs(args.output_dir)
else:
assert os.path.isdir(args.output_dir), (
"Not a directory: " + args.output_dir
)
cmds = [
sys.executable,
"-m",
"docwriter",
"--prefix=ft2",
"--title=FreeType-" + args.version,
"--site=reference",
"--output=" + args.output_dir,
] + all_headers
print("Running docwriter...")
subprocess.check_call(cmds)
print("Building static site...")
subprocess.check_call(
[sys.executable, "-m", "mkdocs", "build"], cwd=args.output_dir
)
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@ -1,171 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
"""Parse modules.cfg and dump its output either as ftmodule.h or a list of
base extensions.
"""
from __future__ import print_function
import argparse
import os
import re
import sys
# Expected input:
#
# ...
# FONT_MODULES += <name>
# HINTING_MODULES += <name>
# RASTER_MODULES += <name>
# AUX_MODULES += <name>
# BASE_EXTENSIONS += <name>
# ...
def parse_modules_cfg(input_file):
lists = {
"FONT_MODULES": [],
"HINTING_MODULES": [],
"RASTER_MODULES": [],
"AUX_MODULES": [],
"BASE_EXTENSIONS": [],
}
for line in input_file.splitlines():
line = line.rstrip()
# Ignore empty lines and those that start with a comment.
if not line or line[0] == "#":
continue
items = line.split()
assert len(items) == 3 and items[1] == "+=", (
"Unexpected input line [%s]" % line
)
assert items[0] in lists, (
"Unexpected configuration variable name " + items[0]
)
lists[items[0]].append(items[2])
return lists
def generate_ftmodule(lists):
result = "/* This is a generated file. */\n"
for driver in lists["FONT_MODULES"]:
if driver == "sfnt": # Special case for the sfnt 'driver'.
result += "FT_USE_MODULE( FT_Module_Class, sfnt_module_class )\n"
continue
name = {
"truetype": "tt",
"type1": "t1",
"cid": "t1cid",
"type42": "t42",
"winfonts": "winfnt",
}.get(driver, driver)
result += (
"FT_USE_MODULE( FT_Driver_ClassRec, %s_driver_class )\n" % name
)
for module in lists["HINTING_MODULES"]:
result += (
"FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % module
)
for module in lists["RASTER_MODULES"]:
name = {
"raster": "ft_raster1",
"smooth": "ft_smooth",
"svg": "ft_svg",
}.get(module)
result += (
"FT_USE_MODULE( FT_Renderer_Class, %s_renderer_class )\n" % name
)
for module in lists["AUX_MODULES"]:
if module in ("psaux", "psnames", "otvalid", "gxvalid"):
result += (
"FT_USE_MODULE( FT_Module_Class, %s_module_class )\n" % module
)
result += "/* EOF */\n"
return result
def generate_main_modules(lists):
return "\n".join(
lists["FONT_MODULES"]
+ lists["HINTING_MODULES"]
+ lists["RASTER_MODULES"]
)
def generate_aux_modules(lists):
return "\n".join(lists["AUX_MODULES"])
def generate_base_extensions(lists):
return "\n".join(lists["BASE_EXTENSIONS"])
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"--format",
required=True,
choices=(
"ftmodule.h",
"main-modules",
"aux-modules",
"base-extensions-list",
),
help="Select output format.",
)
parser.add_argument(
"input",
metavar="CONFIGURE_RAW",
help="The input configure.raw file to parse.",
)
parser.add_argument("--output", help="Output file (default is stdout).")
args = parser.parse_args()
with open(args.input) as f:
input_data = f.read()
lists = parse_modules_cfg(input_data)
if args.format == "ftmodule.h":
result = generate_ftmodule(lists)
elif args.format == "main-modules":
result = generate_main_modules(lists)
elif args.format == "aux-modules":
result = generate_aux_modules(lists)
elif args.format == "base-extensions-list":
result = generate_base_extensions(lists)
else:
assert False, "Invalid output format!"
if args.output:
with open(args.output, "w") as f:
f.write(result)
else:
print(result)
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@ -1,115 +0,0 @@
#!/usr/bin/env python3
#
# Copyright (C) 2020-2022 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
"""Toggle settings in `ftoption.h` file based on command-line arguments.
This script takes an `ftoption.h` file as input and rewrites
`#define`/`#undef` lines in it based on `--enable=CONFIG_VARNAME` or
`--disable=CONFIG_VARNAME` arguments passed to it, where `CONFIG_VARNAME` is
configuration variable name, such as `FT_CONFIG_OPTION_USE_LZW`, that may
appear in the file.
Note that if one of `CONFIG_VARNAME` is not found in the input file, this
script exits with an error message listing the missing variable names.
"""
import argparse
import os
import re
import sys
def main():
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument(
"input", metavar="FTOPTION_H", help="Path to input ftoption.h file."
)
parser.add_argument("--output", help="Output to file instead of stdout.")
parser.add_argument(
"--enable",
action="append",
default=[],
help="Enable a given build option (e.g. FT_CONFIG_OPTION_USE_LZW).",
)
parser.add_argument(
"--disable",
action="append",
default=[],
help="Disable a given build option.",
)
args = parser.parse_args()
common_options = set(args.enable) & set(args.disable)
if common_options:
parser.error(
"Options cannot be both enabled and disabled: %s"
% sorted(common_options)
)
return 1
with open(args.input) as f:
input_file = f.read()
options_seen = set()
new_lines = []
for line in input_file.splitlines():
# Expected formats:
# #define <CONFIG_VAR>
# /* #define <CONFIG_VAR> */
# #undef <CONFIG_VAR>
line = line.rstrip()
if line.startswith("/* #define ") and line.endswith(" */"):
option_name = line[11:-3].strip()
option_enabled = False
elif line.startswith("#define "):
option_name = line[8:].strip()
option_enabled = True
elif line.startswith("#undef "):
option_name = line[7:].strip()
option_enabled = False
else:
new_lines.append(line)
continue
options_seen.add(option_name)
if option_enabled and option_name in args.disable:
line = "#undef " + option_name
elif not option_enabled and option_name in args.enable:
line = "#define " + option_name
new_lines.append(line)
result = "\n".join(new_lines) + "\n"
# Sanity check that all command-line options were actually processed.
cmdline_options = set(args.enable) | set(args.disable)
assert cmdline_options.issubset(
options_seen
), "Could not find options in input file: " + ", ".join(
sorted(cmdline_options - options_seen)
)
if args.output:
with open(args.output, "w") as f:
f.write(result)
else:
print(result)
return 0
if __name__ == "__main__":
sys.exit(main())

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -13,11 +13,11 @@
# fully. # fully.
DELETE := del DELETE := del
CAT := type CAT := type
SEP := $(strip \ ) SEP := $(strip \ )
PLATFORM_DIR := $(TOP_DIR)/builds/os2 BUILD_DIR := $(TOP_DIR)/builds/os2
PLATFORM := os2 PLATFORM := os2
# This is used for `make refdoc' and `make refdoc-venv' # This is used for `make refdoc' and `make refdoc-venv'
# #

View File

@ -5,7 +5,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -2,7 +2,7 @@
// FreeType 2 project for the symbian platform // FreeType 2 project for the symbian platform
// //
// Copyright (C) 2008-2022 by // Copyright (C) 2008-2020 by
// David Turner, Robert Wilhelm, and Werner Lemberg. // David Turner, Robert Wilhelm, and Werner Lemberg.
// //
// This file is part of the FreeType project, and may only be used, modified, // This file is part of the FreeType project, and may only be used, modified,

View File

@ -2,7 +2,7 @@
// FreeType 2 makefile for the symbian platform // FreeType 2 makefile for the symbian platform
// //
// Copyright (C) 2008-2022 by // Copyright (C) 2008-2020 by
// David Turner, Robert Wilhelm, and Werner Lemberg. // David Turner, Robert Wilhelm, and Werner Lemberg.
// //
// This file is part of the FreeType project, and may only be used, modified, // This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -103,6 +103,22 @@ ifneq ($(findstring setup,$(MAKECMDGOALS)),)
check_platform := 1 check_platform := 1
endif endif
# For builds directly from the git repository we need to copy files
# from `submodule/dlg' to `src/dlg'
#
ifeq ($(wildcard src/dlg/dlg.*),)
ifeq ($(wildcard submodules/dlg/dlg.*),)
$(info Submodule check out in `submodules/dlg' )
$(shell git submodule init)
$(shell git submodule update)
endif
$(info Copying files from `submodules/dlg' to `src/dlg')
$(shell mkdir src/dlg/dlg)
$(shell cp submodules/dlg/include/dlg/dlg.h src/dlg/dlg)
$(shell cp submodules/dlg/include/dlg/output.h src/dlg/dlg)
$(shell cp submodules/dlg/src/dlg/dlg.c src/dlg/)
endif
# Include the automatic host platform detection rules when we need to # Include the automatic host platform detection rules when we need to
# check the platform. # check the platform.
@ -113,17 +129,6 @@ ifdef check_platform
include $(TOP_DIR)/builds/detect.mk include $(TOP_DIR)/builds/detect.mk
# For builds directly from the git repository we need to copy files
# from `subprojects/dlg' to `src/dlg' and `include/dlg'.
#
ifeq ($(wildcard $(TOP_DIR)/src/dlg/dlg.*),)
ifeq ($(wildcard $(TOP_DIR)/subprojects/dlg/*),)
copy_submodule: check_out_submodule
endif
setup: copy_submodule
endif
# This rule makes sense for Unix only to remove files created by a run of # This rule makes sense for Unix only to remove files created by a run of
# the configure script which hasn't been successful (so that no # the configure script which hasn't been successful (so that no
# `config.mk' has been created). It uses the built-in $(RM) command of # `config.mk' has been created). It uses the built-in $(RM) command of
@ -166,23 +171,6 @@ else
endif # test check_platform endif # test check_platform
.PHONY: check_out_submodule copy_submodule
check_out_submodule:
$(info Checking out submodule in `subprojects/dlg')
git submodule init
git submodule update
copy_submodule:
$(info Copying files from `subprojects/dlg' to `src/dlg' and `include/dlg')
ifeq ($(wildcard include/dlg),)
mkdir $(subst /,$(SEP),include/dlg)
endif
$(COPY) $(subst /,$(SEP),subprojects/dlg/include/dlg/output.h include/dlg)
$(COPY) $(subst /,$(SEP),subprojects/dlg/include/dlg/dlg.h include/dlg)
$(COPY) $(subst /,$(SEP),subprojects/dlg/src/dlg/dlg.c src/dlg)
# We always need the list of modules in ftmodule.h. # We always need the list of modules in ftmodule.h.
# #
all setup: $(FTMODULE_H) all setup: $(FTMODULE_H)
@ -226,7 +214,6 @@ patch := $(firstword $(patch))
# else # else
version := $(major).$(minor).$(patch) version := $(major).$(minor).$(patch)
winversion := $(major)$(minor)$(patch) winversion := $(major)$(minor)$(patch)
version_tag := VER-$(major)-$(minor)-$(patch)
# endif # endif
@ -249,10 +236,7 @@ dist:
currdir=`pwd` ; \ currdir=`pwd` ; \
for f in `find . -wholename '*/.git' -prune \ for f in `find . -wholename '*/.git' -prune \
-o -name .gitattributes \
-o -name .gitignore \ -o -name .gitignore \
-o -name .gitlab-ci.yml \
-o -name .gitmodules \
-o -name .mailmap \ -o -name .mailmap \
-o -type d \ -o -type d \
-o -print` ; do \ -o -print` ; do \
@ -283,10 +267,6 @@ dist:
CONFIG_GUESS = ~/git/config/config.guess CONFIG_GUESS = ~/git/config/config.guess
CONFIG_SUB = ~/git/config/config.sub CONFIG_SUB = ~/git/config/config.sub
# We also use this repository to access the gnulib script that converts git
# commit messages to a ChangeLog file.
CHANGELOG_SCRIPT = ~/git/config/gitlog-to-changelog
# Don't say `make do-dist'. Always use `make dist' instead. # Don't say `make do-dist'. Always use `make dist' instead.
# #
@ -304,19 +284,8 @@ do-dist: distclean refdoc
cp $(CONFIG_GUESS) builds/unix cp $(CONFIG_GUESS) builds/unix
cp $(CONFIG_SUB) builds/unix cp $(CONFIG_SUB) builds/unix
@# Generate `ChangeLog' file with commits since release 2.11.0
@# (when we stopped creating this file manually).
$(CHANGELOG_SCRIPT) \
--format='%B%n' \
--no-cluster \
-- VER-2-11-0..$(version_tag) \
> ChangeLog
@# Remove intermediate files created by the `refdoc' target. @# Remove intermediate files created by the `refdoc' target.
rm -rf docs/markdown rm -rf docs/markdown
rm -f docs/mkdocs.yml rm -f docs/mkdocs.yml
@# Remove more stuff related to git.
rm -rf subprojects/dlg
# EOF # EOF

View File

@ -14,24 +14,20 @@
# flags that are needed. (The user can also force certain compiler # flags that are needed. (The user can also force certain compiler
# flags/libs to be tested by setting these environment variables.) # flags/libs to be tested by setting these environment variables.)
# #
# Also sets PTHREAD_CC and PTHREAD_CXX to any special C compiler that is # Also sets PTHREAD_CC to any special C compiler that is needed for
# needed for multi-threaded programs (defaults to the value of CC # multi-threaded programs (defaults to the value of CC otherwise). (This
# respectively CXX otherwise). (This is necessary on e.g. AIX to use the # is necessary on AIX to use the special cc_r compiler alias.)
# special cc_r/CC_r compiler alias.)
# #
# NOTE: You are assumed to not only compile your program with these flags, # NOTE: You are assumed to not only compile your program with these flags,
# but also to link with them as well. For example, you might link with # but also to link with them as well. For example, you might link with
# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS # $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
# $PTHREAD_CXX $CXXFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS
# #
# If you are only building threaded programs, you may wish to use these # If you are only building threaded programs, you may wish to use these
# variables in your default LIBS, CFLAGS, and CC: # variables in your default LIBS, CFLAGS, and CC:
# #
# LIBS="$PTHREAD_LIBS $LIBS" # LIBS="$PTHREAD_LIBS $LIBS"
# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
# CXXFLAGS="$CXXFLAGS $PTHREAD_CFLAGS"
# CC="$PTHREAD_CC" # CC="$PTHREAD_CC"
# CXX="$PTHREAD_CXX"
# #
# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant # In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant
# has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to # has a nonstandard name, this macro defines PTHREAD_CREATE_JOINABLE to
@ -87,11 +83,11 @@
# modified version of the Autoconf Macro, you may extend this special # modified version of the Autoconf Macro, you may extend this special
# exception to the GPL to apply to your modified version as well. # exception to the GPL to apply to your modified version as well.
#serial 30 #serial 27
AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD]) AU_ALIAS([ACX_PTHREAD], [AX_PTHREAD])
AC_DEFUN([AX_PTHREAD], [ AC_DEFUN([AX_PTHREAD], [
AC_REQUIRE([AC_CANONICAL_TARGET]) AC_REQUIRE([AC_CANONICAL_HOST])
AC_REQUIRE([AC_PROG_CC]) AC_REQUIRE([AC_PROG_CC])
AC_REQUIRE([AC_PROG_SED]) AC_REQUIRE([AC_PROG_SED])
AC_LANG_PUSH([C]) AC_LANG_PUSH([C])
@ -109,7 +105,6 @@ if test "x$PTHREAD_CFLAGS$PTHREAD_LIBS" != "x"; then
ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_CFLAGS="$CFLAGS"
ax_pthread_save_LIBS="$LIBS" ax_pthread_save_LIBS="$LIBS"
AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"]) AS_IF([test "x$PTHREAD_CC" != "x"], [CC="$PTHREAD_CC"])
AS_IF([test "x$PTHREAD_CXX" != "x"], [CXX="$PTHREAD_CXX"])
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LIBS="$PTHREAD_LIBS $LIBS" LIBS="$PTHREAD_LIBS $LIBS"
AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS]) AC_MSG_CHECKING([for pthread_join using $CC $PTHREAD_CFLAGS $PTHREAD_LIBS])
@ -158,7 +153,7 @@ ax_pthread_flags="pthreads none -Kthread -pthread -pthreads -mthreads pthread --
# --thread-safe: KAI C++ # --thread-safe: KAI C++
# pthread-config: use pthread-config program (for GNU Pth library) # pthread-config: use pthread-config program (for GNU Pth library)
case $target_os in case $host_os in
freebsd*) freebsd*)
@ -248,7 +243,7 @@ AS_IF([test "x$ax_pthread_clang" = "xyes"],
# definitions is, on some systems, a strong hint that pthreads support is # definitions is, on some systems, a strong hint that pthreads support is
# correctly enabled # correctly enabled
case $target_os in case $host_os in
darwin* | hpux* | linux* | osf* | solaris*) darwin* | hpux* | linux* | osf* | solaris*)
ax_pthread_check_macro="_REENTRANT" ax_pthread_check_macro="_REENTRANT"
;; ;;
@ -391,7 +386,7 @@ if test "x$ax_pthread_clang" = "xyes"; then
# step # step
ax_pthread_save_ac_link="$ac_link" ax_pthread_save_ac_link="$ac_link"
ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g' ax_pthread_sed='s/conftest\.\$ac_ext/conftest.$ac_objext/g'
ax_pthread_link_step=`AS_ECHO(["$ac_link"]) | sed "$ax_pthread_sed"` ax_pthread_link_step=`$as_echo "$ac_link" | sed "$ax_pthread_sed"`
ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)" ax_pthread_2step_ac_link="($ac_compile) && (echo ==== >&5) && ($ax_pthread_link_step)"
ax_pthread_save_CFLAGS="$CFLAGS" ax_pthread_save_CFLAGS="$CFLAGS"
for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do for ax_pthread_try in '' -Qunused-arguments -Wno-unused-command-line-argument unknown; do
@ -450,7 +445,7 @@ if test "x$ax_pthread_ok" = "xyes"; then
AC_CACHE_CHECK([whether more special flags are required for pthreads], AC_CACHE_CHECK([whether more special flags are required for pthreads],
[ax_cv_PTHREAD_SPECIAL_FLAGS], [ax_cv_PTHREAD_SPECIAL_FLAGS],
[ax_cv_PTHREAD_SPECIAL_FLAGS=no [ax_cv_PTHREAD_SPECIAL_FLAGS=no
case $target_os in case $host_os in
solaris*) solaris*)
ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS" ax_cv_PTHREAD_SPECIAL_FLAGS="-D_POSIX_PTHREAD_SEMANTICS"
;; ;;
@ -480,35 +475,25 @@ if test "x$ax_pthread_ok" = "xyes"; then
# More AIX lossage: compile with *_r variant # More AIX lossage: compile with *_r variant
if test "x$GCC" != "xyes"; then if test "x$GCC" != "xyes"; then
case $target_os in case $host_os in
aix*) aix*)
AS_CASE(["x/$CC"], AS_CASE(["x/$CC"],
[x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6], [x*/c89|x*/c89_128|x*/c99|x*/c99_128|x*/cc|x*/cc128|x*/xlc|x*/xlc_v6|x*/xlc128|x*/xlc128_v6],
[#handle absolute path differently from PATH based program lookup [#handle absolute path differently from PATH based program lookup
AS_CASE(["x$CC"], AS_CASE(["x$CC"],
[x/*], [x/*],
[ [AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"])],
AS_IF([AS_EXECUTABLE_P([${CC}_r])],[PTHREAD_CC="${CC}_r"]) [AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])])])
AS_IF([test "x${CXX}" != "x"], [AS_IF([AS_EXECUTABLE_P([${CXX}_r])],[PTHREAD_CXX="${CXX}_r"])])
],
[
AC_CHECK_PROGS([PTHREAD_CC],[${CC}_r],[$CC])
AS_IF([test "x${CXX}" != "x"], [AC_CHECK_PROGS([PTHREAD_CXX],[${CXX}_r],[$CXX])])
]
)
])
;; ;;
esac esac
fi fi
fi fi
test -n "$PTHREAD_CC" || PTHREAD_CC="$CC" test -n "$PTHREAD_CC" || PTHREAD_CC="$CC"
test -n "$PTHREAD_CXX" || PTHREAD_CXX="$CXX"
AC_SUBST([PTHREAD_LIBS]) AC_SUBST([PTHREAD_LIBS])
AC_SUBST([PTHREAD_CFLAGS]) AC_SUBST([PTHREAD_CFLAGS])
AC_SUBST([PTHREAD_CC]) AC_SUBST([PTHREAD_CC])
AC_SUBST([PTHREAD_CXX])
# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND:
if test "x$ax_pthread_ok" = "xyes"; then if test "x$ax_pthread_ok" = "xyes"; then

View File

@ -2,7 +2,7 @@
# #
# Process this file with autoconf to produce a configure script. # Process this file with autoconf to produce a configure script.
# #
# Copyright (C) 2001-2022 by # Copyright (C) 2001-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -17,7 +17,7 @@ AC_CONFIG_SRCDIR([ftconfig.h.in])
# Don't forget to update `docs/VERSIONS.TXT'! # Don't forget to update `docs/VERSIONS.TXT'!
version_info='24:3:18' version_info='23:2:17'
AC_SUBST([version_info]) AC_SUBST([version_info])
ft_version=`echo $version_info | tr : .` ft_version=`echo $version_info | tr : .`
AC_SUBST([ft_version]) AC_SUBST([ft_version])
@ -97,12 +97,85 @@ esac
# checks for header files # checks for header files
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h unistd.h]) AC_CHECK_HEADERS([fcntl.h unistd.h])
# checks for typedefs, structures, and compiler characteristics # checks for typedefs, structures, and compiler characteristics
AC_C_CONST AC_C_CONST
AC_CHECK_SIZEOF([int])
AC_CHECK_SIZEOF([long])
AC_TYPE_LONG_LONG_INT
# check whether cpp computation of size of int and long in ftconfig.h.in works
AC_MSG_CHECKING([whether cpp computation of bit length in ftconfig.h.in works])
orig_CPPFLAGS="${CPPFLAGS}"
CPPFLAGS="-I${srcdir} -I. -I${srcdir}/../../include ${CPPFLAGS}"
ac_clean_files=
if test ! -f ft2build.h; then
ac_clean_files=ft2build.h
touch ft2build.h
fi
cat > conftest.c <<\_ACEOF
#include <limits.h>
#define FT_CONFIG_OPTIONS_H <freetype/config/ftoption.h>
#define FT_CONFIG_STANDARD_LIBRARY_H <freetype/config/ftstdlib.h>
#define FT_UINT_MAX UINT_MAX
#define FT_ULONG_MAX ULONG_MAX
#include "ftconfig.h.in"
_ACEOF
echo >> conftest.c "#if FT_SIZEOF_INT == "${ac_cv_sizeof_int}
echo >> conftest.c "ac_cpp_ft_sizeof_int="${ac_cv_sizeof_int}
echo >> conftest.c "#endif"
echo >> conftest.c "#if FT_SIZEOF_LONG == "${ac_cv_sizeof_long}
echo >> conftest.c "ac_cpp_ft_sizeof_long="${ac_cv_sizeof_long}
echo >> conftest.c "#endif"
${CPP} ${CPPFLAGS} conftest.c | ${GREP} ac_cpp_ft > conftest.sh
eval `cat conftest.sh`
rm -f conftest.* $ac_clean_files
if test x != "x${ac_cpp_ft_sizeof_int}" \
-a x != x"${ac_cpp_ft_sizeof_long}"; then
unset ft_use_autoconf_sizeof_types
else
ft_use_autoconf_sizeof_types=yes
fi
AC_ARG_ENABLE(biarch-config,
[ --enable-biarch-config install biarch ftconfig.h to support multiple
architectures by single file], [], [])
case :${ft_use_autoconf_sizeof_types}:${enable_biarch_config}: in
:yes:yes:)
AC_MSG_RESULT([broken but use it])
unset ft_use_autoconf_sizeof_types
;;
::no:)
AC_MSG_RESULT([works but ignore it])
ft_use_autoconf_sizeof_types=yes
;;
::yes: | :::)
AC_MSG_RESULT([yes])
unset ft_use_autoconf_sizeof_types
;;
*)
AC_MSG_RESULT([no])
ft_use_autoconf_sizeof_types=yes
;;
esac
if test x"${ft_use_autoconf_sizeof_types}" = xyes; then
AC_DEFINE([FT_USE_AUTOCONF_SIZEOF_TYPES], [],
[Define if autoconf sizeof types should be used.])
fi
CPPFLAGS="${orig_CPPFLAGS}"
AC_ARG_ENABLE([freetype-config], AC_ARG_ENABLE([freetype-config],
AS_HELP_STRING([--enable-freetype-config], [install freetype-config]), AS_HELP_STRING([--enable-freetype-config], [install freetype-config]),
@ -119,59 +192,53 @@ AC_SUBST(INSTALL_FT2_CONFIG, [$enable_freetype_config])
AC_SYS_LARGEFILE AC_SYS_LARGEFILE
# Here we check whether we can use our mmap file component. # Here we check whether we can use our mmap file component.
#
# Note that `ftsystem.c` for Windows has its own mmap-like implementation
# not covered by `AC_FUNC_MMAP` and/or `FT_UNMAP_PARAM`.
AC_ARG_ENABLE([mmap], AC_ARG_ENABLE([mmap],
AS_HELP_STRING([--disable-mmap], AS_HELP_STRING([--disable-mmap],
[do not check mmap() and do not use]), [do not check mmap() and do not use]),
[enable_mmap="no"], [enable_mmap="yes"]) [enable_mmap="no"], [enable_mmap="yes"])
if test "x${enable_mmap}" != "xno"; then if test "x${enable_mmap}" != "xno"; then
case "$host" in AC_FUNC_MMAP
*-*-mingw*) fi
AC_MSG_CHECKING([for working mmap]) if test "x${enable_mmap}" = "xno" \
AC_MSG_RESULT([using MapViewOfFile in Windows]) -o "$ac_cv_func_mmap_fixed_mapped" != "yes"; then
FTSYS_SRC='$(TOP_DIR)/builds/windows/ftsystem.c' FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
;; else
*) FTSYS_SRC='$(BUILD_DIR)/ftsystem.c'
AC_FUNC_MMAP
if test "$ac_cv_func_mmap_fixed_mapped" = "yes"; then
FTSYS_SRC='$(PLATFORM_DIR)/ftsystem.c'
AC_CHECK_DECLS([munmap], AC_CHECK_DECLS([munmap],
[], [],
[], [],
[ [
#ifdef HAVE_UNISTD_H #ifdef HAVE_UNISTD_H
#include <unistd.h> #include <unistd.h>
#endif #endif
#include <sys/mman.h> #include <sys/mman.h>
]) ])
FT_MUNMAP_PARAM FT_MUNMAP_PARAM
fi
;;
esac
fi
if test -z "$FTSYS_SRC"; then
FTSYS_SRC='$(BASE_DIR)/ftsystem.c'
fi fi
AC_SUBST([FTSYS_SRC]) AC_SUBST([FTSYS_SRC])
AC_CHECK_FUNCS([memcpy memmove]) AC_CHECK_FUNCS([memcpy memmove])
# get compiler flags right # get compiler flags right
# #
# We try to make the compiler work for C99-strict source. Even if the # We try to make the compiler work for C89-strict source. Even if the
# C compiler is gcc and C99 flags are available, some system headers # C compiler is gcc and C89 flags are available, some system headers
# might be broken in C99 mode. We have to check whether compilation # (e.g., Android Bionic libc) are broken in C89 mode. We have to check
# finishes successfully. # whether the compilation finishes successfully.
#
# Due to bugs in mingwrt 4.0.3 we don't use `-ansi' for MinGW.
#
# To avoid zillions of
#
# ISO C90 does not support 'long long'
#
# warnings, we disable `-pedantic' for gcc version < 4.6.
# #
if test "x$GCC" = xyes; then if test "x$GCC" = xyes; then
XX_CFLAGS="-Wall" XX_CFLAGS="-Wall"
@ -183,11 +250,23 @@ if test "x$GCC" = xyes; then
XX_ANSIFLAGS="-pedantic" XX_ANSIFLAGS="-pedantic"
;; ;;
*) *)
XX_ANSIFLAGS="" GCC_VERSION=`$CC -dumpversion`
GCC_MAJOR=`echo "$GCC_VERSION" | sed 's/\([[^.]][[^.]]*\).*/\1/'`
GCC_MINOR=`echo "$GCC_VERSION" | sed 's/[[^.]][[^.]]*.\([[^.]][[^.]]*\).*/\1/'`
for a in "-pedantic" "-std=c99" XX_PEDANTIC=-pedantic
if test $GCC_MAJOR -lt 4; then
XX_PEDANTIC=
else
if test $GCC_MAJOR -eq 4 -a $GCC_MINOR -lt 6; then
XX_PEDANTIC=
fi
fi
XX_ANSIFLAGS=""
for a in $XX_PEDANTIC -ansi
do do
AC_MSG_CHECKING([$CC compiler flag ${a} to assure ANSI C99 works correctly]) AC_MSG_CHECKING([gcc compiler flag ${a} to assure ANSI C works correctly])
orig_CFLAGS="${CFLAGS}" orig_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}" CFLAGS="${CFLAGS} ${XX_ANSIFLAGS} ${a}"
AC_COMPILE_IFELSE([ AC_COMPILE_IFELSE([
@ -317,12 +396,6 @@ if test x"$with_zlib" = xyes -a "$have_zlib" = no; then
AC_MSG_ERROR([external zlib support requested but library not found]) AC_MSG_ERROR([external zlib support requested but library not found])
fi fi
SYSTEM_ZLIB=
if test "$have_zlib" != no; then
SYSTEM_ZLIB=yes
fi
AC_SUBST([SYSTEM_ZLIB])
# check for system libbz2 # check for system libbz2
@ -435,7 +508,7 @@ AC_ARG_WITH([harfbuzz],
have_harfbuzz=no have_harfbuzz=no
if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then if test x"$with_harfbuzz" = xyes -o x"$with_harfbuzz" = xauto; then
harfbuzz_pkg="harfbuzz >= 2.0.0" harfbuzz_pkg="harfbuzz >= 1.8.0"
have_harfbuzz_pkg=no have_harfbuzz_pkg=no
if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then if test x"$HARFBUZZ_CFLAGS" = x -a x"$HARFBUZZ_LIBS" = x; then
@ -514,48 +587,19 @@ if test x"$with_brotli" = xyes -a "$have_brotli" = no; then
fi fi
# Checks for the demo programs. # check for librt
# #
# FreeType doesn't need this. However, since the demo program repository # We need `clock_gettime' for the `ftbench' demo program.
# doesn't come with a `configure` script of its own, we integrate the tests
# here for simplicity.
# We need `clock_gettime` from 'librt' for the `ftbench` demo program.
# #
# The code is modeled after gnulib's file `clock_time.m4`, ignoring # The code is modeled after gnulib's file `clock_time.m4', ignoring
# very old Solaris systems. # very old Solaris systems.
LIB_CLOCK_GETTIME= LIB_CLOCK_GETTIME=
AC_SEARCH_LIBS([clock_gettime], AC_SEARCH_LIBS([clock_gettime],
[rt], [rt],
[test "$ac_cv_search_clock_gettime" = "none required" \ [test "$ac_cv_search_clock_gettime" = "none required" \
|| LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime]) || LIB_CLOCK_GETTIME=$ac_cv_search_clock_gettime])
AC_SUBST([LIB_CLOCK_GETTIME])
FT_DEMO_CFLAGS=""
FT_DEMO_LDFLAGS="$LIB_CLOCK_GETTIME"
# 'librsvg' is needed to demonstrate SVG support.
AC_ARG_WITH([librsvg],
[AS_HELP_STRING([--with-librsvg=@<:@yes|no|auto@:>@],
[support OpenType SVG fonts in FreeType demo programs @<:@default=auto@:>@])],
[], [with_librsvg=auto])
have_librsvg=no
if test x"$with_librsvg" = xyes -o x"$with_librsvg" = xauto; then
PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0 >= 2.46.0],
[have_librsvg="yes (pkg-config)"], [:])
if test "$have_librsvg" != no; then
FT_DEMO_CFLAGS="$FT_DEMO_CFLAGS $LIBRSVG_CFLAGS -DHAVE_LIBRSVG"
FT_DEMO_LDFLAGS="$FT_DEMO_LDFLAGS $LIBRSVG_LIBS"
fi
fi
if test x"$with_librsvg" = xyes -a "$have_librsvg" = no; then
AC_MSG_ERROR([librsvg support requested but library not found])
fi
AC_SUBST([FT_DEMO_CFLAGS])
AC_SUBST([FT_DEMO_LDFLAGS])
# Some options handling SDKs/archs in CFLAGS should be copied # Some options handling SDKs/archs in CFLAGS should be copied
@ -984,7 +1028,7 @@ if test "x$PYTHON" != "xmissing"; then
if test "x$have_py3" = "xyes"; then if test "x$have_py3" = "xyes"; then
PIP="$PYTHON -m $PIP" PIP="$PYTHON -m $PIP"
AC_MSG_CHECKING([for `docwriter' Python module]) AC_MSG_CHECKING([for \`docwriter' Python module])
$PYTHON -m docwriter -h > /dev/null 2>&1 $PYTHON -m docwriter -h > /dev/null 2>&1
if test "x$?" = "x0"; then if test "x$?" = "x0"; then
have_docwriter=yes have_docwriter=yes
@ -997,32 +1041,32 @@ fi
# entries in Requires.private are separated by commas # entries in Requires.private are separated by commas
PKGCONFIG_REQUIRES_PRIVATE="$zlib_reqpriv, \ REQUIRES_PRIVATE="$zlib_reqpriv, \
$bzip2_reqpriv, \ $bzip2_reqpriv, \
$libpng_reqpriv, \ $libpng_reqpriv, \
$harfbuzz_reqpriv, \ $harfbuzz_reqpriv, \
$brotli_reqpriv" $brotli_reqpriv"
# beautify # beautify
PKGCONFIG_REQUIRES_PRIVATE=`echo "$PKGCONFIG_REQUIRES_PRIVATE" \ REQUIRES_PRIVATE=`echo "$REQUIRES_PRIVATE" \
| sed -e 's/^ *//' \ | sed -e 's/^ *//' \
-e 's/ *$//' \ -e 's/ *$//' \
-e 's/, */,/g' \ -e 's/, */,/g' \
-e 's/,,*/,/g' \ -e 's/,,*/,/g' \
-e 's/^,*//' \ -e 's/^,*//' \
-e 's/,*$//' \ -e 's/,*$//' \
-e 's/,/, /g'` -e 's/,/, /g'`
PKGCONFIG_LIBS_PRIVATE="$zlib_libspriv \ LIBS_PRIVATE="$zlib_libspriv \
$bzip2_libspriv \ $bzip2_libspriv \
$libpng_libspriv \ $libpng_libspriv \
$harfbuzz_libspriv \ $harfbuzz_libspriv \
$brotli_libspriv \ $brotli_libspriv \
$ft2_extra_libs" $ft2_extra_libs"
# beautify # beautify
PKGCONFIG_LIBS_PRIVATE=`echo "$PKGCONFIG_LIBS_PRIVATE" \ LIBS_PRIVATE=`echo "$LIBS_PRIVATE" \
| sed -e 's/^ *//' \ | sed -e 's/^ *//' \
-e 's/ *$//' \ -e 's/ *$//' \
-e 's/ */ /g'` -e 's/ */ /g'`
LIBSSTATIC_CONFIG="-lfreetype \ LIBSSTATIC_CONFIG="-lfreetype \
$zlib_libsstaticconf \ $zlib_libsstaticconf \
@ -1040,28 +1084,10 @@ LIBSSTATIC_CONFIG=`echo "$LIBSSTATIC_CONFIG" \
-e 's/ *$//' \ -e 's/ *$//' \
-e 's/ */ /g'` -e 's/ */ /g'`
# If FreeType gets installed with `--disable-shared', don't use
# 'private' fields. `pkg-config' only looks into `.pc' files and is
# completely agnostic to whether shared libraries are actually present
# or not. As a consequence, the user had to specify `--static' while
# calling `pkg-config', which configure scripts are normally not
# prepared for.
PKGCONFIG_REQUIRES=
PKGCONFIG_LIBS='-L${libdir} -lfreetype'
if test $enable_shared = "no"; then
PKGCONFIG_REQUIRES="$PKGCONFIG_REQUIRES $PKGCONFIG_REQUIRES_PRIVATE"
PKGCONFIG_REQUIRES_PRIVATE=
PKGCONFIG_LIBS="$PKGCONFIG_LIBS $PKGCONFIG_LIBS_PRIVATE"
PKGCONFIG_LIBS_PRIVATE=
fi
AC_SUBST([ftmac_c]) AC_SUBST([ftmac_c])
AC_SUBST([PKGCONFIG_REQUIRES]) AC_SUBST([REQUIRES_PRIVATE])
AC_SUBST([PKGCONFIG_LIBS]) AC_SUBST([LIBS_PRIVATE])
AC_SUBST([PKGCONFIG_REQUIRES_PRIVATE])
AC_SUBST([PKGCONFIG_LIBS_PRIVATE])
AC_SUBST([LIBSSTATIC_CONFIG]) AC_SUBST([LIBSSTATIC_CONFIG])
AC_SUBST([hardcode_libdir_flag_spec]) AC_SUBST([hardcode_libdir_flag_spec])
@ -1119,10 +1145,12 @@ if test "$have_brotli" != no; then
else else
ftoption_unset FT_CONFIG_OPTION_USE_BROTLI ftoption_unset FT_CONFIG_OPTION_USE_BROTLI
fi fi
if test "$have_pthread" != no; then if test "$have_pthread" != no; then
CFLAGS="$CFLAGS $PTHREAD_CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS"
LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS $PTHREAD_LIBS" LDFLAGS="$LDFLAGS $PTHREAD_CFLAGS $PTHREAD_LIBS"
ftoption_set FT_LOGGING
else
ftoption_unset FT_LOGGING
fi fi
AC_SUBST([CFLAGS]) AC_SUBST([CFLAGS])
@ -1166,10 +1194,10 @@ Library configuration:
if test $have_docwriter = no; then if test $have_docwriter = no; then
AC_MSG_WARN([ AC_MSG_WARN([
`make refdoc' will fail since pip package `docwriter' is not installed. \`make refdoc' will fail since pip package \`docwriter' is not installed.
To install, run `$PIP install docwriter', or to use a Python To install, run \`$PIP install docwriter', or to use a Python
virtual environment, run `make refdoc-venv' (requires pip package virtual environment, run \`make refdoc-venv' (requires pip package
`virtualenv'). These operations require Python >= 3.5. \`virtualenv'). These operations require Python >= 3.5.
]) ])
fi fi
@ -1177,9 +1205,7 @@ fi
if test $have_pthread = no; then if test $have_pthread = no; then
AC_MSG_WARN([ AC_MSG_WARN([
`FT_DEBUG_LOGGING' will not work since the `pthread' library is not `FT_LOGGING' will not work since pthread library is not available.
available. This warning can be safely ignored if you don't plan to use
this configuration macro.
]) ])
fi fi

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -1,6 +1,6 @@
#! /bin/sh #! /bin/sh
# #
# Copyright (C) 2000-2022 by # Copyright (C) 2000-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -7,8 +7,8 @@ Name: FreeType 2
URL: https://freetype.org URL: https://freetype.org
Description: A free, high-quality, and portable font engine. Description: A free, high-quality, and portable font engine.
Version: %ft_version% Version: %ft_version%
Requires: %PKGCONFIG_REQUIRES% Requires:
Requires.private: %PKGCONFIG_REQUIRES_PRIVATE% Requires.private: %REQUIRES_PRIVATE%
Libs: %PKGCONFIG_LIBS% Libs: -L${libdir} -lfreetype
Libs.private: %PKGCONFIG_LIBS_PRIVATE% Libs.private: %LIBS_PRIVATE%
Cflags: -I${includedir}/freetype2 Cflags: -I${includedir}/freetype2

View File

@ -1,7 +1,7 @@
# Configure paths for FreeType2 # Configure paths for FreeType2
# Marcelo Magallon 2001-10-26, based on `gtk.m4` by Owen Taylor # Marcelo Magallon 2001-10-26, based on gtk.m4 by Owen Taylor
# #
# Copyright (C) 2001-2022 by # Copyright (C) 2001-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -15,32 +15,32 @@
# generated by Autoconf, under the same distribution terms as the rest of # generated by Autoconf, under the same distribution terms as the rest of
# that program. # that program.
# #
# serial 6 # serial 5
# AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) # AC_CHECK_FT2([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
# Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS. # Test for FreeType 2, and define FT2_CFLAGS and FT2_LIBS.
# MINIMUM-VERSION is what libtool reports; the default is '7.0.1' (this is # MINIMUM-VERSION is what libtool reports; the default is `7.0.1' (this is
# FreeType 2.0.4). # FreeType 2.0.4).
# #
# To make this code work with older autoconf versions, `AS_HELP_STRING` is
# not quoted.
#
AC_DEFUN([AC_CHECK_FT2], AC_DEFUN([AC_CHECK_FT2],
[# Get the cflags and libraries from the freetype-config script [# Get the cflags and libraries from the freetype-config script
# #
AC_ARG_WITH([ft-prefix], AC_ARG_WITH([ft-prefix],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--with-ft-prefix=PREFIX], AS_HELP_STRING([--with-ft-prefix=PREFIX],
[Prefix where FreeType is installed (optional)]), [Prefix where FreeType is installed (optional)]),
[ft_config_prefix="$withval"], [ft_config_prefix="$withval"],
[ft_config_prefix=""]) [ft_config_prefix=""])
AC_ARG_WITH([ft-exec-prefix], AC_ARG_WITH([ft-exec-prefix],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--with-ft-exec-prefix=PREFIX], AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
[Exec prefix where FreeType is installed (optional)]), [Exec prefix where FreeType is installed (optional)]),
[ft_config_exec_prefix="$withval"], [ft_config_exec_prefix="$withval"],
[ft_config_exec_prefix=""]) [ft_config_exec_prefix=""])
AC_ARG_ENABLE([freetypetest], AC_ARG_ENABLE([freetypetest],
dnl don't quote AS_HELP_STRING!
AS_HELP_STRING([--disable-freetypetest], AS_HELP_STRING([--disable-freetypetest],
[Do not try to compile and run a test FreeType program]), [Do not try to compile and run a test FreeType program]),
[], [],

View File

@ -1,6 +1,6 @@
## FreeType specific autoconf tests ## FreeType specific autoconf tests
# #
# Copyright (C) 2002-2022 by # Copyright (C) 2002-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -4,7 +4,7 @@
* *
* UNIX-specific configuration file (specification only). * UNIX-specific configuration file (specification only).
* *
* Copyright (C) 1996-2022 by * Copyright (C) 1996-2020 by
* David Turner, Robert Wilhelm, and Werner Lemberg. * David Turner, Robert Wilhelm, and Werner Lemberg.
* *
* This file is part of the FreeType project, and may only be used, * This file is part of the FreeType project, and may only be used,
@ -42,6 +42,16 @@
#undef HAVE_UNISTD_H #undef HAVE_UNISTD_H
#undef HAVE_FCNTL_H #undef HAVE_FCNTL_H
#undef FT_USE_AUTOCONF_SIZEOF_TYPES
#ifdef FT_USE_AUTOCONF_SIZEOF_TYPES
#undef SIZEOF_INT
#undef SIZEOF_LONG
#define FT_SIZEOF_INT SIZEOF_INT
#define FT_SIZEOF_LONG SIZEOF_LONG
#endif /* FT_USE_AUTOCONF_SIZEOF_TYPES */
#include <freetype/config/integer-types.h> #include <freetype/config/integer-types.h>
#include <freetype/config/public-macros.h> #include <freetype/config/public-macros.h>
#include <freetype/config/mac-support.h> #include <freetype/config/mac-support.h>

View File

@ -1,24 +1,24 @@
/**************************************************************************** /***************************************************************************/
* /* */
* ftsystem.c /* ftsystem.c */
* /* */
* Unix-specific FreeType low-level system interface (body). /* Unix-specific FreeType low-level system interface (body). */
* /* */
* Copyright (C) 1996-2022 by /* Copyright (C) 1996-2020 by */
* David Turner, Robert Wilhelm, and Werner Lemberg. /* David Turner, Robert Wilhelm, and Werner Lemberg. */
* /* */
* This file is part of the FreeType project, and may only be used, /* This file is part of the FreeType project, and may only be used, */
* modified, and distributed under the terms of the FreeType project /* modified, and distributed under the terms of the FreeType project */
* license, LICENSE.TXT. By continuing to use, modify, or distribute /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
* this file you indicate that you have read the license and /* this file you indicate that you have read the license and */
* understand and accept it fully. /* understand and accept it fully. */
* /* */
*/ /***************************************************************************/
#include <ft2build.h> #include <ft2build.h>
/* we use our special ftconfig.h file, not the standard one */ /* we use our special ftconfig.h file, not the standard one */
#include FT_CONFIG_CONFIG_H #include <ftconfig.h>
#include <freetype/internal/ftdebug.h> #include <freetype/internal/ftdebug.h>
#include <freetype/ftsystem.h> #include <freetype/ftsystem.h>
#include <freetype/fterrors.h> #include <freetype/fterrors.h>
@ -70,40 +70,29 @@
#include <errno.h> #include <errno.h>
/************************************************************************** /*************************************************************************/
* /* */
* MEMORY MANAGEMENT INTERFACE /* MEMORY MANAGEMENT INTERFACE */
* /* */
*/ /*************************************************************************/
/************************************************************************** /*************************************************************************/
* /* */
* It is not necessary to do any error checking for the /* <Function> */
* allocation-related functions. This will be done by the higher level /* ft_alloc */
* routines like ft_mem_alloc() or ft_mem_realloc(). /* */
* /* <Description> */
*/ /* The memory allocation function. */
/* */
/* <Input> */
/************************************************************************** /* memory :: A pointer to the memory object. */
* /* */
* @Function: /* size :: The requested size in bytes. */
* ft_alloc /* */
* /* <Return> */
* @Description: /* The address of newly allocated block. */
* The memory allocation function. /* */
*
* @Input:
* memory ::
* A pointer to the memory object.
*
* size ::
* The requested size in bytes.
*
* @Return:
* The address of newly allocated block.
*/
FT_CALLBACK_DEF( void* ) FT_CALLBACK_DEF( void* )
ft_alloc( FT_Memory memory, ft_alloc( FT_Memory memory,
long size ) long size )
@ -114,30 +103,26 @@
} }
/************************************************************************** /*************************************************************************/
* /* */
* @Function: /* <Function> */
* ft_realloc /* ft_realloc */
* /* */
* @Description: /* <Description> */
* The memory reallocation function. /* The memory reallocation function. */
* /* */
* @Input: /* <Input> */
* memory :: /* memory :: A pointer to the memory object. */
* A pointer to the memory object. /* */
* /* cur_size :: The current size of the allocated memory block. */
* cur_size :: /* */
* The current size of the allocated memory block. /* new_size :: The newly requested size in bytes. */
* /* */
* new_size :: /* block :: The current address of the block in memory. */
* The newly requested size in bytes. /* */
* /* <Return> */
* block :: /* The address of the reallocated memory block. */
* The current address of the block in memory. /* */
*
* @Return:
* The address of the reallocated memory block.
*/
FT_CALLBACK_DEF( void* ) FT_CALLBACK_DEF( void* )
ft_realloc( FT_Memory memory, ft_realloc( FT_Memory memory,
long cur_size, long cur_size,
@ -151,21 +136,19 @@
} }
/************************************************************************** /*************************************************************************/
* /* */
* @Function: /* <Function> */
* ft_free /* ft_free */
* /* */
* @Description: /* <Description> */
* The memory release function. /* The memory release function. */
* /* */
* @Input: /* <Input> */
* memory :: /* memory :: A pointer to the memory object. */
* A pointer to the memory object. /* */
* /* block :: The address of block in memory to be freed. */
* block :: /* */
* The address of block in memory to be freed.
*/
FT_CALLBACK_DEF( void ) FT_CALLBACK_DEF( void )
ft_free( FT_Memory memory, ft_free( FT_Memory memory,
void* block ) void* block )
@ -176,19 +159,19 @@
} }
/************************************************************************** /*************************************************************************/
* /* */
* RESOURCE MANAGEMENT INTERFACE /* RESOURCE MANAGEMENT INTERFACE */
* /* */
*/ /*************************************************************************/
/************************************************************************** /*************************************************************************/
* /* */
* The macro FT_COMPONENT is used in trace mode. It is an implicit /* The macro FT_COMPONENT is used in trace mode. It is an implicit */
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log /* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log */
* messages during execution. /* messages during execution. */
*/ /* */
#undef FT_COMPONENT #undef FT_COMPONENT
#define FT_COMPONENT io #define FT_COMPONENT io
@ -197,17 +180,17 @@
#define STREAM_FILE( stream ) ( (FILE*)stream->descriptor.pointer ) #define STREAM_FILE( stream ) ( (FILE*)stream->descriptor.pointer )
/************************************************************************** /*************************************************************************/
* /* */
* @Function: /* <Function> */
* ft_close_stream_by_munmap /* ft_close_stream_by_munmap */
* /* */
* @Description: /* <Description> */
* The function to close a stream which is opened by mmap. /* The function to close a stream which is opened by mmap. */
* /* */
* @Input: /* <Input> */
* stream :: A pointer to the stream object. /* stream :: A pointer to the stream object. */
*/ /* */
FT_CALLBACK_DEF( void ) FT_CALLBACK_DEF( void )
ft_close_stream_by_munmap( FT_Stream stream ) ft_close_stream_by_munmap( FT_Stream stream )
{ {
@ -215,29 +198,29 @@
stream->descriptor.pointer = NULL; stream->descriptor.pointer = NULL;
stream->size = 0; stream->size = 0;
stream->base = NULL; stream->base = 0;
} }
/************************************************************************** /*************************************************************************/
* /* */
* @Function: /* <Function> */
* ft_close_stream_by_free /* ft_close_stream_by_free */
* /* */
* @Description: /* <Description> */
* The function to close a stream which is created by ft_alloc. /* The function to close a stream which is created by ft_alloc. */
* /* */
* @Input: /* <Input> */
* stream :: A pointer to the stream object. /* stream :: A pointer to the stream object. */
*/ /* */
FT_CALLBACK_DEF( void ) FT_CALLBACK_DEF( void )
ft_close_stream_by_free( FT_Stream stream ) ft_close_stream_by_free( FT_Stream stream )
{ {
ft_free( stream->memory, stream->descriptor.pointer ); ft_free( NULL, stream->descriptor.pointer );
stream->descriptor.pointer = NULL; stream->descriptor.pointer = NULL;
stream->size = 0; stream->size = 0;
stream->base = NULL; stream->base = 0;
} }
@ -313,7 +296,8 @@
file, file,
0 ); 0 );
if ( stream->base != MAP_FAILED ) /* on some RTOS, mmap might return 0 */
if ( (long)stream->base != -1 && stream->base != NULL )
stream->close = ft_close_stream_by_munmap; stream->close = ft_close_stream_by_munmap;
else else
{ {
@ -323,7 +307,7 @@
FT_ERROR(( "FT_Stream_Open:" )); FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname )); FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
stream->base = (unsigned char*)ft_alloc( stream->memory, stream->size ); stream->base = (unsigned char*)ft_alloc( NULL, stream->size );
if ( !stream->base ) if ( !stream->base )
{ {
@ -364,7 +348,7 @@
stream->descriptor.pointer = stream->base; stream->descriptor.pointer = stream->base;
stream->pathname.pointer = (char*)filepathname; stream->pathname.pointer = (char*)filepathname;
stream->read = NULL; stream->read = 0;
FT_TRACE1(( "FT_Stream_Open:" )); FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n", FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n",
@ -373,7 +357,7 @@
return FT_Err_Ok; return FT_Err_Ok;
Fail_Read: Fail_Read:
ft_free( stream->memory, stream->base ); ft_free( NULL, stream->base );
Fail_Map: Fail_Map:
close( file ); close( file );
@ -408,7 +392,7 @@
memory = (FT_Memory)malloc( sizeof ( *memory ) ); memory = (FT_Memory)malloc( sizeof ( *memory ) );
if ( memory ) if ( memory )
{ {
memory->user = NULL; memory->user = 0;
memory->alloc = ft_alloc; memory->alloc = ft_alloc;
memory->realloc = ft_realloc; memory->realloc = ft_realloc;
memory->free = ft_free; memory->free = ft_free;

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -62,7 +62,7 @@ endif
$(DESTDIR)$(includedir)/freetype2/freetype/config/ftmodule.h $(DESTDIR)$(includedir)/freetype2/freetype/config/ftmodule.h
$(INSTALL_DATA) $(OBJ_BUILD)/ftoption.h \ $(INSTALL_DATA) $(OBJ_BUILD)/ftoption.h \
$(DESTDIR)$(includedir)/freetype2/freetype/config/ftoption.h $(DESTDIR)$(includedir)/freetype2/freetype/config/ftoption.h
$(INSTALL_SCRIPT) -m 644 $(PLATFORM_DIR)/freetype2.m4 \ $(INSTALL_SCRIPT) -m 644 $(BUILD_DIR)/freetype2.m4 \
$(DESTDIR)$(datadir)/aclocal/freetype2.m4 $(DESTDIR)$(datadir)/aclocal/freetype2.m4
$(INSTALL_SCRIPT) -m 644 $(OBJ_BUILD)/freetype2.pc \ $(INSTALL_SCRIPT) -m 644 $(OBJ_BUILD)/freetype2.pc \
$(DESTDIR)$(libdir)/pkgconfig/freetype2.pc $(DESTDIR)$(libdir)/pkgconfig/freetype2.pc

View File

@ -2,7 +2,7 @@
# FreeType 2 template for Unix-specific compiler definitions # FreeType 2 template for Unix-specific compiler definitions
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -14,7 +14,7 @@
CC := @CC@ CC := @CC@
COMPILER_SEP := $(SEP) COMPILER_SEP := $(SEP)
FT_LIBTOOL_DIR ?= $(PLATFORM_DIR) FT_LIBTOOL_DIR ?= $(BUILD_DIR)
LIBTOOL := $(FT_LIBTOOL_DIR)/libtool LIBTOOL := $(FT_LIBTOOL_DIR)/libtool
@ -73,7 +73,7 @@ T := -o$(space)
# #
# These should concern: debug output, optimization & warnings. # These should concern: debug output, optimization & warnings.
# #
# Use the ANSIFLAGS variable to define the compiler flags used to enforce # Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance. # ANSI compliance.
# #
# We use our own FreeType configuration files overriding defaults. # We use our own FreeType configuration files overriding defaults.
@ -106,7 +106,9 @@ endif
# Linker flags. # Linker flags.
# #
LDFLAGS := @LDFLAGS@ LDFLAGS := @LDFLAGS@
LIB_CLOCK_GETTIME := @LIB_CLOCK_GETTIME@ # for ftbench
# export symbols # export symbols
# #
@ -116,15 +118,11 @@ EXPORTS_LIST := $(OBJ_DIR)/ftexport.sym
CCexe := $(CCraw_build) # used to compile `apinames' only CCexe := $(CCraw_build) # used to compile `apinames' only
# Library linking. # Library linking
# #
LINK_LIBRARY = $(LIBTOOL) --mode=link $(CCraw) -o $@ $(OBJECTS_LIST) \ LINK_LIBRARY = $(LIBTOOL) --mode=link $(CCraw) -o $@ $(OBJECTS_LIST) \
-rpath $(libdir) -version-info $(version_info) \ -rpath $(libdir) -version-info $(version_info) \
$(LDFLAGS) -no-undefined \ $(LDFLAGS) -no-undefined \
-export-symbols $(EXPORTS_LIST) -export-symbols $(EXPORTS_LIST)
# For the demo programs.
FT_DEMO_CFLAGS := @FT_DEMO_CFLAGS@
FT_DEMO_LDFLAGS := @FT_DEMO_LDFLAGS@
# EOF # EOF

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -27,7 +27,7 @@ PYTHON := @PYTHON@
BIN := bin BIN := bin
# this is used for `make distclean' and `make install' # this is used for `make distclean' and `make install'
OBJ_BUILD ?= $(PLATFORM_DIR) OBJ_BUILD ?= $(BUILD_DIR)
# don't use `:=' here since the path stuff will be included after this file # don't use `:=' here since the path stuff will be included after this file
# #
@ -68,14 +68,12 @@ version_info := @version_info@
# Variables needed for `freetype-config' and `freetype.pc'. # Variables needed for `freetype-config' and `freetype.pc'.
# #
PKG_CONFIG := @PKG_CONFIG@ PKG_CONFIG := @PKG_CONFIG@
PKGCONFIG_REQUIRES := @PKGCONFIG_REQUIRES@ REQUIRES_PRIVATE := @REQUIRES_PRIVATE@
PKGCONFIG_REQUIRES_PRIVATE := @PKGCONFIG_REQUIRES_PRIVATE@ LIBS_PRIVATE := @LIBS_PRIVATE@
PKGCONFIG_LIBS := @PKGCONFIG_LIBS@ LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@
PKGCONFIG_LIBS_PRIVATE := @PKGCONFIG_LIBS_PRIVATE@ build_libtool_libs := @build_libtool_libs@
LIBSSTATIC_CONFIG := @LIBSSTATIC_CONFIG@ ft_version := @ft_version@
build_libtool_libs := @build_libtool_libs@
ft_version := @ft_version@
# The directory where all library files are placed. # The directory where all library files are placed.
# #
@ -139,17 +137,15 @@ prefix_x := $(subst $(space),\\$(space),$(prefix))
$(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in $(OBJ_BUILD)/freetype2.pc: $(TOP_DIR)/builds/unix/freetype2.in
rm -f $@ $@.tmp rm -f $@ $@.tmp
sed -e 's|%PKGCONFIG_REQUIRES%|$(PKGCONFIG_REQUIRES)|' \ sed -e 's|%REQUIRES_PRIVATE%|$(REQUIRES_PRIVATE)|' \
-e 's|%PKGCONFIG_REQUIRES_PRIVATE%|$(PKGCONFIG_REQUIRES_PRIVATE)|' \ -e 's|%LIBS_PRIVATE%|$(LIBS_PRIVATE)|' \
-e 's|%PKGCONFIG_LIBS%|$(PKGCONFIG_LIBS)|' \ -e 's|%build_libtool_libs%|$(build_libtool_libs)|' \
-e 's|%PKGCONFIG_LIBS_PRIVATE%|$(PKGCONFIG_LIBS_PRIVATE)|' \ -e 's|%exec_prefix%|$(exec_prefix_x)|' \
-e 's|%build_libtool_libs%|$(build_libtool_libs)|' \ -e 's|%ft_version%|$(ft_version)|' \
-e 's|%exec_prefix%|$(exec_prefix_x)|' \ -e 's|%includedir%|$(includedir_x)|' \
-e 's|%ft_version%|$(ft_version)|' \ -e 's|%libdir%|$(libdir_x)|' \
-e 's|%includedir%|$(includedir_x)|' \ -e 's|%prefix%|$(prefix_x)|' \
-e 's|%libdir%|$(libdir_x)|' \ $< \
-e 's|%prefix%|$(prefix_x)|' \
$< \
> $@.tmp > $@.tmp
chmod a-w $@.tmp chmod a-w $@.tmp
mv $@.tmp $@ mv $@.tmp $@

View File

@ -6,7 +6,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -6,7 +6,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -13,8 +13,8 @@
# fully. # fully.
# We need these declarations here since unix-def.mk is a generated file. # We need these declarations here since unix-def.mk is a generated file.
PLATFORM_DIR := $(TOP_DIR)/builds/unix BUILD_DIR := $(TOP_DIR)/builds/unix
PLATFORM := unix PLATFORM := unix
have_mk := $(wildcard $(OBJ_DIR)/unix-def.mk) have_mk := $(wildcard $(OBJ_DIR)/unix-def.mk)
ifneq ($(have_mk),) ifneq ($(have_mk),)
@ -22,8 +22,8 @@ ifneq ($(have_mk),)
include $(OBJ_DIR)/unix-def.mk include $(OBJ_DIR)/unix-def.mk
include $(OBJ_DIR)/unix-cc.mk include $(OBJ_DIR)/unix-cc.mk
else else
include $(PLATFORM_DIR)/unix-def.mk include $(BUILD_DIR)/unix-def.mk
include $(PLATFORM_DIR)/unix-cc.mk include $(BUILD_DIR)/unix-cc.mk
endif endif
ifdef BUILD_PROJECT ifdef BUILD_PROJECT

View File

@ -4,7 +4,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -27,6 +27,9 @@ SEP := /
# #
BIN := bin BIN := bin
# we use a special devel ftoption.h
DEVEL_DIR := $(TOP_DIR)/devel
# library file name # library file name
# #

View File

@ -4,7 +4,7 @@
* *
* VMS-specific configuration file (specification only). * VMS-specific configuration file (specification only).
* *
* Copyright (C) 1996-2022 by * Copyright (C) 1996-2020 by
* David Turner, Robert Wilhelm, and Werner Lemberg. * David Turner, Robert Wilhelm, and Werner Lemberg.
* *
* This file is part of the FreeType project, and may only be used, * This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
/* */ /* */
/* VMS-specific FreeType low-level system interface (body). */ /* VMS-specific FreeType low-level system interface (body). */
/* */ /* */
/* Copyright (C) 1996-2022 by */ /* Copyright (C) 1996-2020 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used, */ /* This file is part of the FreeType project, and may only be used, */
@ -197,7 +197,7 @@
stream->descriptor.pointer = NULL; stream->descriptor.pointer = NULL;
stream->size = 0; stream->size = 0;
stream->base = NULL; stream->base = 0;
} }
@ -246,7 +246,7 @@
file, file,
0 ); 0 );
if ( stream->base == MAP_FAILED ) if ( (long)stream->base == -1 )
{ {
FT_ERROR(( "FT_Stream_Open:" )); FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname )); FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
@ -259,7 +259,7 @@
stream->pathname.pointer = (char*)filepathname; stream->pathname.pointer = (char*)filepathname;
stream->close = ft_close_stream; stream->close = ft_close_stream;
stream->read = NULL; stream->read = 0;
FT_TRACE1(( "FT_Stream_Open:" )); FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%d bytes) successfully\n", FT_TRACE1(( " opened `%s' (%d bytes) successfully\n",
@ -300,7 +300,7 @@
memory = (FT_Memory)malloc( sizeof ( *memory ) ); memory = (FT_Memory)malloc( sizeof ( *memory ) );
if ( memory ) if ( memory )
{ {
memory->user = NULL; memory->user = 0;
memory->alloc = ft_alloc; memory->alloc = ft_alloc;
memory->realloc = ft_realloc; memory->realloc = ft_realloc;
memory->free = ft_free; memory->free = ft_free;

View File

@ -4,7 +4,7 @@
* *
* Debugging and logging component for WinCE (body). * Debugging and logging component for WinCE (body).
* *
* Copyright (C) 1996-2022 by * Copyright (C) 1996-2020 by
* David Turner, Robert Wilhelm, and Werner Lemberg. * David Turner, Robert Wilhelm, and Werner Lemberg.
* *
* This file is part of the FreeType project, and may only be used, * This file is part of the FreeType project, and may only be used,
@ -230,7 +230,7 @@
/* const char* ft2_debug = getenv( "FT2_DEBUG" ); */ /* const char* ft2_debug = getenv( "FT2_DEBUG" ); */
const char* ft2_debug = NULL; const char* ft2_debug = 0;
if ( ft2_debug ) if ( ft2_debug )

View File

@ -21,7 +21,7 @@ the following targets:
<li>PPC/SP WM6 (Windows Mobile 6)</li> <li>PPC/SP WM6 (Windows Mobile 6)</li>
</ul> </ul>
It compiles the following libraries from the FreeType 2.12.1 sources:</p> It compiles the following libraries from the FreeType 2.10.2 sources:</p>
<ul> <ul>
<pre> <pre>

View File

@ -21,7 +21,7 @@ the following targets:
<li>PPC/SP WM6 (Windows Mobile 6)</li> <li>PPC/SP WM6 (Windows Mobile 6)</li>
</ul> </ul>
It compiles the following libraries from the FreeType 2.12.1 sources:</p> It compiles the following libraries from the FreeType 2.10.2 sources:</p>
<ul> <ul>
<pre> <pre>

View File

@ -3,7 +3,7 @@
# #
# Copyright (C) 1996-2022 by # Copyright (C) 1996-2020 by
# David Turner, Robert Wilhelm, and Werner Lemberg. # David Turner, Robert Wilhelm, and Werner Lemberg.
# #
# This file is part of the FreeType project, and may only be used, modified, # This file is part of the FreeType project, and may only be used, modified,
@ -81,9 +81,9 @@ ifeq ($(PLATFORM),windows)
# (2004-11-11), and then in the devel mailing list (2004-11-20 to -23). # (2004-11-11), and then in the devel mailing list (2004-11-20 to -23).
# #
ifeq ($(OS),Windows_NT) ifeq ($(OS),Windows_NT)
COPY := >nul cmd.exe /c copy COPY := cmd.exe /c copy
else else
COPY := >nul copy COPY := copy
endif # test NT endif # test NT

File diff suppressed because it is too large Load Diff

View File

@ -1,499 +0,0 @@
/****************************************************************************
*
* ftsystem.c
*
* Windows-specific FreeType low-level system interface (body).
*
* Copyright (C) 2021-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
* modified, and distributed under the terms of the FreeType project
* license, LICENSE.TXT. By continuing to use, modify, or distribute
* this file you indicate that you have read the license and
* understand and accept it fully.
*
*/
#include <ft2build.h>
/* we use our special ftconfig.h file, not the standard one */
#include FT_CONFIG_CONFIG_H
#include <freetype/internal/ftdebug.h>
#include <freetype/ftsystem.h>
#include <freetype/fterrors.h>
#include <freetype/fttypes.h>
#include <freetype/internal/ftstream.h>
/* memory mapping and allocation includes and definitions */
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
/**************************************************************************
*
* MEMORY MANAGEMENT INTERFACE
*
*/
/**************************************************************************
*
* It is not necessary to do any error checking for the
* allocation-related functions. This will be done by the higher level
* routines like ft_mem_alloc() or ft_mem_realloc().
*
*/
/**************************************************************************
*
* @Function:
* ft_alloc
*
* @Description:
* The memory allocation function.
*
* @Input:
* memory ::
* A pointer to the memory object.
*
* size ::
* The requested size in bytes.
*
* @Return:
* The address of newly allocated block.
*/
FT_CALLBACK_DEF( void* )
ft_alloc( FT_Memory memory,
long size )
{
return HeapAlloc( memory->user, 0, size );
}
/**************************************************************************
*
* @Function:
* ft_realloc
*
* @Description:
* The memory reallocation function.
*
* @Input:
* memory ::
* A pointer to the memory object.
*
* cur_size ::
* The current size of the allocated memory block.
*
* new_size ::
* The newly requested size in bytes.
*
* block ::
* The current address of the block in memory.
*
* @Return:
* The address of the reallocated memory block.
*/
FT_CALLBACK_DEF( void* )
ft_realloc( FT_Memory memory,
long cur_size,
long new_size,
void* block )
{
FT_UNUSED( cur_size );
return HeapReAlloc( memory->user, 0, block, new_size );
}
/**************************************************************************
*
* @Function:
* ft_free
*
* @Description:
* The memory release function.
*
* @Input:
* memory ::
* A pointer to the memory object.
*
* block ::
* The address of block in memory to be freed.
*/
FT_CALLBACK_DEF( void )
ft_free( FT_Memory memory,
void* block )
{
HeapFree( memory->user, 0, block );
}
/**************************************************************************
*
* RESOURCE MANAGEMENT INTERFACE
*
*/
/**************************************************************************
*
* The macro FT_COMPONENT is used in trace mode. It is an implicit
* parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log
* messages during execution.
*/
#undef FT_COMPONENT
#define FT_COMPONENT io
/* We use the macro STREAM_FILE for convenience to extract the */
/* system-specific stream handle from a given FreeType stream object */
#define STREAM_FILE( stream ) ( (FILE*)stream->descriptor.pointer )
/**************************************************************************
*
* @Function:
* ft_close_stream_by_munmap
*
* @Description:
* The function to close a stream which is opened by mmap.
*
* @Input:
* stream :: A pointer to the stream object.
*/
FT_CALLBACK_DEF( void )
ft_close_stream_by_munmap( FT_Stream stream )
{
UnmapViewOfFile( (LPCVOID)stream->descriptor.pointer );
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = NULL;
}
/**************************************************************************
*
* @Function:
* ft_close_stream_by_free
*
* @Description:
* The function to close a stream which is created by ft_alloc.
*
* @Input:
* stream :: A pointer to the stream object.
*/
FT_CALLBACK_DEF( void )
ft_close_stream_by_free( FT_Stream stream )
{
ft_free( stream->memory, stream->descriptor.pointer );
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = NULL;
}
/* non-desktop Universal Windows Platform */
#if defined( WINAPI_FAMILY ) && WINAPI_FAMILY != WINAPI_FAMILY_DESKTOP_APP
#define PACK_DWORD64( hi, lo ) ( ( (DWORD64)(hi) << 32 ) | (DWORD)(lo) )
#define CreateFileMapping( a, b, c, d, e, f ) \
CreateFileMappingFromApp( a, b, c, PACK_DWORD64( d, e ), f )
#define MapViewOfFile( a, b, c, d, e ) \
MapViewOfFileFromApp( a, b, PACK_DWORD64( c, d ), e )
FT_LOCAL_DEF( HANDLE )
CreateFileA( LPCSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile )
{
int len;
LPWSTR lpFileNameW;
CREATEFILE2_EXTENDED_PARAMETERS createExParams = {
sizeof ( CREATEFILE2_EXTENDED_PARAMETERS ),
dwFlagsAndAttributes & 0x0000FFFF,
dwFlagsAndAttributes & 0xFFF00000,
dwFlagsAndAttributes & 0x000F0000,
lpSecurityAttributes,
hTemplateFile };
/* allocate memory space for converted path name */
len = MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
lpFileName, -1, NULL, 0 );
lpFileNameW = (LPWSTR)_alloca( len * sizeof ( WCHAR ) );
if ( !len || !lpFileNameW )
{
FT_ERROR(( "FT_Stream_Open: cannot convert file name to LPWSTR\n" ));
return INVALID_HANDLE_VALUE;
}
/* now it is safe to do the translation */
MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
lpFileName, -1, lpFileNameW, len );
/* open the file */
return CreateFile2( lpFileNameW, dwDesiredAccess, dwShareMode,
dwCreationDisposition, &createExParams );
}
#endif
#if defined( _WIN32_WCE )
/* malloc.h provides implementation of alloca()/_alloca() */
#include <malloc.h>
FT_LOCAL_DEF( HANDLE )
CreateFileA( LPCSTR lpFileName,
DWORD dwDesiredAccess,
DWORD dwShareMode,
LPSECURITY_ATTRIBUTES lpSecurityAttributes,
DWORD dwCreationDisposition,
DWORD dwFlagsAndAttributes,
HANDLE hTemplateFile )
{
int len;
LPWSTR lpFileNameW;
/* allocate memory space for converted path name */
len = MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
lpFileName, -1, NULL, 0 );
lpFileNameW = (LPWSTR)_alloca( len * sizeof ( WCHAR ) );
if ( !len || !lpFileNameW )
{
FT_ERROR(( "FT_Stream_Open: cannot convert file name to LPWSTR\n" ));
return INVALID_HANDLE_VALUE;
}
/* now it is safe to do the translation */
MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
lpFileName, -1, lpFileNameW, len );
/* open the file */
return CreateFileW( lpFileNameW, dwDesiredAccess, dwShareMode,
lpSecurityAttributes, dwCreationDisposition,
dwFlagsAndAttributes, hTemplateFile );
}
#endif
#if defined( _WIN32_WCE ) || defined ( _WIN32_WINDOWS ) || \
!defined( _WIN32_WINNT ) || _WIN32_WINNT <= 0x0400
FT_LOCAL_DEF( BOOL )
GetFileSizeEx( HANDLE hFile,
PLARGE_INTEGER lpFileSize )
{
lpFileSize->u.LowPart = GetFileSize( hFile,
(DWORD *)&lpFileSize->u.HighPart );
if ( lpFileSize->u.LowPart == INVALID_FILE_SIZE &&
GetLastError() != NO_ERROR )
return FALSE;
else
return TRUE;
}
#endif
/* documentation is in ftobjs.h */
FT_BASE_DEF( FT_Error )
FT_Stream_Open( FT_Stream stream,
const char* filepathname )
{
HANDLE file;
HANDLE fm;
LARGE_INTEGER size;
if ( !stream )
return FT_THROW( Invalid_Stream_Handle );
/* open the file */
file = CreateFileA( (LPCSTR)filepathname, GENERIC_READ, FILE_SHARE_READ,
NULL, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0 );
if ( file == INVALID_HANDLE_VALUE )
{
FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not open `%s'\n", filepathname ));
return FT_THROW( Cannot_Open_Resource );
}
if ( GetFileSizeEx( file, &size ) == FALSE )
{
FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not retrieve size of file `%s'\n", filepathname ));
goto Fail_Open;
}
/* `stream->size' is typedef'd to unsigned long (in `ftsystem.h'); */
/* So avoid overflow caused by fonts in huge files larger than */
/* 2GB, do a test. */
if ( size.QuadPart > LONG_MAX )
{
FT_ERROR(( "FT_Stream_Open: file is too big\n" ));
goto Fail_Open;
}
else if ( size.QuadPart == 0 )
{
FT_ERROR(( "FT_Stream_Open: zero-length file\n" ));
goto Fail_Open;
}
fm = CreateFileMapping( file, NULL, PAGE_READONLY, 0, 0, NULL );
if ( fm == NULL )
{
FT_ERROR(( "FT_Stream_Open: can not map file\n" ));
goto Fail_Open;
}
/* Store only the low part of this 64 bits integer because long is */
/* a 32 bits type. Anyway, a check has been done above to forbid */
/* a size greater than LONG_MAX */
stream->size = size.LowPart;
stream->pos = 0;
stream->base = (unsigned char *)
MapViewOfFile( fm, FILE_MAP_READ, 0, 0, 0 );
CloseHandle( fm );
if ( stream->base != NULL )
stream->close = ft_close_stream_by_munmap;
else
{
DWORD total_read_count;
FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
stream->base = (unsigned char*)ft_alloc( stream->memory, stream->size );
if ( !stream->base )
{
FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `alloc' memory\n" ));
goto Fail_Open;
}
total_read_count = 0;
do
{
DWORD read_count;
if ( ReadFile( file,
stream->base + total_read_count,
stream->size - total_read_count,
&read_count, NULL ) == FALSE )
{
FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " error while `read'ing file `%s'\n", filepathname ));
goto Fail_Read;
}
total_read_count += read_count;
} while ( total_read_count != stream->size );
stream->close = ft_close_stream_by_free;
}
CloseHandle( file );
stream->descriptor.pointer = stream->base;
stream->pathname.pointer = (char*)filepathname;
stream->read = NULL;
FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n",
filepathname, stream->size ));
return FT_Err_Ok;
Fail_Read:
ft_free( stream->memory, stream->base );
Fail_Open:
CloseHandle( file );
stream->base = NULL;
stream->size = 0;
stream->pos = 0;
return FT_THROW( Cannot_Open_Stream );
}
#ifdef FT_DEBUG_MEMORY
extern FT_Int
ft_mem_debug_init( FT_Memory memory );
extern void
ft_mem_debug_done( FT_Memory memory );
#endif
/* documentation is in ftobjs.h */
FT_BASE_DEF( FT_Memory )
FT_New_Memory( void )
{
HANDLE heap;
FT_Memory memory;
heap = GetProcessHeap();
memory = heap ? (FT_Memory)HeapAlloc( heap, 0, sizeof ( *memory ) )
: NULL;
if ( memory )
{
memory->user = heap;
memory->alloc = ft_alloc;
memory->realloc = ft_realloc;
memory->free = ft_free;
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_init( memory );
#endif
}
return memory;
}
/* documentation is in ftobjs.h */
FT_BASE_DEF( void )
FT_Done_Memory( FT_Memory memory )
{
#ifdef FT_DEBUG_MEMORY
ft_mem_debug_done( memory );
#endif
memory->free( memory, memory );
}
/* END */

Some files were not shown because too many files have changed in this diff Show More