Update freetype to 2.12.1

ftdebug.c files are new, adapted the import script to copy the source
file for Windows as well.

Replaced the CMakeLists.txt content that was imported from the .pro file
with the respective variables and logic from the freetype CMakeLists.txt
file, which should make it easier to maintain this next time.

Fixes: QTBUG-105032
Change-Id: I1e846167b268df4b1b0a50dcec602def1a0bdcb4
Reviewed-by: Kai Koehne <kai.koehne@qt.io>
(cherry picked from commit e79d7f12e6ca15c499a553e4a701a2887e4b184c)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Volker Hilsheimer 2022-07-18 12:57:14 +02:00 committed by Qt Cherry-pick Bot
parent d84b84ac82
commit d8b98f8232
513 changed files with 35534 additions and 6123 deletions

View File

@ -1,4 +1,58 @@
# Generated from freetype.pro.
# From freetype CMakeLists.txt
set(BASE_SRCS
src/autofit/autofit.c
src/base/ftbase.c
src/base/ftbbox.c
src/base/ftbdf.c
src/base/ftbitmap.c
src/base/ftcid.c
src/base/ftfstype.c
src/base/ftgasp.c
src/base/ftglyph.c
src/base/ftgxval.c
src/base/ftinit.c
src/base/ftmm.c
src/base/ftotval.c
src/base/ftpatent.c
src/base/ftpfr.c
src/base/ftstroke.c
src/base/ftsynth.c
src/base/fttype1.c
src/base/ftwinfnt.c
src/bdf/bdf.c
src/bzip2/ftbzip2.c
src/cache/ftcache.c
src/cff/cff.c
src/cid/type1cid.c
src/gzip/ftgzip.c
src/lzw/ftlzw.c
src/pcf/pcf.c
src/pfr/pfr.c
src/psaux/psaux.c
src/pshinter/pshinter.c
src/psnames/psnames.c
src/raster/raster.c
src/sdf/sdf.c
src/sfnt/sfnt.c
src/smooth/smooth.c
src/svg/svg.c
src/truetype/truetype.c
src/type1/type1.c
src/type42/type42.c
src/winfonts/winfnt.c
)
if (WIN32)
# enable_language(RC)
list(APPEND BASE_SRCS builds/windows/ftdebug.c)
# src/base/ftver.rc)
elseif (WINCE)
list(APPEND BASE_SRCS builds/wince/ftdebug.c)
else ()
list(APPEND BASE_SRCS src/base/ftdebug.c)
endif ()
#####################################################################
## BundledFreetype Generic Library:
@ -9,36 +63,7 @@ qt_internal_add_3rdparty_library(BundledFreetype
STATIC
INSTALL
SOURCES
src/autofit/autofit.c
src/base/ftbase.c
src/base/ftbbox.c
src/base/ftbitmap.c
src/base/ftdebug.c
src/base/ftglyph.c
src/base/ftinit.c
src/base/ftmm.c
src/base/ftsynth.c
src/base/fttype1.c
src/bdf/bdf.c
src/cache/ftcache.c
src/cff/cff.c
src/cid/type1cid.c
src/gzip/ftgzip.c
src/lzw/ftlzw.c
src/otvalid/otvalid.c
src/otvalid/otvbase.c
src/pcf/pcf.c
src/pfr/pfr.c
src/psaux/psaux.c
src/pshinter/pshinter.c
src/psnames/psmodule.c
src/raster/raster.c
src/sfnt/sfnt.c
src/smooth/smooth.c
src/truetype/truetype.c
src/type1/type1.c
src/type42/type42.c
src/winfonts/winfnt.c
${BASE_SRCS}
DEFINES
FT2_BUILD_LIBRARY
FT_CONFIG_OPTION_SYSTEM_ZLIB

View File

@ -1,96 +1,101 @@
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
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
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 `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.
- 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
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 `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 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
file src/bdf/README and src/pcf/README).
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 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.
The MD5 checksum support (only used for debugging in development
builds) is in the public domain.
-- FTL.TXT --
--- FDL.TXT ---
The FreeType Project LICENSE
----------------------------
The FreeType Project LICENSE
----------------------------
2006-Jan-27
2006-Jan-27
Copyright 1996-2002, 2006 by
David Turner, Robert Wilhelm, and Werner Lemberg
Copyright 1996-2002, 2006 by
David Turner, Robert Wilhelm, and Werner Lemberg
Introduction
============
The FreeType Project is distributed in several archive packages;
some of them may contain, in addition to the FreeType font engine,
various tools and contributions which rely on, or relate to, the
FreeType Project.
The FreeType Project is distributed in several archive packages;
some of them may contain, in addition to the FreeType font engine,
various tools and contributions which rely on, or relate to, the
FreeType Project.
This license applies to all files found in such packages, and
which do not fall under their own explicit license. The license
affects thus the FreeType font engine, the test programs,
documentation and makefiles, at the very least.
This license applies to all files found in such packages, and
which do not fall under their own explicit license. The license
affects thus the FreeType font engine, the test programs,
documentation and makefiles, at the very least.
This license was inspired by the BSD, Artistic, and IJG
(Independent JPEG Group) licenses, which all encourage inclusion
and use of free software in commercial and freeware products
alike. As a consequence, its main points are that:
This license was inspired by the BSD, Artistic, and IJG
(Independent JPEG Group) licenses, which all encourage inclusion
and use of free software in commercial and freeware products
alike. As a consequence, its main points are that:
o We don't promise that this software works. However, we will be
interested in any kind of bug reports. (`as is' distribution)
o We don't promise that this software works. However, we will be
interested in any kind of bug reports. (`as is' distribution)
o You can use this software for whatever you want, in parts or
full form, without having to pay us. (`royalty-free' usage)
o You can use this software for whatever you want, in parts or
full form, without having to pay us. (`royalty-free' usage)
o You may not pretend that you wrote this software. If you use
it, or only parts of it, in a program, you must acknowledge
somewhere in your documentation that you have used the
FreeType code. (`credits')
o You may not pretend that you wrote this software. If you use
it, or only parts of it, in a program, you must acknowledge
somewhere in your documentation that you have used the
FreeType code. (`credits')
We specifically permit and encourage the inclusion of this
software, with or without modifications, in commercial products.
We disclaim all warranties covering The FreeType Project and
assume no liability related to The FreeType Project.
We specifically permit and encourage the inclusion of this
software, with or without modifications, in commercial products.
We disclaim all warranties covering The FreeType Project and
assume no liability related to The FreeType Project.
Finally, many people asked us for a preferred form for a
credit/disclaimer to use in compliance with this license. We thus
encourage you to use the following text:
Finally, many people asked us for a preferred form for a
credit/disclaimer to use in compliance with this license. We thus
encourage you to use the following text:
"""
Portions of this software are copyright © <year> The FreeType
Project (www.freetype.org). All rights reserved.
"""
"""
Portions of this software are copyright © <year> The FreeType
Project (www.freetype.org). All rights reserved.
"""
Please replace <year> with the value from the FreeType version you
actually use.
Please replace <year> with the value from the FreeType version you
actually use.
Legal Terms
@ -99,110 +104,111 @@ Legal Terms
0. Definitions
--------------
Throughout this license, the terms `package', `FreeType Project',
and `FreeType archive' refer to the set of files originally
distributed by the authors (David Turner, Robert Wilhelm, and
Werner Lemberg) as the `FreeType Project', be they named as alpha,
beta or final release.
Throughout this license, the terms `package', `FreeType Project',
and `FreeType archive' refer to the set of files originally
distributed by the authors (David Turner, Robert Wilhelm, and
Werner Lemberg) as the `FreeType Project', be they named as alpha,
beta or final release.
`You' refers to the licensee, or person using the project, where
`using' is a generic term including compiling the project's source
code as well as linking it to form a `program' or `executable'.
This program is referred to as `a program using the FreeType
engine'.
`You' refers to the licensee, or person using the project, where
`using' is a generic term including compiling the project's source
code as well as linking it to form a `program' or `executable'.
This program is referred to as `a program using the FreeType
engine'.
This license applies to all files distributed in the original
FreeType Project, including all source code, binaries and
documentation, unless otherwise stated in the file in its
original, unmodified form as distributed in the original archive.
If you are unsure whether or not a particular file is covered by
this license, you must contact us to verify this.
This license applies to all files distributed in the original
FreeType Project, including all source code, binaries and
documentation, unless otherwise stated in the file in its
original, unmodified form as distributed in the original archive.
If you are unsure whether or not a particular file is covered by
this license, you must contact us to verify this.
The FreeType Project is copyright (C) 1996-2000 by David Turner,
Robert Wilhelm, and Werner Lemberg. All rights reserved except as
specified below.
The FreeType Project is copyright (C) 1996-2000 by David Turner,
Robert Wilhelm, and Werner Lemberg. All rights reserved except as
specified below.
1. No Warranty
--------------
THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
USE, OF THE FREETYPE PROJECT.
THE FREETYPE PROJECT IS PROVIDED `AS IS' WITHOUT WARRANTY OF ANY
KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. IN NO EVENT WILL ANY OF THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE FOR ANY DAMAGES CAUSED BY THE USE OR THE INABILITY TO
USE, OF THE FREETYPE PROJECT.
2. Redistribution
-----------------
This license grants a worldwide, royalty-free, perpetual and
irrevocable right and license to use, execute, perform, compile,
display, copy, create derivative works of, distribute and
sublicense the FreeType Project (in both source and object code
forms) and derivative works thereof for any purpose; and to
authorize others to exercise some or all of the rights granted
herein, subject to the following conditions:
This license grants a worldwide, royalty-free, perpetual and
irrevocable right and license to use, execute, perform, compile,
display, copy, create derivative works of, distribute and
sublicense the FreeType Project (in both source and object code
forms) and derivative works thereof for any purpose; and to
authorize others to exercise some or all of the rights granted
herein, subject to the following conditions:
o Redistribution of source code must retain this license file
(`FTL.TXT') unaltered; any additions, deletions or changes to
the original files must be clearly indicated in accompanying
documentation. The copyright notices of the unaltered,
original files must be preserved in all copies of source
files.
o Redistribution of source code must retain this license file
(`FTL.TXT') unaltered; any additions, deletions or changes to
the original files must be clearly indicated in accompanying
documentation. The copyright notices of the unaltered,
original files must be preserved in all copies of source
files.
o Redistribution in binary form must provide a disclaimer that
states that the software is based in part of the work of the
FreeType Team, in the distribution documentation. We also
encourage you to put an URL to the FreeType web page in your
documentation, though this isn't mandatory.
o Redistribution in binary form must provide a disclaimer that
states that the software is based in part of the work of the
FreeType Team, in the distribution documentation. We also
encourage you to put an URL to the FreeType web page in your
documentation, though this isn't mandatory.
These conditions apply to any software derived from or based on
the FreeType Project, not just the unmodified files. If you use
our work, you must acknowledge us. However, no fee need be paid
to us.
These conditions apply to any software derived from or based on
the FreeType Project, not just the unmodified files. If you use
our work, you must acknowledge us. However, no fee need be paid
to us.
3. Advertising
--------------
Neither the FreeType authors and contributors nor you shall use
the name of the other for commercial, advertising, or promotional
purposes without specific prior written permission.
Neither the FreeType authors and contributors nor you shall use
the name of the other for commercial, advertising, or promotional
purposes without specific prior written permission.
We suggest, but do not require, that you use one or more of the
following phrases to refer to this software in your documentation
or advertising materials: `FreeType Project', `FreeType Engine',
`FreeType library', or `FreeType Distribution'.
We suggest, but do not require, that you use one or more of the
following phrases to refer to this software in your documentation
or advertising materials: `FreeType Project', `FreeType Engine',
`FreeType library', or `FreeType Distribution'.
As you have not signed this license, you are not required to
accept it. However, as the FreeType Project is copyrighted
material, only this license, or another one contracted with the
authors, grants you the right to use, distribute, and modify it.
Therefore, by using, distributing, or modifying the FreeType
Project, you indicate that you understand and accept all the terms
of this license.
As you have not signed this license, you are not required to
accept it. However, as the FreeType Project is copyrighted
material, only this license, or another one contracted with the
authors, grants you the right to use, distribute, and modify it.
Therefore, by using, distributing, or modifying the FreeType
Project, you indicate that you understand and accept all the terms
of this license.
4. Contacts
-----------
There are two mailing lists related to FreeType:
There are two mailing lists related to FreeType:
o freetype@nongnu.org
o freetype@nongnu.org
Discusses general use and applications of FreeType, as well as
future and wanted additions to the library and distribution.
If you are looking for support, start in this list if you
haven't found anything to help you in the documentation.
Discusses general use and applications of FreeType, as well as
future and wanted additions to the library and distribution.
If you are looking for support, start in this list if you
haven't found anything to help you in the documentation.
o freetype-devel@nongnu.org
o freetype-devel@nongnu.org
Discusses bugs, as well as engine internals, design issues,
specific licenses, porting, etc.
Discusses bugs, as well as engine internals, design issues,
specific licenses, porting, etc.
Our home page can be found at
Our home page can be found at
http://www.freetype.org
https://www.freetype.org
--- end of FDL.TXT ---
--- end of FTL.TXT ---
--- GPLv2.TXT ---

View File

@ -18,3 +18,27 @@ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
--
Copyright 1990, 1994, 1998 The Open Group
Permission to use, copy, modify, distribute, and sell this software and its
documentation for any purpose is hereby granted without fee, provided that
the above copyright notice appear in all copies and that both that
copyright notice and this permission notice appear in supporting
documentation.
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of The Open Group shall not be
used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization from The Open Group.

View File

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

View File

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

View File

@ -1,19 +1,19 @@
/***************************************************************************/
/* */
/* ftsystem.c */
/* */
/* Unix-specific FreeType low-level system interface (body). */
/* */
/* Copyright (C) 1996-2020 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. */
/* */
/***************************************************************************/
/****************************************************************************
*
* ftsystem.c
*
* Unix-specific FreeType low-level system interface (body).
*
* Copyright (C) 1996-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>
@ -70,30 +70,40 @@
#include <string.h>
#include <errno.h>
/*************************************************************************/
/* */
/* MEMORY MANAGEMENT INTERFACE */
/* */
/*************************************************************************/
/**************************************************************************
*
* MEMORY MANAGEMENT INTERFACE
*
*/
/*************************************************************************/
/* */
/* <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. */
/* */
/**************************************************************************
*
* 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 )
@ -104,26 +114,30 @@
}
/*************************************************************************/
/* */
/* <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. */
/* */
/**************************************************************************
*
* @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,
@ -137,19 +151,21 @@
}
/*************************************************************************/
/* */
/* <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. */
/* */
/**************************************************************************
*
* @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 )
@ -160,19 +176,19 @@
}
/*************************************************************************/
/* */
/* RESOURCE MANAGEMENT INTERFACE */
/* */
/*************************************************************************/
/**************************************************************************
*
* 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. */
/* */
/**************************************************************************
*
* 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
@ -181,17 +197,17 @@
#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. */
/* */
/**************************************************************************
*
* @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 )
{
@ -199,29 +215,29 @@
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = 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. */
/* */
/**************************************************************************
*
* @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( NULL, stream->descriptor.pointer );
ft_free( stream->memory, stream->descriptor.pointer );
stream->descriptor.pointer = NULL;
stream->size = 0;
stream->base = 0;
stream->base = NULL;
}
@ -297,8 +313,7 @@
file,
0 );
/* on some RTOS, mmap might return 0 */
if ( (long)stream->base != -1 && stream->base != NULL )
if ( stream->base != MAP_FAILED )
stream->close = ft_close_stream_by_munmap;
else
{
@ -308,7 +323,7 @@
FT_ERROR(( "FT_Stream_Open:" ));
FT_ERROR(( " could not `mmap' file `%s'\n", filepathname ));
stream->base = (unsigned char*)ft_alloc( NULL, stream->size );
stream->base = (unsigned char*)ft_alloc( stream->memory, stream->size );
if ( !stream->base )
{
@ -349,7 +364,7 @@
stream->descriptor.pointer = stream->base;
stream->pathname.pointer = (char*)filepathname;
stream->read = 0;
stream->read = NULL;
FT_TRACE1(( "FT_Stream_Open:" ));
FT_TRACE1(( " opened `%s' (%ld bytes) successfully\n",
@ -358,7 +373,7 @@
return FT_Err_Ok;
Fail_Read:
ft_free( NULL, stream->base );
ft_free( stream->memory, stream->base );
Fail_Map:
close( file );
@ -393,7 +408,7 @@
memory = (FT_Memory)malloc( sizeof ( *memory ) );
if ( memory )
{
memory->user = 0;
memory->user = NULL;
memory->alloc = ft_alloc;
memory->realloc = ft_realloc;
memory->free = ft_free;

View File

@ -0,0 +1,698 @@
/****************************************************************************
*
* ftdebug.c
*
* Debugging and logging component for Win32 (body).
*
* Copyright (C) 1996-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.
*
*/
/**************************************************************************
*
* This component contains various macros and functions used to ease the
* debugging of the FreeType engine. Its main purpose is in assertion
* checking, tracing, and error detection.
*
* There are now three debugging modes:
*
* - trace mode
*
* Error and trace messages are sent to the log file (which can be the
* standard error output).
*
* - error mode
*
* Only error messages are generated.
*
* - release mode:
*
* No error message is sent or generated. The code is free from any
* debugging parts.
*
*/
#include <freetype/freetype.h>
#include <freetype/ftlogging.h>
#include <freetype/internal/ftdebug.h>
#include <freetype/internal/ftobjs.h>
#ifdef FT_DEBUG_LOGGING
/**************************************************************************
*
* Variables used to control logging.
*
* 1. `ft_default_trace_level` stores the value of trace levels, which are
* provided to FreeType using the `FT2_DEBUG` environment variable.
*
* 2. `ft_fileptr` stores the `FILE*` handle.
*
* 3. `ft_component` is a string that holds the name of `FT_COMPONENT`.
*
* 4. The flag `ft_component_flag` prints the name of `FT_COMPONENT` along
* with the actual log message if set to true.
*
* 5. The flag `ft_timestamp_flag` prints time along with the actual log
* message if set to ture.
*
* 6. `ft_have_newline_char` is used to differentiate between a log
* message with and without a trailing newline character.
*
* 7. `ft_custom_trace_level` stores the custom trace level value, which
* is provided by the user at run-time.
*
* We use `static` to avoid 'unused variable' warnings.
*
*/
static const char* ft_default_trace_level = NULL;
static FILE* ft_fileptr = NULL;
static const char* ft_component = NULL;
static FT_Bool ft_component_flag = FALSE;
static FT_Bool ft_timestamp_flag = FALSE;
static FT_Bool ft_have_newline_char = TRUE;
static const char* ft_custom_trace_level = NULL;
/* declared in ftdebug.h */
dlg_handler ft_default_log_handler = NULL;
FT_Custom_Log_Handler custom_output_handler = NULL;
#endif /* FT_DEBUG_LOGGING */
#ifdef FT_DEBUG_LEVEL_ERROR
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#ifdef _WIN32_WCE
FT_LOACAL_DEF( void )
OutputDebugStringA( LPCSTR lpOutputString )
{
int len;
LPWSTR lpOutputStringW;
/* allocate memory space for converted string */
len = MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
lpOutputString, -1, NULL, 0 );
lpOutputStringW = (LPWSTR)_alloca( len * sizeof ( WCHAR ) );
if ( !len || !lpOutputStringW )
return;
/* now it is safe to do the translation */
MultiByteToWideChar( CP_ACP, MB_ERR_INVALID_CHARS,
lpOutputString, -1, lpOutputStringW, len );
OutputDebugStringW( lpOutputStringW );
}
#endif /* _WIN32_WCE */
/* documentation is in ftdebug.h */
FT_BASE_DEF( void )
FT_Message( const char* fmt,
... )
{
va_list ap;
va_start( ap, fmt );
vfprintf( stderr, fmt, ap );
#if ( defined( _WIN32_WINNT ) && _WIN32_WINNT >= 0x0400 ) || \
( defined( _WIN32_WCE ) && _WIN32_WCE >= 0x0600 )
if ( IsDebuggerPresent() )
{
static char buf[1024];
vsnprintf( buf, sizeof buf, fmt, ap );
OutputDebugStringA( buf );
}
#endif
va_end( ap );
}
/* documentation is in ftdebug.h */
FT_BASE_DEF( void )
FT_Panic( const char* fmt,
... )
{
va_list ap;
va_start( ap, fmt );
vfprintf( stderr, fmt, ap );
#if ( defined( _WIN32_WINNT ) && _WIN32_WINNT >= 0x0400 ) || \
( defined( _WIN32_WCE ) && _WIN32_WCE >= 0x0600 )
if ( IsDebuggerPresent() )
{
static char buf[1024];
vsnprintf( buf, sizeof buf, fmt, ap );
OutputDebugStringA( buf );
}
#endif
va_end( ap );
exit( EXIT_FAILURE );
}
/* documentation is in ftdebug.h */
FT_BASE_DEF( int )
FT_Throw( FT_Error error,
int line,
const char* file )
{
#if 0
/* activating the code in this block makes FreeType very chatty */
fprintf( stderr,
"%s:%d: error 0x%02x: %s\n",
file,
line,
error,
FT_Error_String( error ) );
#else
FT_UNUSED( error );
FT_UNUSED( line );
FT_UNUSED( file );
#endif
return 0;
}
#endif /* FT_DEBUG_LEVEL_ERROR */
#ifdef FT_DEBUG_LEVEL_TRACE
/* array of trace levels, initialized to 0; */
/* this gets adjusted at run-time */
static int ft_trace_levels_enabled[trace_count];
/* array of trace levels, always initialized to 0 */
static int ft_trace_levels_disabled[trace_count];
/* a pointer to either `ft_trace_levels_enabled' */
/* or `ft_trace_levels_disabled' */
int* ft_trace_levels;
/* define array of trace toggle names */
#define FT_TRACE_DEF( x ) #x ,
static const char* ft_trace_toggles[trace_count + 1] =
{
#include <freetype/internal/fttrace.h>
NULL
};
#undef FT_TRACE_DEF
/* documentation is in ftdebug.h */
FT_BASE_DEF( FT_Int )
FT_Trace_Get_Count( void )
{
return trace_count;
}
/* documentation is in ftdebug.h */
FT_BASE_DEF( const char * )
FT_Trace_Get_Name( FT_Int idx )
{
int max = FT_Trace_Get_Count();
if ( idx < max )
return ft_trace_toggles[idx];
else
return NULL;
}
/* documentation is in ftdebug.h */
FT_BASE_DEF( void )
FT_Trace_Disable( void )
{
ft_trace_levels = ft_trace_levels_disabled;
}
/* documentation is in ftdebug.h */
FT_BASE_DEF( void )
FT_Trace_Enable( void )
{
ft_trace_levels = ft_trace_levels_enabled;
}
/**************************************************************************
*
* Initialize the tracing sub-system. This is done by retrieving the
* value of the `FT2_DEBUG' environment variable. It must be a list of
* toggles, separated by spaces, `;', or `,'. Example:
*
* export FT2_DEBUG="any:3 memory:7 stream:5"
*
* This requests that all levels be set to 3, except the trace level for
* the memory and stream components which are set to 7 and 5,
* respectively.
*
* See the file `include/freetype/internal/fttrace.h' for details of
* the available toggle names.
*
* The level must be between 0 and 7; 0 means quiet (except for serious
* runtime errors), and 7 means _very_ verbose.
*/
FT_BASE_DEF( void )
ft_debug_init( void )
{
const char* ft2_debug = NULL;
#ifdef FT_DEBUG_LOGGING
if ( ft_custom_trace_level != NULL )
ft2_debug = ft_custom_trace_level;
else
ft2_debug = ft_default_trace_level;
#else
ft2_debug = ft_getenv( "FT2_DEBUG" );
#endif
if ( ft2_debug )
{
const char* p = ft2_debug;
const char* q;
for ( ; *p; p++ )
{
/* skip leading whitespace and separators */
if ( *p == ' ' || *p == '\t' || *p == ',' || *p == ';' || *p == '=' )
continue;
#ifdef FT_DEBUG_LOGGING
/* check extra arguments for logging */
if ( *p == '-' )
{
const char* r = ++p;
if ( *r == 'v' )
{
const char* s = ++r;
ft_component_flag = TRUE;
if ( *s == 't' )
{
ft_timestamp_flag = TRUE;
p++;
}
p++;
}
else if ( *r == 't' )
{
const char* s = ++r;
ft_timestamp_flag = TRUE;
if ( *s == 'v' )
{
ft_component_flag = TRUE;
p++;
}
p++;
}
}
#endif /* FT_DEBUG_LOGGING */
/* read toggle name, followed by ':' */
q = p;
while ( *p && *p != ':' )
p++;
if ( !*p )
break;
if ( *p == ':' && p > q )
{
FT_Int n, i, len = (FT_Int)( p - q );
FT_Int level = -1, found = -1;
for ( n = 0; n < trace_count; n++ )
{
const char* toggle = ft_trace_toggles[n];
for ( i = 0; i < len; i++ )
{
if ( toggle[i] != q[i] )
break;
}
if ( i == len && toggle[i] == 0 )
{
found = n;
break;
}
}
/* read level */
p++;
if ( *p )
{
level = *p - '0';
if ( level < 0 || level > 7 )
level = -1;
}
if ( found >= 0 && level >= 0 )
{
if ( found == trace_any )
{
/* special case for `any' */
for ( n = 0; n < trace_count; n++ )
ft_trace_levels_enabled[n] = level;
}
else
ft_trace_levels_enabled[found] = level;
}
}
}
}
ft_trace_levels = ft_trace_levels_enabled;
}
#else /* !FT_DEBUG_LEVEL_TRACE */
FT_BASE_DEF( void )
ft_debug_init( void )
{
/* nothing */
}
FT_BASE_DEF( FT_Int )
FT_Trace_Get_Count( void )
{
return 0;
}
FT_BASE_DEF( const char * )
FT_Trace_Get_Name( FT_Int idx )
{
FT_UNUSED( idx );
return NULL;
}
FT_BASE_DEF( void )
FT_Trace_Disable( void )
{
/* nothing */
}
/* documentation is in ftdebug.h */
FT_BASE_DEF( void )
FT_Trace_Enable( void )
{
/* nothing */
}
#endif /* !FT_DEBUG_LEVEL_TRACE */
#ifdef FT_DEBUG_LOGGING
/**************************************************************************
*
* Initialize and de-initialize 'dlg' library.
*
*/
FT_BASE_DEF( void )
ft_logging_init( void )
{
ft_default_log_handler = ft_log_handler;
ft_default_trace_level = ft_getenv( "FT2_DEBUG" );
if ( ft_getenv( "FT_LOGGING_FILE" ) )
ft_fileptr = ft_fopen( ft_getenv( "FT_LOGGING_FILE" ), "w" );
else
ft_fileptr = stderr;
ft_debug_init();
/* Set the default output handler for 'dlg'. */
dlg_set_handler( ft_default_log_handler, NULL );
}
FT_BASE_DEF( void )
ft_logging_deinit( void )
{
if ( ft_fileptr != stderr )
ft_fclose( ft_fileptr );
}
/**************************************************************************
*
* An output log handler for FreeType.
*
*/
FT_BASE_DEF( void )
ft_log_handler( const struct dlg_origin* origin,
const char* string,
void* data )
{
char features_buf[128];
char* bufp = features_buf;
FT_UNUSED( data );
if ( ft_have_newline_char )
{
const char* features = NULL;
size_t features_length = 0;
#define FEATURES_TIMESTAMP "[%h:%m] "
#define FEATURES_COMPONENT "[%t] "
#define FEATURES_TIMESTAMP_COMPONENT "[%h:%m %t] "
if ( ft_timestamp_flag && ft_component_flag )
{
features = FEATURES_TIMESTAMP_COMPONENT;
features_length = sizeof ( FEATURES_TIMESTAMP_COMPONENT );
}
else if ( ft_timestamp_flag )
{
features = FEATURES_TIMESTAMP;
features_length = sizeof ( FEATURES_TIMESTAMP );
}
else if ( ft_component_flag )
{
features = FEATURES_COMPONENT;
features_length = sizeof ( FEATURES_COMPONENT );
}
if ( ft_component_flag || ft_timestamp_flag )
{
ft_strncpy( features_buf, features, features_length );
bufp += features_length - 1;
}
if ( ft_component_flag )
{
size_t tag_length = ft_strlen( *origin->tags );
size_t i;
/* To vertically align tracing messages we compensate the */
/* different FT_COMPONENT string lengths by inserting an */
/* appropriate amount of space characters. */
for ( i = 0;
i < FT_MAX_TRACE_LEVEL_LENGTH - tag_length;
i++ )
*bufp++ = ' ';
}
}
/* Finally add the format string for the tracing message. */
*bufp++ = '%';
*bufp++ = 'c';
*bufp = '\0';
dlg_generic_outputf_stream( ft_fileptr,
(const char*)features_buf,
origin,
string,
dlg_default_output_styles,
true );
if ( ft_strrchr( string, '\n' ) )
ft_have_newline_char = TRUE;
else
ft_have_newline_char = FALSE;
}
/* documentation is in ftdebug.h */
FT_BASE_DEF( void )
ft_add_tag( const char* tag )
{
ft_component = tag;
dlg_add_tag( tag, NULL );
}
/* documentation is in ftdebug.h */
FT_BASE_DEF( void )
ft_remove_tag( const char* tag )
{
dlg_remove_tag( tag, NULL );
}
/* documentation is in ftlogging.h */
FT_EXPORT_DEF( void )
FT_Trace_Set_Level( const char* level )
{
ft_component_flag = FALSE;
ft_timestamp_flag = FALSE;
ft_custom_trace_level = level;
ft_debug_init();
}
/* documentation is in ftlogging.h */
FT_EXPORT_DEF( void )
FT_Trace_Set_Default_Level( void )
{
ft_component_flag = FALSE;
ft_timestamp_flag = FALSE;
ft_custom_trace_level = NULL;
ft_debug_init();
}
/**************************************************************************
*
* Functions to handle a custom log handler.
*
*/
/* documentation is in ftlogging.h */
FT_EXPORT_DEF( void )
FT_Set_Log_Handler( FT_Custom_Log_Handler handler )
{
custom_output_handler = handler;
}
/* documentation is in ftlogging.h */
FT_EXPORT_DEF( void )
FT_Set_Default_Log_Handler( void )
{
custom_output_handler = NULL;
}
/* documentation is in ftdebug.h */
FT_BASE_DEF( void )
FT_Logging_Callback( const char* fmt,
... )
{
va_list ap;
va_start( ap, fmt );
custom_output_handler( ft_component, fmt, ap );
va_end( ap );
}
#else /* !FT_DEBUG_LOGGING */
FT_EXPORT_DEF( void )
FT_Trace_Set_Level( const char* level )
{
FT_UNUSED( level );
}
FT_EXPORT_DEF( void )
FT_Trace_Set_Default_Level( void )
{
/* nothing */
}
FT_EXPORT_DEF( void )
FT_Set_Log_Handler( FT_Custom_Log_Handler handler )
{
FT_UNUSED( handler );
}
FT_EXPORT_DEF( void )
FT_Set_Default_Log_Handler( void )
{
/* nothing */
}
#endif /* !FT_DEBUG_LOGGING */
/* END */

View File

@ -1,4 +1,235 @@
CHANGES BETWEEN 2.10.3 and 2.10.4
CHANGES BETWEEN 2.12.0 and 2.12.1
I. IMPORTANT BUG FIXES
- Loading CFF fonts sometimes made FreeType crash (bug introduced in
version 2.12.0)
- Loading a fully hinted TrueType glyph a second time (without
caching) sometimes yielded different rendering results if TrueType
hinting was active (bug introduced in version 2.12.0).
- The generation of the pkg-config file `freetype2.pc` was broken if
the build was done with cmake (bug introduced in version 2.12.0).
II. MISCELLANEOUS
- New option `--with-librsvg` for the `configure` script for better
FreeType demo support.
- The meson build no longer enforces both static and dynamic
versions of the library by default.
- The internal zlib library was updated to version 1.2.12. Note,
however, that FreeType is *not* affected by CVE-2018-25032 since
it only does decompression.
======================================================================
CHANGES BETWEEN 2.11.1 and 2.12.0
I. IMPORTANT CHANGES
- FreeType now handles OT-SVG fonts, to be controlled with
`FT_CONFIG_OPTION_SVG` configuration macro. By default, it can
only load the 'SVG ' table of an OpenType font. However, by using
the `svg-hooks` property of the new 'ot-svg' module it is possible
to register an external SVG rendering engine. The FreeType demo
programs have been set up to use 'librsvg' as the rendering
library.
This work was Moazin Khatti's GSoC 2019 project.
II. MISCELLANEOUS
- The handling of fonts with an 'sbix' table has been improved.
- Corrected bitmap offsets.
- A new tag `FT_PARAM_TAG_IGNORE_SBIX` for `FT_Open_Face` makes
FreeType ignore an 'sbix' table in a font, allowing applications
to access the font's outline glyphs.
- `FT_FACE_FLAG_SBIX` and `FT_FACE_FLAG_SBIX_OVERLAY` together
with their corresponding preprocessor macros `FT_HAS_SBIX` and
`FT_HAS_SBIX_OVERLAY` enable applications to treat 'sbix' tables
as described in the OpenType specification.
- The internal 'zlib' code has been updated to be in sync with the
current 'zlib' version (1.2.11).
- The previously internal load flag `FT_LOAD_SBITS_ONLY` is now
public.
- Some minor improvements of the building systems, in particular
handling of the 'zlib' library (internal vs. external).
- Support for non-desktop Universal Windows Platform.
- Various other minor bug and documentation fixes.
- The `ftdump` demo program shows more information for Type1 fonts
if option `-n` is given.
- `ftgrid` can now display embedded bitmap strikes.
======================================================================
CHANGES BETWEEN 2.11.0 and 2.11.1
I. IMPORTANT CHANGES
- Some fields in the `CID_FaceDictRec`, `CID_FaceInfoRec`, and
`FT_Data` structures have been changed from signed to unsigned
type, which better reflects the actual usage. It is also an
additional means to protect against malformed input.
II. MISCELLANEOUS
- Cmake support has been further improved. To do that various
backward-incompatible changes were necessary; please see file
`CMakeLists.txt` for more details.
- Since version 2.11.0, a C99 compiler is necessary to compile
FreeType.
- The experimental 'COLR' v1 API has been updated to the latest
OpenType standard 1.9.
- The `apinames` tool got a new option `-wV` to output an OpenVMS
Linker Option File.
- VMS support was updated.
- MS Visual Studio support was added to build the demo programs.
======================================================================
CHANGES BETWEEN 2.10.4 and 2.11.0
I. IMPORTANT CHANGES
- A new rendering module has been added to create 8-bit Signed
Distance Field (SDF) bitmaps for both outline and bitmap glyphs.
The new rendering mode is called `FT_RENDER_MODE_SDF`, the pixel
mode is `FT_PIXEL_MODE_GRAY8`, and the corresponding raster flag
is `FT_RASTER_FLAG_SDF`.
This work was Anuj Verma's GSoC 2020 project.
- A new, experimental API is now available for surfacing properties
of 'COLR' v1 color fonts (as the name says, this is an extension
to the 'COLR' table for outline color fonts using the SFNT
container format). 'COLR' v1 fonts are a recently proposed
addition to OFF and OpenType; specification work currently happens
in
https://github.com/googlefonts/colr-gradients-spec/
'COLR' v1 is expected to be merged to OpenType; the ISO
standardisation process for adding 'COLR' v1 as an amendment to
OFF is underway.
Functions similar to the already existing 'COLR' API have been
added to access the corresponding data.
FT_Get_Color_Glyph_Paint
Retrieve the root paint for a given glyph ID.
FT_Get_Paint_Layers
Access the layers of a `PaintColrLayers` table.
FT_Get_Colorline_Stops
Retrieve the 'color stops' on a color line. As an input, a
color stop iterator gets used, which in turn is retrieved from
a paint.
FT_Get_Paint
Dereference an `FT_OpaquePaint` object and retrieve the
corresponding `FT_COLR_Paint` object, which contains details
on how to draw the respective 'COLR' v1 `Paint` table.
II. MISCELLANEOUS
- FreeType has moved its infrastructure to
https://gitlab.freedesktop.org/freetype
A side effect is that the git repositories are now called
`freetype.git` and `freetype-demos.git`, which by default expand
to the directories `freetype` and `freetype-demos`, respectively.
The documentation has been updated accordingly.
FreeType's Savannah repositories will stay; they are now mirrors
of the 'freedesktop.org' repositories.
- A new function `FT_Get_Transform` returns the values set by
`FT_Set_Transform`.
- A new configuration macro `FT_DEBUG_LOGGING` is available. It
provides extended debugging capabilities for FreeType, for example
showing a time stamp or displaying the component a tracing message
comes from. See file `docs/DEBUG` for more information.
This work was Priyesh Kumar's GSoC 2020 project.
- The legacy Type 1 and CFF engines are further demoted due to lack
of CFF2 charstring support. You now need to use `FT_Property_Set`
to enable them besides the `T1_CONFIG_OPTION_OLD_ENGINE` and
`CFF_CONFIG_OPTION_OLD_ENGINE` options, respectively.
- The experimental 'warp' mode (AF_CONFIG_OPTION_USE_WARPER) for the
auto-hinter has been removed.
- The smooth rasterizer performance has been improved by >10%. Note
that due to necessary code changes there might be very subtle
differences in rendering. They are not visible by the eye,
however.
- PCF bitmap fonts compressed with LZW (these are usually files with
the extension `.pcf.Z`) are now handled correctly.
- Improved Meson build files, including support to build the
FreeType demo programs.
- A new demo program `ftsdf` is available to display Signed Distance
Fields of glyphs.
- The `ftlint` demo program has been extended to do more testing of
its input. In particular, it can display horizontal and vertical
acutances for quality assessment, together with computing MD5
checksums of rendered glyphs.
[The acutance measures how sharply the pixel coverage changes at
glyph edges. For monochrome bitmaps, it is always 2.0 in either
X or Y direction. For anti-aliased bitmaps, it depends on the
hinting and the shape of a glyph and might approach or even reach
value 2.0 for glyphs like 'I', 'L', '+', '-', or '=', while it
might be lower for glyphs like 'O', 'S', or 'W'.]
- The `ttdebug` demo program didn't show changed point coordinates
(bug introduced in version 2.10.3).
- It is now possible to adjust the axis increment for variable fonts
in the `ftmulti` demo program.
- It is now possible to change the hinting engine in the `ftstring`
demo program.
- The graphical demo programs work better now in native color depth
on win32 and x11.
======================================================================
CHANGES BETWEEN 2.10.3 and 2.10.4 (2020-Oct-20)
I. IMPORTANT BUG FIXES
@ -13,7 +244,7 @@ CHANGES BETWEEN 2.10.3 and 2.10.4
======================================================================
CHANGES BETWEEN 2.10.2 and 2.10.3
CHANGES BETWEEN 2.10.2 and 2.10.3 (2020-Oct-10)
I. IMPORTANT CHANGES
@ -63,7 +294,7 @@ CHANGES BETWEEN 2.10.2 and 2.10.3
======================================================================
CHANGES BETWEEN 2.10.1 and 2.10.2
CHANGES BETWEEN 2.10.1 and 2.10.2 (2020-May-09)
I. IMPORTANT CHANGES
@ -100,7 +331,7 @@ CHANGES BETWEEN 2.10.1 and 2.10.2
======================================================================
CHANGES BETWEEN 2.10.0 and 2.10.1
CHANGES BETWEEN 2.10.0 and 2.10.1 (2019-Jul-01)
I. IMPORTANT BUG FIXES
@ -154,7 +385,7 @@ CHANGES BETWEEN 2.10.0 and 2.10.1
======================================================================
CHANGES BETWEEN 2.9.1 and 2.10.0
CHANGES BETWEEN 2.9.1 and 2.10.0 (2019-Mar-15)
I. IMPORTANT CHANGES
@ -280,7 +511,7 @@ CHANGES BETWEEN 2.9.1 and 2.10.0
======================================================================
CHANGES BETWEEN 2.9 and 2.9.1
CHANGES BETWEEN 2.9 and 2.9.1 (2019-May-01)
I. IMPORTANT BUG FIXES
@ -328,7 +559,7 @@ CHANGES BETWEEN 2.9 and 2.9.1
======================================================================
CHANGES BETWEEN 2.8.1 and 2.9
CHANGES BETWEEN 2.8.1 and 2.9 (2018-Jan-08)
I. IMPORTANT BUG FIXES
@ -418,7 +649,7 @@ CHANGES BETWEEN 2.8.1 and 2.9
======================================================================
CHANGES BETWEEN 2.8 and 2.8.1
CHANGES BETWEEN 2.8 and 2.8.1 (2017-Sep-16)
I. IMPORTANT BUG FIXES
@ -501,7 +732,7 @@ CHANGES BETWEEN 2.8 and 2.8.1
======================================================================
CHANGES BETWEEN 2.7.1 and 2.8
CHANGES BETWEEN 2.7.1 and 2.8 (2017-May-13)
I. IMPORTANT CHANGES
@ -622,7 +853,7 @@ CHANGES BETWEEN 2.7.1 and 2.8
======================================================================
CHANGES BETWEEN 2.7 and 2.7.1
CHANGES BETWEEN 2.7 and 2.7.1 (2016-Dec-30)
I. IMPORTANT CHANGES
@ -699,7 +930,7 @@ CHANGES BETWEEN 2.7 and 2.7.1
======================================================================
CHANGES BETWEEN 2.6.5 and 2.7
CHANGES BETWEEN 2.6.5 and 2.7 (2016-Sep-08)
I. IMPORTANT CHANGES
@ -763,7 +994,7 @@ CHANGES BETWEEN 2.6.5 and 2.7
======================================================================
CHANGES BETWEEN 2.6.4 and 2.6.5
CHANGES BETWEEN 2.6.4 and 2.6.5 (2016-Jul-12)
I. IMPORTANT BUG FIXES
@ -783,7 +1014,7 @@ CHANGES BETWEEN 2.6.4 and 2.6.5
======================================================================
CHANGES BETWEEN 2.6.3 and 2.6.4
CHANGES BETWEEN 2.6.3 and 2.6.4 (2016-Jul-05)
I. IMPORTANT CHANGES
@ -849,7 +1080,7 @@ CHANGES BETWEEN 2.6.3 and 2.6.4
======================================================================
CHANGES BETWEEN 2.6.2 and 2.6.3
CHANGES BETWEEN 2.6.2 and 2.6.3 (2016-Feb-08)
I. IMPORTANT CHANGES
@ -898,7 +1129,7 @@ CHANGES BETWEEN 2.6.2 and 2.6.3
======================================================================
CHANGES BETWEEN 2.6.1 and 2.6.2
CHANGES BETWEEN 2.6.1 and 2.6.2 (2015-Nov-28)
I. IMPORTANT CHANGES
@ -958,7 +1189,7 @@ CHANGES BETWEEN 2.6.1 and 2.6.2
======================================================================
CHANGES BETWEEN 2.6 and 2.6.1
CHANGES BETWEEN 2.6 and 2.6.1 (2015-Oct-04)
I. IMPORTANT BUG FIXES
@ -1039,7 +1270,7 @@ CHANGES BETWEEN 2.6 and 2.6.1
======================================================================
CHANGES BETWEEN 2.5.5 and 2.6
CHANGES BETWEEN 2.5.5 and 2.6 (2015-Jun-07)
I. IMPORTANT CHANGES
@ -1145,7 +1376,7 @@ CHANGES BETWEEN 2.5.5 and 2.6
======================================================================
CHANGES BETWEEN 2.5.4 and 2.5.5
CHANGES BETWEEN 2.5.4 and 2.5.5 (2014-Dec-30)
I. IMPORTANT BUG FIXES
@ -1155,7 +1386,7 @@ CHANGES BETWEEN 2.5.4 and 2.5.5
======================================================================
CHANGES BETWEEN 2.5.3 and 2.5.4
CHANGES BETWEEN 2.5.3 and 2.5.4 (2014-Dec-06)
I. IMPORTANT BUG FIXES
@ -1226,7 +1457,7 @@ CHANGES BETWEEN 2.5.3 and 2.5.4
======================================================================
CHANGES BETWEEN 2.5.2 and 2.5.3
CHANGES BETWEEN 2.5.2 and 2.5.3 (2014-Mar-06)
I. IMPORTANT BUG FIXES
@ -1294,7 +1525,7 @@ CHANGES BETWEEN 2.5.2 and 2.5.3
======================================================================
CHANGES BETWEEN 2.5.1 and 2.5.2
CHANGES BETWEEN 2.5.1 and 2.5.2 (2013-Dec-08)
I. IMPORTANT BUG FIXES
@ -1318,7 +1549,7 @@ CHANGES BETWEEN 2.5.1 and 2.5.2
======================================================================
CHANGES BETWEEN 2.5 and 2.5.1
CHANGES BETWEEN 2.5 and 2.5.1 (2013-Nov-25)
I. IMPORTANT BUG FIXES
@ -1422,7 +1653,7 @@ CHANGES BETWEEN 2.5 and 2.5.1
======================================================================
CHANGES BETWEEN 2.4.12 and 2.5
CHANGES BETWEEN 2.4.12 and 2.5 (2013-Jun-19)
I. IMPORTANT BUG FIXES
@ -1502,7 +1733,7 @@ CHANGES BETWEEN 2.4.12 and 2.5
======================================================================
CHANGES BETWEEN 2.4.11 and 2.4.12
CHANGES BETWEEN 2.4.11 and 2.4.12 (2013-May-08)
- We have another CFF parsing and hinting engine! Written by Dave
Arnold <darnold@adobe.com>, this work has been contributed by
@ -1590,7 +1821,7 @@ index ebcf189..3f2ce6b 100644
======================================================================
CHANGES BETWEEN 2.4.10 and 2.4.11
CHANGES BETWEEN 2.4.10 and 2.4.11 (2012-Dec-20)
I. IMPORTANT BUG FIXES
@ -1650,7 +1881,7 @@ CHANGES BETWEEN 2.4.10 and 2.4.11
======================================================================
CHANGES BETWEEN 2.4.9 and 2.4.10
CHANGES BETWEEN 2.4.9 and 2.4.10 (2012-Jun-15)
I. IMPORTANT BUG FIXES
@ -1675,7 +1906,7 @@ CHANGES BETWEEN 2.4.9 and 2.4.10
======================================================================
CHANGES BETWEEN 2.4.8 and 2.4.9
CHANGES BETWEEN 2.4.8 and 2.4.9 (2012-Mar-08)
I. IMPORTANT BUG FIXES
@ -1703,7 +1934,7 @@ CHANGES BETWEEN 2.4.8 and 2.4.9
======================================================================
CHANGES BETWEEN 2.4.7 and 2.4.8
CHANGES BETWEEN 2.4.7 and 2.4.8 (2011-Nov-14)
I. IMPORTANT BUG FIXES
@ -1719,7 +1950,7 @@ CHANGES BETWEEN 2.4.7 and 2.4.8
======================================================================
CHANGES BETWEEN 2.4.6 and 2.4.7
CHANGES BETWEEN 2.4.6 and 2.4.7 (2011-Oct-18)
I. IMPORTANT BUG FIXES
@ -1736,7 +1967,7 @@ CHANGES BETWEEN 2.4.6 and 2.4.7
======================================================================
CHANGES BETWEEN 2.4.5 and 2.4.6
CHANGES BETWEEN 2.4.5 and 2.4.6 (2011-Jul-29)
I. IMPORTANT BUG FIXES
@ -1775,7 +2006,7 @@ CHANGES BETWEEN 2.4.5 and 2.4.6
======================================================================
CHANGES BETWEEN 2.4.4 and 2.4.5
CHANGES BETWEEN 2.4.4 and 2.4.5 (2011-Jun-25)
I. IMPORTANT BUG FIXES
@ -1822,7 +2053,7 @@ CHANGES BETWEEN 2.4.4 and 2.4.5
======================================================================
CHANGES BETWEEN 2.4.3 and 2.4.4
CHANGES BETWEEN 2.4.3 and 2.4.4 (2010-Nov-28)
I. IMPORTANT BUG FIXES
@ -1847,7 +2078,7 @@ CHANGES BETWEEN 2.4.3 and 2.4.4
======================================================================
CHANGES BETWEEN 2.4.2 and 2.4.3
CHANGES BETWEEN 2.4.2 and 2.4.3 (2010-Oct-03)
I. IMPORTANT BUG FIXES
@ -1866,7 +2097,7 @@ CHANGES BETWEEN 2.4.2 and 2.4.3
======================================================================
CHANGES BETWEEN 2.4.1 and 2.4.2
CHANGES BETWEEN 2.4.1 and 2.4.2 (2010-Aug-06)
I. IMPORTANT BUG FIXES
@ -1890,7 +2121,7 @@ CHANGES BETWEEN 2.4.1 and 2.4.2
======================================================================
CHANGES BETWEEN 2.4.0 and 2.4.1
CHANGES BETWEEN 2.4.0 and 2.4.1 (2010-Jul-18)
I. IMPORTANT CHANGES
@ -1900,7 +2131,7 @@ CHANGES BETWEEN 2.4.0 and 2.4.1
======================================================================
CHANGES BETWEEN 2.3.12 and 2.4.0
CHANGES BETWEEN 2.3.12 and 2.4.0 (2010-Jul-12)
I. IMPORTANT CHANGES
@ -5299,7 +5530,7 @@ Extensions support:
------------------------------------------------------------------------
Copyright (C) 2000-2020 by
Copyright (C) 2000-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -139,7 +139,7 @@ IV. Overriding default configuration and module headers
----------------------------------------------------------------------
Copyright (C) 2003-2020 by
Copyright (C) 2003-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -44,6 +44,21 @@ located in the file `ftoption.h'. The macros are:
When `FT2_DEBUG_MEMORY' isn't defined at runtime, the debugging
memory manager is ignored, and performance is unaffected.
FT_DEBUG_LOGGING
#define this macro for enhanced logging support; it automatically
sets `FT_DEBUG_LEVEL_TRACE' and `FT_DEBUG_LEVEL_ERROR'.
If defined, `FT_TRACE' and `FT_ERROR' can send tracing and
debugging messages to a file. The location of the log file has to
be set with the `FT_LOGGING_FILE' environment variable (more on
this later).
The main enhancements are the possibility of logging the time and
the name of the `FT_COMPONENT' macro together with the affected
`FT_TRACE' or `FT_ERROR' calls. See below how to activate this in
the `FT2_DEBUG' environment variable.
II. Debugging macros
--------------------
@ -150,6 +165,43 @@ behaviour of FreeType at runtime.
the memory and io components, which are set to the trace levels 5
and 4, respectively.
If `FT_DEBUG_LOGGING' is defined, two more options are available.
* -v: Print also the name of FreeType's component from which the
current log is produced, together with the tracing level.
* -t: Print also the time.
Here are some examples how the output might look like.
FT2_DEBUG="any:7 memory:5 -vt"
=> [20:32:02:44969 ttload:2] table directory loaded
FT2_DEBUG="any:7 memory:5 -t"
=> [20:32:02:44969] table directory loaded
FT2_DEBUG="any:7 memory:5 -v"
=> [ttload:2] table directory loaded
FT_LOGGING_FILE
This variable is only used if FreeType is built with the
`FT_DEBUG_LOGGING' macro defined. It contains the path to the
file where the user wants to put his log file. If it is not set,
FreeType uses stderr.
Examples:
On UNIX-like systems with bash:
export FT_LOGGING_FILE="/tmp/freetype2.log"
On Windows:
set FT_LOGGING_FILE=C:\Users\AppData\Local\Temp\freetype2.log
FT2_DEBUG_MEMORY
@ -201,9 +253,51 @@ behaviour of FreeType at runtime.
If it is undefined, or if its value is not strictly positive,
freed blocks are released at runtime.
IV. Additional Capabilities with `FT_DEBUG_LOGGING'
---------------------------------------------------
If `FT_DEBUG_LOGGING' is defined, four APIs are available to provide
additional debugging support. Use
#include <freetype/ftlogging.h>
to access them.
FT_Trace_Set_Level( const char* level )
By default, FreeType uses the tracing levels set in the
`FT2_DEBUG' environment variable. Use this function to override
the value with `level'. Use value `NULL' to disable tracing.
FT_Trace_Set_Default_Level():
Reset the tracing levels to the default value, i.e., the value of
the `FT2_DEBUG' environment variable or no tracing if not set.
FT_Set_Log_Handler( ft_custom_log_handler handler ):
Use `handler' as a custom handler for formatting tracing and error
messages. The `ft_custom_log_handler' typedef has the following
prototype.
void
(*ft_custom_log_handler)( const char* ft_component,
const char* fmt,
va_list args );
`ft_component' is the current component like `ttload', `fmt' is the
first argument of `FT_TRACE' or `FT_ERROR', and `args' holds the
remaining arguments.
FT_Set_Default_Log_Handler():
Reset the log handler to the default version.
------------------------------------------------------------------------
Copyright (C) 2002-2020 by
Copyright (C) 2002-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -1,39 +0,0 @@
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 `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 `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
file src/bdf/README and src/pcf/README). The same holds for the files
`fthash.c' and `fthash.h'; their code was 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

@ -27,7 +27,7 @@ Other bugs have been registered at the savannah bugzilla of FreeType.
------------------------------------------------------------------------
Copyright (C) 2001-2020 by
Copyright (C) 2001-2022 by
David Turner, Robert Wilhelm, and Werner Lemberg.
This file is part of the FreeType project, and may only be used,

View File

@ -78,6 +78,7 @@ copy_file_or_dir() {
FILES="
README
builds/unix/ftsystem.c
builds/windows/ftdebug.c
docs/CHANGES
docs/CUSTOMIZE
docs/DEBUG
@ -85,7 +86,6 @@ FILES="
docs/TODO
docs/FTL.TXT
docs/GPLv2.TXT
docs/LICENSE.TXT
include/
src/
"

View File

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

View File

@ -4,7 +4,7 @@
*
* Build macros of the FreeType 2 library.
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -777,6 +777,18 @@
#define FT_COLOR_H <freetype/ftcolor.h>
/**************************************************************************
*
* @macro:
* FT_OTSVG_H
*
* @description:
* A macro used in `#include` statements to name the file containing the
* FreeType~2 API which handles the OpenType 'SVG~' glyphs.
*/
#define FT_OTSVG_H <freetype/otsvg.h>
/* */
/* These header files don't need to be included by the user. */

View File

@ -19,12 +19,15 @@ FT_USE_MODULE( FT_Driver_ClassRec, pfr_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, t42_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, winfnt_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, pcf_driver_class )
FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
FT_USE_MODULE( FT_Module_Class, psaux_module_class )
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
FT_USE_MODULE( FT_Module_Class, pshinter_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Module_Class, sfnt_module_class )
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_class )
FT_USE_MODULE( FT_Driver_ClassRec, bdf_driver_class )
FT_USE_MODULE( FT_Renderer_Class, ft_raster1_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_sdf_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_bitmap_sdf_renderer_class )
FT_USE_MODULE( FT_Renderer_Class, ft_svg_renderer_class )
/* EOF */

View File

@ -4,7 +4,7 @@
*
* User-selectable configuration macros (specification only).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -105,8 +105,7 @@ FT_BEGIN_HEADER
*
* ```
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
* cff:no-stem-darkening=1 \
* autofitter:warping=1
* cff:no-stem-darkening=1
* ```
*
*/
@ -220,6 +219,10 @@ FT_BEGIN_HEADER
* If you use a build system like cmake or the `configure` script,
* options set by those programs have precedence, overwriting the value
* here with the configured one.
*
* If you use the GNU make build system directly (that is, without the
* `configure` script) and you define this macro, you also have to pass
* `SYSTEM_ZLIB=yes` as an argument to make.
*/
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
@ -431,6 +434,23 @@ FT_BEGIN_HEADER
/* #define FT_DEBUG_LEVEL_TRACE */
/**************************************************************************
*
* Logging
*
* Compiling FreeType in debug or trace mode makes FreeType write error
* and trace log messages to `stderr`. Enabling this macro
* automatically forces the `FT_DEBUG_LEVEL_ERROR` and
* `FT_DEBUG_LEVEL_TRACE` macros and allows FreeType to write error and
* trace log messages to a file instead of `stderr`. For writing logs
* to a file, FreeType uses an the external `dlg` library (the source
* code is in `src/dlg`).
*
* This option needs a C99 compiler.
*/
/* #define FT_DEBUG_LOGGING */
/**************************************************************************
*
* Autofitter debugging
@ -507,6 +527,20 @@ FT_BEGIN_HEADER
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
/**************************************************************************
*
* OpenType SVG Glyph Support
*
* Setting this macro enables support for OpenType SVG glyphs. By
* default, FreeType can only fetch SVG documents. However, it can also
* render them if external rendering hook functions are plugged in at
* runtime.
*
* More details on the hooks can be found in file `otsvg.h`.
*/
#define FT_CONFIG_OPTION_SVG
/**************************************************************************
*
* Error Strings
@ -892,24 +926,6 @@ FT_BEGIN_HEADER
#endif
/**************************************************************************
*
* Compile 'autofit' module with warp hinting. The idea of the warping
* code is to slightly scale and shift a glyph within a single dimension so
* that as much of its segments are aligned (more or less) on the grid. To
* find out the optimal scaling and shifting value, various parameter
* combinations are tried and scored.
*
* You can switch warping on and off with the `warping` property of the
* auto-hinter (see file `ftdriver.h` for more information; by default it
* is switched off).
*
* This experimental option is not active if the rendering mode is
* `FT_RENDER_MODE_LIGHT`.
*/
#define AF_CONFIG_OPTION_USE_WARPER
/**************************************************************************
*
* Use TrueType-like size metrics for 'light' auto-hinting.
@ -961,6 +977,21 @@ FT_BEGIN_HEADER
#endif
/*
* The TT_SUPPORT_COLRV1 macro is defined to indicate to clients that this
* version of FreeType has support for 'COLR' v1 API. This definition is
* useful to FreeType clients that want to build in support for 'COLR' v1
* depending on a tip-of-tree checkout before it is officially released in
* FreeType, and while the feature cannot yet be tested against using
* version macros. Don't change this macro. This may be removed once the
* feature is in a FreeType release version and version macros can be used
* to test for availability.
*/
#ifdef TT_CONFIG_OPTION_COLOR_LAYERS
#define TT_SUPPORT_COLRV1
#endif
/*
* Check CFF darkening parameters. The checks are the same as in function
* `cff_property_set` in file `cffdrivr.c`.
@ -989,8 +1020,8 @@ FT_BEGIN_HEADER
#error "Invalid CFF darkening parameters!"
#endif
FT_END_HEADER
FT_END_HEADER
#endif /* FTOPTION_H_ */

View File

@ -5,7 +5,7 @@
* ANSI-specific library and header configuration file (specification
* only).
*
* Copyright (C) 2002-2020 by
* Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -43,7 +43,8 @@
*
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
* `int` and `long` in bytes at compile-time. So far, this works for all
* platforms the library has been tested on.
* platforms the library has been tested on. We also check `ULLONG_MAX`
* to see whether we can use 64-bit `long long` later on.
*
* Note that on the extremely rare platforms that do not provide integer
* types that are _exactly_ 16 and 32~bits wide (e.g., some old Crays where
@ -66,6 +67,15 @@
#define FT_LONG_MIN LONG_MIN
#define FT_LONG_MAX LONG_MAX
#define FT_ULONG_MAX ULONG_MAX
#ifdef LLONG_MAX
#define FT_LLONG_MAX LLONG_MAX
#endif
#ifdef LLONG_MIN
#define FT_LLONG_MIN LLONG_MIN
#endif
#ifdef ULLONG_MAX
#define FT_ULLONG_MAX ULLONG_MAX
#endif
/**************************************************************************

View File

@ -4,7 +4,7 @@
*
* FreeType integer types definitions.
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -60,6 +60,18 @@
#endif /* !defined(FT_SIZEOF_LONG) */
#ifndef FT_SIZEOF_LONG_LONG
/* The size of a `long long` type if available */
#if defined( FT_ULLONG_MAX ) && FT_ULLONG_MAX >= 0xFFFFFFFFFFFFFFFFULL
#define FT_SIZEOF_LONG_LONG ( 64 / FT_CHAR_BIT )
#else
#define FT_SIZEOF_LONG_LONG 0
#endif
#endif /* !defined(FT_SIZEOF_LONG_LONG) */
/**************************************************************************
*
* @section:
@ -174,15 +186,17 @@
#endif
/* determine whether we have a 64-bit `int` type for platforms without */
/* Autoconf */
/* determine whether we have a 64-bit integer type */
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
/* `FT_LONG64` must be defined if a 64-bit type is available */
#define FT_LONG64
#define FT_INT64 long
#define FT_UINT64 unsigned long
#elif FT_SIZEOF_LONG_LONG >= ( 64 / FT_CHAR_BIT )
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
/**************************************************************************
*
* A 64-bit data type may create compilation problems if you compile in
@ -192,16 +206,9 @@
*/
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
/* this compiler provides the `__int64` type */
#define FT_LONG64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
@ -211,32 +218,30 @@
/* to test the compiler version. */
/* this compiler provides the `__int64` type */
#define FT_LONG64
#define FT_INT64 __int64
#define FT_UINT64 unsigned __int64
#elif defined( __WATCOMC__ ) /* Watcom C++ */
#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1100 /* Watcom C++ */
/* Watcom doesn't provide 64-bit data types */
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#elif defined( __GNUC__ )
/* GCC provides the `long long` type */
#define FT_LONG64
#define FT_INT64 long long int
#define FT_UINT64 unsigned long long int
#endif /* __STDC_VERSION__ >= 199901L */
#endif /* !__STDC__ */
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
#ifdef FT_LONG64
#ifdef FT_INT64
typedef FT_INT64 FT_Int64;
typedef FT_UINT64 FT_UInt64;
#endif

View File

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

View File

@ -4,7 +4,7 @@
*
* Define a set of compiler macros used in public FreeType headers.
*
* Copyright (C) 2020 by
* 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,
@ -103,6 +103,7 @@ FT_BEGIN_HEADER
*/
#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
/*
* `FT_UNUSED` indicates that a given parameter is not used -- this is
* only used to get rid of unpleasant compiler warnings.
@ -115,6 +116,23 @@ FT_BEGIN_HEADER
#endif
/*
* Support for casts in both C and C++.
*/
#ifdef __cplusplus
#define FT_STATIC_CAST( type, var ) static_cast<type>(var)
#define FT_REINTERPRET_CAST( type, var ) reinterpret_cast<type>(var)
#define FT_STATIC_BYTE_CAST( type, var ) \
static_cast<type>( static_cast<unsigned char>( var ) )
#else
#define FT_STATIC_CAST( type, var ) (type)(var)
#define FT_REINTERPRET_CAST( type, var ) (type)(var)
#define FT_STATIC_BYTE_CAST( type, var ) (type)(unsigned char)(var)
#endif
FT_END_HEADER
#endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */

View File

@ -4,7 +4,7 @@
*
* FreeType high-level API and common types (specification only).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -30,6 +30,34 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* preamble
*
* @title:
* Preamble
*
* @abstract:
* What FreeType is and isn't
*
* @description:
* FreeType is a library that provides access to glyphs in font files. It
* scales the glyph images and their metrics to a requested size, and it
* rasterizes the glyph images to produce pixel or subpixel alpha coverage
* bitmaps.
*
* Note that FreeType is _not_ a text layout engine. You have to use
* higher-level libraries like HarfBuzz, Pango, or ICU for that.
*
* Note also that FreeType does _not_ perform alpha blending or
* compositing the resulting bitmaps or pixmaps by itself. Use your
* favourite graphics library (for example, Cairo or Skia) to further
* process FreeType's output.
*
*/
/**************************************************************************
*
* @section:
@ -125,6 +153,9 @@ FT_BEGIN_HEADER
* FT_FACE_FLAG_GLYPH_NAMES
* FT_FACE_FLAG_EXTERNAL_STREAM
* FT_FACE_FLAG_HINTER
* FT_FACE_FLAG_SVG
* FT_FACE_FLAG_SBIX
* FT_FACE_FLAG_SBIX_OVERLAY
*
* FT_HAS_HORIZONTAL
* FT_HAS_VERTICAL
@ -133,6 +164,9 @@ FT_BEGIN_HEADER
* FT_HAS_GLYPH_NAMES
* FT_HAS_COLOR
* FT_HAS_MULTIPLE_MASTERS
* FT_HAS_SVG
* FT_HAS_SBIX
* FT_HAS_SBIX_OVERLAY
*
* FT_IS_SFNT
* FT_IS_SCALABLE
@ -176,6 +210,7 @@ FT_BEGIN_HEADER
* FT_Size_RequestRec
* FT_Size_Request
* FT_Set_Transform
* FT_Get_Transform
* FT_Load_Glyph
* FT_Get_Char_Index
* FT_Get_First_Char
@ -196,6 +231,7 @@ FT_BEGIN_HEADER
* FT_LOAD_NO_SCALE
* FT_LOAD_NO_HINTING
* FT_LOAD_NO_BITMAP
* FT_LOAD_SBITS_ONLY
* FT_LOAD_NO_AUTOHINT
* FT_LOAD_COLOR
*
@ -493,13 +529,15 @@ FT_BEGIN_HEADER
* size.
*
* @note:
* An @FT_Face has one _active_ @FT_Size object that is used by functions
* like @FT_Load_Glyph to determine the scaling transformation that in
* turn is used to load and hint glyphs and metrics.
* An @FT_Face has one _active_ `FT_Size` object that is used by
* functions like @FT_Load_Glyph to determine the scaling transformation
* that in turn is used to load and hint glyphs and metrics.
*
* You can use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, @FT_Request_Size
* A newly created `FT_Size` object contains only meaningless zero values.
* You must use @FT_Set_Char_Size, @FT_Set_Pixel_Sizes, @FT_Request_Size
* or even @FT_Select_Size to change the content (i.e., the scaling
* values) of the active @FT_Size.
* values) of the active `FT_Size`. Otherwise, the scaling and hinting
* will not be performed.
*
* You can use @FT_New_Size to create additional size objects for a given
* @FT_Face, but they won't be used by other functions until you activate
@ -587,11 +625,12 @@ FT_BEGIN_HEADER
*/
#ifndef FT_ENC_TAG
#define FT_ENC_TAG( value, a, b, c, d ) \
value = ( ( (FT_UInt32)(a) << 24 ) | \
( (FT_UInt32)(b) << 16 ) | \
( (FT_UInt32)(c) << 8 ) | \
(FT_UInt32)(d) )
#define FT_ENC_TAG( value, a, b, c, d ) \
value = ( ( FT_STATIC_BYTE_CAST( FT_UInt32, a ) << 24 ) | \
( FT_STATIC_BYTE_CAST( FT_UInt32, b ) << 16 ) | \
( FT_STATIC_BYTE_CAST( FT_UInt32, c ) << 8 ) | \
FT_STATIC_BYTE_CAST( FT_UInt32, d ) )
#endif /* FT_ENC_TAG */
@ -701,11 +740,16 @@ FT_BEGIN_HEADER
* Same as FT_ENCODING_JOHAB. Deprecated.
*
* @note:
* By default, FreeType enables a Unicode charmap and tags it with
* `FT_ENCODING_UNICODE` when it is either provided or can be generated
* from PostScript glyph name dictionaries in the font file. All other
* encodings are considered legacy and tagged only if explicitly defined
* in the font file. Otherwise, `FT_ENCODING_NONE` is used.
* When loading a font, FreeType makes a Unicode charmap active if
* possible (either if the font provides such a charmap, or if FreeType
* can synthesize one from PostScript glyph name dictionaries; in either
* case, the charmap is tagged with `FT_ENCODING_UNICODE`). If such a
* charmap is synthesized, it is placed at the first position of the
* charmap array.
*
* All other encodings are considered legacy and tagged only if
* explicitly defined in the font file. Otherwise, `FT_ENCODING_NONE` is
* used.
*
* `FT_ENCODING_NONE` is set by the BDF and PCF drivers if the charmap is
* neither Unicode nor ISO-8859-1 (otherwise it is set to
@ -1193,6 +1237,19 @@ FT_BEGIN_HEADER
* altered with @FT_Set_MM_Design_Coordinates,
* @FT_Set_Var_Design_Coordinates, or @FT_Set_Var_Blend_Coordinates.
* This flag is unset by a call to @FT_Set_Named_Instance.
*
* FT_FACE_FLAG_SVG ::
* [Since 2.12] The face has an 'SVG~' OpenType table.
*
* FT_FACE_FLAG_SBIX ::
* [Since 2.12] The face has an 'sbix' OpenType table *and* outlines.
* For such fonts, @FT_FACE_FLAG_SCALABLE is not set by default to
* retain backward compatibility.
*
* FT_FACE_FLAG_SBIX_OVERLAY ::
* [Since 2.12] The face has an 'sbix' OpenType table where outlines
* should be drawn on top of bitmap strikes.
*
*/
#define FT_FACE_FLAG_SCALABLE ( 1L << 0 )
#define FT_FACE_FLAG_FIXED_SIZES ( 1L << 1 )
@ -1210,6 +1267,9 @@ FT_BEGIN_HEADER
#define FT_FACE_FLAG_TRICKY ( 1L << 13 )
#define FT_FACE_FLAG_COLOR ( 1L << 14 )
#define FT_FACE_FLAG_VARIATION ( 1L << 15 )
#define FT_FACE_FLAG_SVG ( 1L << 16 )
#define FT_FACE_FLAG_SBIX ( 1L << 17 )
#define FT_FACE_FLAG_SBIX_OVERLAY ( 1L << 18 )
/**************************************************************************
@ -1450,6 +1510,124 @@ FT_BEGIN_HEADER
( !!( (face)->face_flags & FT_FACE_FLAG_COLOR ) )
/**************************************************************************
*
* @macro:
* FT_HAS_SVG
*
* @description:
* A macro that returns true whenever a face object contains an 'SVG~'
* OpenType table.
*
* @since:
* 2.12
*/
#define FT_HAS_SVG( face ) \
( !!( (face)->face_flags & FT_FACE_FLAG_SVG ) )
/**************************************************************************
*
* @macro:
* FT_HAS_SBIX
*
* @description:
* A macro that returns true whenever a face object contains an 'sbix'
* OpenType table *and* outline glyphs.
*
* Currently, FreeType only supports bitmap glyphs in PNG format for this
* table (i.e., JPEG and TIFF formats are unsupported, as are
* Apple-specific formats not part of the OpenType specification).
*
* @note:
* For backward compatibility, a font with an 'sbix' table is treated as
* a bitmap-only face. Using @FT_Open_Face with
* @FT_PARAM_TAG_IGNORE_SBIX, an application can switch off 'sbix'
* handling so that the face is treated as an ordinary outline font with
* scalable outlines.
*
* Here is some pseudo code that roughly illustrates how to implement
* 'sbix' handling according to the OpenType specification.
*
* ```
* if ( FT_HAS_SBIX( face ) )
* {
* // open font as a scalable one without sbix handling
* FT_Face face2;
* FT_Parameter param = { FT_PARAM_TAG_IGNORE_SBIX, NULL };
* FT_Open_Args args = { FT_OPEN_PARAMS | ...,
* ...,
* 1, &param };
*
*
* FT_Open_Face( library, &args, 0, &face2 );
*
* <sort `face->available_size` as necessary into
* `preferred_sizes`[*]>
*
* for ( i = 0; i < face->num_fixed_sizes; i++ )
* {
* size = preferred_sizes[i].size;
*
* error = FT_Set_Pixel_Sizes( face, size, size );
* <error handling omitted>
*
* // check whether we have a glyph in a bitmap strike
* error = FT_Load_Glyph( face,
* glyph_index,
* FT_LOAD_SBITS_ONLY |
* FT_LOAD_BITMAP_METRICS_ONLY );
* if ( error == FT_Err_Invalid_Argument )
* continue;
* else if ( error )
* <other error handling omitted>
* else
* break;
* }
*
* if ( i != face->num_fixed_sizes )
* <load embedded bitmap with `FT_Load_Glyph`,
* scale it, display it, etc.>
*
* if ( i == face->num_fixed_sizes ||
* FT_HAS_SBIX_OVERLAY( face ) )
* <use `face2` to load outline glyph with `FT_Load_Glyph`,
* scale it, display it on top of the bitmap, etc.>
* }
* ```
*
* [*] Assuming a target value of 400dpi and available strike sizes 100,
* 200, 300, and 400dpi, a possible order might be [400, 200, 300, 100]:
* scaling 200dpi to 400dpi usually gives better results than scaling
* 300dpi to 400dpi; it is also much faster. However, scaling 100dpi to
* 400dpi can yield a too pixelated result, thus the preference might be
* 300dpi over 100dpi.
*
* @since:
* 2.12
*/
#define FT_HAS_SBIX( face ) \
( !!( (face)->face_flags & FT_FACE_FLAG_SBIX ) )
/**************************************************************************
*
* @macro:
* FT_HAS_SBIX_OVERLAY
*
* @description:
* A macro that returns true whenever a face object contains an 'sbix'
* OpenType table with bit~1 in its `flags` field set, instructing the
* application to overlay the bitmap strike with the corresponding
* outline glyph. See @FT_HAS_SBIX for pseudo code how to use it.
*
* @since:
* 2.12
*/
#define FT_HAS_SBIX_OVERLAY( face ) \
( !!( (face)->face_flags & FT_FACE_FLAG_SBIX_OVERLAY ) )
/**************************************************************************
*
* @enum:
@ -2065,7 +2243,8 @@ FT_BEGIN_HEADER
* The size in bytes of the file in memory.
*
* pathname ::
* A pointer to an 8-bit file pathname. The pointer is not owned by
* A pointer to an 8-bit file pathname, which must be a C~string (i.e.,
* no null bytes except at the very end). The pointer is not owned by
* FreeType.
*
* stream ::
@ -2084,8 +2263,7 @@ FT_BEGIN_HEADER
* Extra parameters passed to the font driver when opening a new face.
*
* @note:
* The stream type is determined by the contents of `flags` that are
* tested in the following order by @FT_Open_Face:
* The stream type is determined by the contents of `flags`:
*
* If the @FT_OPEN_MEMORY bit is set, assume that this is a memory file
* of `memory_size` bytes, located at `memory_address`. The data are not
@ -2098,6 +2276,9 @@ FT_BEGIN_HEADER
* Otherwise, if the @FT_OPEN_PATHNAME bit is set, assume that this is a
* normal file and use `pathname` to open it.
*
* If none of the above bits are set or if multiple are set at the same
* time, the flags are invalid and @FT_Open_Face fails.
*
* If the @FT_OPEN_DRIVER bit is set, @FT_Open_Face only tries to open
* the file with the driver whose handler is in `driver`.
*
@ -2150,6 +2331,13 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
* The `pathname` string should be recognizable as such by a standard
* `fopen` call on your system; in particular, this means that `pathname`
* must not contain null bytes. If that is not sufficient to address all
* file name possibilities (for example, to handle wide character file
* names on Windows in UTF-16 encoding) you might use @FT_Open_Face to
* pass a memory array or a stream object instead.
*
* Use @FT_Done_Face to destroy the created @FT_Face object (along with
* its slot and sizes).
*/
@ -2270,6 +2458,10 @@ FT_BEGIN_HEADER
* See the discussion of reference counters in the description of
* @FT_Reference_Face.
*
* If `FT_OPEN_STREAM` is set in `args->flags`, the stream in
* `args->stream` is automatically closed before this function returns
* any error (including `FT_Err_Invalid_Argument`).
*
* @example:
* To loop over all faces, use code similar to the following snippet
* (omitting the error handling).
@ -2428,6 +2620,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.4.2
*
*/
FT_EXPORT( FT_Error )
FT_Reference_Face( FT_Face face );
@ -2652,8 +2845,8 @@ FT_BEGIN_HEADER
* 'https://www.freetype.org/freetype2/docs/glyphs/glyphs-2.html'.
*
* Contrary to @FT_Set_Char_Size, this function doesn't have special code
* to normalize zero-valued widths, heights, or resolutions (which lead
* to errors in most cases).
* to normalize zero-valued widths, heights, or resolutions, which are
* treated as @FT_LOAD_NO_SCALE.
*
* Don't use this function if you are using the FreeType cache API.
*/
@ -2769,7 +2962,7 @@ FT_BEGIN_HEADER
*
* load_flags ::
* A flag indicating what to load for this glyph. The @FT_LOAD_XXX
* constants can be used to control the glyph loading process (e.g.,
* flags can be used to control the glyph loading process (e.g.,
* whether the outline should be scaled, whether to load bitmaps or
* not, whether to hint the outline, etc).
*
@ -2777,8 +2970,10 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
* The loaded glyph may be transformed. See @FT_Set_Transform for the
* details.
* For proper scaling and hinting, the active @FT_Size object owned by
* the face has to be meaningfully initialized by calling
* @FT_Set_Char_Size before this function, for example. The loaded
* glyph may be transformed. See @FT_Set_Transform for the details.
*
* For subsetted CID-keyed fonts, `FT_Err_Invalid_Argument` is returned
* for invalid CID values (this is, for CID values that don't have a
@ -2868,13 +3063,15 @@ FT_BEGIN_HEADER
*
* FT_LOAD_NO_SCALE ::
* Don't scale the loaded outline glyph but keep it in font units.
* This flag is also assumed if @FT_Size owned by the face was not
* properly initialized.
*
* This flag implies @FT_LOAD_NO_HINTING and @FT_LOAD_NO_BITMAP, and
* unsets @FT_LOAD_RENDER.
*
* If the font is 'tricky' (see @FT_FACE_FLAG_TRICKY for more), using
* `FT_LOAD_NO_SCALE` usually yields meaningless outlines because the
* subglyphs must be scaled and positioned with hinting instructions.
* subglyphs must be scaled and positioned with hinting instructions.
* This can be solved by loading the font without `FT_LOAD_NO_SCALE`
* and setting the character size to `font->units_per_EM`.
*
@ -2898,6 +3095,15 @@ FT_BEGIN_HEADER
*
* @FT_LOAD_NO_SCALE always sets this flag.
*
* FT_LOAD_SBITS_ONLY ::
* [Since 2.12] This is the opposite of @FT_LOAD_NO_BITMAP, more or
* less: @FT_Load_Glyph returns `FT_Err_Invalid_Argument` if the face
* contains a bitmap strike for the given size (or the strike selected
* by @FT_Select_Size) but there is no glyph in the strike.
*
* Note that this load flag was part of FreeType since version 2.0.6
* but previously tagged as internal.
*
* FT_LOAD_VERTICAL_LAYOUT ::
* Load the glyph for vertical text layout. In particular, the
* `advance` value in the @FT_GlyphSlotRec structure is set to the
@ -2954,21 +3160,31 @@ FT_BEGIN_HEADER
* Disable the auto-hinter. See also the note below.
*
* FT_LOAD_COLOR ::
* Load colored glyphs. There are slight differences depending on the
* font format.
* Load colored glyphs. FreeType searches in the following order;
* there are slight differences depending on the font format.
*
* [Since 2.5] Load embedded color bitmap images. The resulting color
* bitmaps, if available, will have the @FT_PIXEL_MODE_BGRA format,
* with pre-multiplied color channels. If the flag is not set and
* color bitmaps are found, they are converted to 256-level gray
* bitmaps, using the @FT_PIXEL_MODE_GRAY format.
* [Since 2.5] Load embedded color bitmap images (provided
* @FT_LOAD_NO_BITMAP is not set). The resulting color bitmaps, if
* available, have the @FT_PIXEL_MODE_BGRA format, with pre-multiplied
* color channels. If the flag is not set and color bitmaps are found,
* they are converted to 256-level gray bitmaps, using the
* @FT_PIXEL_MODE_GRAY format.
*
* [Since 2.10, experimental] If the glyph index contains an entry in
* [Since 2.12] If the glyph index maps to an entry in the face's
* 'SVG~' table, load the associated SVG document from this table and
* set the `format` field of @FT_GlyphSlotRec to @FT_GLYPH_FORMAT_SVG.
* Note that FreeType itself can't render SVG documents; however, the
* library provides hooks to seamlessly integrate an external renderer.
* See sections @ot_svg_driver and @svg_fonts for more.
*
* [Since 2.10, experimental] If the glyph index maps to an entry in
* the face's 'COLR' table with a 'CPAL' palette table (as defined in
* the OpenType specification), make @FT_Render_Glyph provide a default
* blending of the color glyph layers associated with the glyph index,
* using the same bitmap format as embedded color bitmap images. This
* is mainly for convenience; for full control of color layers use
* is mainly for convenience and works only for glyphs in 'COLR' v0
* tables (or glyphs in 'COLR' v1 tables that exclusively use v0
* features). For full control of color layers use
* @FT_Get_Color_Glyph_Layer and FreeType's color functions like
* @FT_Palette_Select instead of setting @FT_LOAD_COLOR for rendering
* so that the client application can handle blending by itself.
@ -3019,19 +3235,20 @@ FT_BEGIN_HEADER
*
*/
#define FT_LOAD_DEFAULT 0x0
#define FT_LOAD_NO_SCALE ( 1L << 0 )
#define FT_LOAD_NO_HINTING ( 1L << 1 )
#define FT_LOAD_RENDER ( 1L << 2 )
#define FT_LOAD_NO_BITMAP ( 1L << 3 )
#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
#define FT_LOAD_PEDANTIC ( 1L << 7 )
#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
#define FT_LOAD_NO_SCALE ( 1L << 0 )
#define FT_LOAD_NO_HINTING ( 1L << 1 )
#define FT_LOAD_RENDER ( 1L << 2 )
#define FT_LOAD_NO_BITMAP ( 1L << 3 )
#define FT_LOAD_VERTICAL_LAYOUT ( 1L << 4 )
#define FT_LOAD_FORCE_AUTOHINT ( 1L << 5 )
#define FT_LOAD_CROP_BITMAP ( 1L << 6 )
#define FT_LOAD_PEDANTIC ( 1L << 7 )
#define FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ( 1L << 9 )
#define FT_LOAD_NO_RECURSE ( 1L << 10 )
#define FT_LOAD_IGNORE_TRANSFORM ( 1L << 11 )
#define FT_LOAD_MONOCHROME ( 1L << 12 )
#define FT_LOAD_LINEAR_DESIGN ( 1L << 13 )
#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
#define FT_LOAD_NO_AUTOHINT ( 1L << 15 )
/* Bits 16-19 are used by `FT_LOAD_TARGET_` */
#define FT_LOAD_COLOR ( 1L << 20 )
@ -3041,8 +3258,8 @@ FT_BEGIN_HEADER
/* */
/* used internally only by certain font drivers */
#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
#define FT_LOAD_SBITS_ONLY ( 1L << 14 )
#define FT_LOAD_ADVANCE_ONLY ( 1L << 8 )
#define FT_LOAD_SVG_ONLY ( 1L << 23 )
/**************************************************************************
@ -3132,7 +3349,7 @@ FT_BEGIN_HEADER
* necessary to empty the cache after a mode switch to avoid false hits.
*
*/
#define FT_LOAD_TARGET_( x ) ( (FT_Int32)( (x) & 15 ) << 16 )
#define FT_LOAD_TARGET_( x ) ( FT_STATIC_CAST( FT_Int32, (x) & 15 ) << 16 )
#define FT_LOAD_TARGET_NORMAL FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
#define FT_LOAD_TARGET_LIGHT FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT )
@ -3151,7 +3368,8 @@ FT_BEGIN_HEADER
* @FT_LOAD_TARGET_XXX value.
*
*/
#define FT_LOAD_TARGET_MODE( x ) ( (FT_Render_Mode)( ( (x) >> 16 ) & 15 ) )
#define FT_LOAD_TARGET_MODE( x ) \
FT_STATIC_CAST( FT_Render_Mode, ( (x) >> 16 ) & 15 )
/**************************************************************************
@ -3172,11 +3390,12 @@ FT_BEGIN_HEADER
* A pointer to the transformation's 2x2 matrix. Use `NULL` for the
* identity matrix.
* delta ::
* A pointer to the translation vector. Use `NULL` for the null vector.
* A pointer to the translation vector. Use `NULL` for the null
* vector.
*
* @note:
* This function is provided as a convenience, but keep in mind that
* @FT_Matrix coefficients are only 16.16 fixed point values, which can
* @FT_Matrix coefficients are only 16.16 fixed-point values, which can
* limit the accuracy of the results. Using floating-point computations
* to perform the transform directly in client code instead will always
* yield better numbers.
@ -3195,6 +3414,39 @@ FT_BEGIN_HEADER
FT_Vector* delta );
/**************************************************************************
*
* @function:
* FT_Get_Transform
*
* @description:
* Return the transformation that is applied to glyph images when they
* are loaded into a glyph slot through @FT_Load_Glyph. See
* @FT_Set_Transform for more details.
*
* @input:
* face ::
* A handle to the source face object.
*
* @output:
* matrix ::
* A pointer to a transformation's 2x2 matrix. Set this to NULL if you
* are not interested in the value.
*
* delta ::
* A pointer a translation vector. Set this to NULL if you are not
* interested in the value.
*
* @since:
* 2.11
*
*/
FT_EXPORT( void )
FT_Get_Transform( FT_Face face,
FT_Matrix* matrix,
FT_Vector* delta );
/**************************************************************************
*
* @enum:
@ -3213,6 +3465,10 @@ FT_BEGIN_HEADER
* correction to correctly render non-monochrome glyph bitmaps onto a
* surface; see @FT_Render_Glyph.
*
* The @FT_RENDER_MODE_SDF is a special render mode that uses up to 256
* distance values, indicating the signed distance from the grid position
* to the nearest outline.
*
* @values:
* FT_RENDER_MODE_NORMAL ::
* Default render mode; it corresponds to 8-bit anti-aliased bitmaps.
@ -3238,11 +3494,87 @@ FT_BEGIN_HEADER
* bitmaps that are 3~times the height of the original glyph outline in
* pixels and use the @FT_PIXEL_MODE_LCD_V mode.
*
* FT_RENDER_MODE_SDF ::
* This mode corresponds to 8-bit, single-channel signed distance field
* (SDF) bitmaps. Each pixel in the SDF grid is the value from the
* pixel's position to the nearest glyph's outline. The distances are
* calculated from the center of the pixel and are positive if they are
* filled by the outline (i.e., inside the outline) and negative
* otherwise. Check the note below on how to convert the output values
* to usable data.
*
* @note:
* The selected render mode only affects vector glyphs of a font.
* Embedded bitmaps often have a different pixel mode like
* @FT_PIXEL_MODE_MONO. You can use @FT_Bitmap_Convert to transform them
* into 8-bit pixmaps.
*
* For @FT_RENDER_MODE_SDF the output bitmap buffer contains normalized
* distances that are packed into unsigned 8-bit values. To get pixel
* values in floating point representation use the following pseudo-C
* code for the conversion.
*
* ```
* // Load glyph and render using FT_RENDER_MODE_SDF,
* // then use the output buffer as follows.
*
* ...
* FT_Byte buffer = glyph->bitmap->buffer;
*
*
* for pixel in buffer
* {
* // `sd` is the signed distance and `spread` is the current spread;
* // the default spread is 2 and can be changed.
*
* float sd = (float)pixel - 128.0f;
*
*
* // Convert to pixel values.
* sd = ( sd / 128.0f ) * spread;
*
* // Store `sd` in a buffer or use as required.
* }
*
* ```
*
* FreeType has two rasterizers for generating SDF, namely:
*
* 1. `sdf` for generating SDF directly from glyph's outline, and
*
* 2. `bsdf` for generating SDF from rasterized bitmaps.
*
* Depending on the glyph type (i.e., outline or bitmap), one of the two
* rasterizers is chosen at runtime and used for generating SDFs. To
* force the use of `bsdf` you should render the glyph with any of the
* FreeType's other rendering modes (e.g., `FT_RENDER_MODE_NORMAL`) and
* then re-render with `FT_RENDER_MODE_SDF`.
*
* There are some issues with stability and possible failures of the SDF
* renderers (specifically `sdf`).
*
* 1. The `sdf` rasterizer is sensitive to really small features (e.g.,
* sharp turns that are less than 1~pixel) and imperfections in the
* glyph's outline, causing artifacts in the final output.
*
* 2. The `sdf` rasterizer has limited support for handling intersecting
* contours and *cannot* handle self-intersecting contours whatsoever.
* Self-intersection happens when a single connected contour intersect
* itself at some point; having these in your font definitely pose a
* problem to the rasterizer and cause artifacts, too.
*
* 3. Generating SDF for really small glyphs may result in undesirable
* output; the pixel grid (which stores distance information) becomes
* too coarse.
*
* 4. Since the output buffer is normalized, precision at smaller spreads
* is greater than precision at larger spread values because the
* output range of [0..255] gets mapped to a smaller SDF range. A
* spread of~2 should be sufficient in most cases.
*
* Points (1) and (2) can be avoided by using the `bsdf` rasterizer,
* which is more stable than the `sdf` rasterizer in general.
*
*/
typedef enum FT_Render_Mode_
{
@ -3251,6 +3583,7 @@ FT_BEGIN_HEADER
FT_RENDER_MODE_MONO,
FT_RENDER_MODE_LCD,
FT_RENDER_MODE_LCD_V,
FT_RENDER_MODE_SDF,
FT_RENDER_MODE_MAX
@ -3282,7 +3615,7 @@ FT_BEGIN_HEADER
* @FT_Render_Mode for a list of possible values.
*
* If @FT_RENDER_MODE_NORMAL is used, a previous call of @FT_Load_Glyph
* with flag @FT_LOAD_COLOR makes FT_Render_Glyph provide a default
* with flag @FT_LOAD_COLOR makes `FT_Render_Glyph` provide a default
* blending of colored glyph layers associated with the current glyph
* slot (provided the font contains such layers) instead of rendering
* the glyph slot's outline. This is an experimental feature; see
@ -3292,9 +3625,6 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
* To get meaningful results, font scaling values must be set with
* functions like @FT_Set_Char_Size before calling `FT_Render_Glyph`.
*
* When FreeType outputs a bitmap of a glyph, it really outputs an alpha
* coverage map. If a pixel is completely covered by a filled-in
* outline, the bitmap contains 0xFF at that pixel, meaning that
@ -3338,7 +3668,8 @@ FT_BEGIN_HEADER
*
* which is known as the OVER operator.
*
* To correctly composite an antialiased pixel of a glyph onto a surface,
* To correctly composite an anti-aliased pixel of a glyph onto a
* surface,
*
* 1. take the foreground and background colors (e.g., in sRGB space)
* and apply gamma to get them in a linear space,
@ -4015,168 +4346,6 @@ FT_BEGIN_HEADER
FT_Matrix *p_transform );
/**************************************************************************
*
* @section:
* layer_management
*
* @title:
* Glyph Layer Management
*
* @abstract:
* Retrieving and manipulating OpenType's 'COLR' table data.
*
* @description:
* The functions described here allow access of colored glyph layer data
* in OpenType's 'COLR' tables.
*/
/**************************************************************************
*
* @struct:
* FT_LayerIterator
*
* @description:
* This iterator object is needed for @FT_Get_Color_Glyph_Layer.
*
* @fields:
* num_layers ::
* The number of glyph layers for the requested glyph index. Will be
* set by @FT_Get_Color_Glyph_Layer.
*
* layer ::
* The current layer. Will be set by @FT_Get_Color_Glyph_Layer.
*
* p ::
* An opaque pointer into 'COLR' table data. The caller must set this
* to `NULL` before the first call of @FT_Get_Color_Glyph_Layer.
*/
typedef struct FT_LayerIterator_
{
FT_UInt num_layers;
FT_UInt layer;
FT_Byte* p;
} FT_LayerIterator;
/**************************************************************************
*
* @function:
* FT_Get_Color_Glyph_Layer
*
* @description:
* This is an interface to the 'COLR' table in OpenType fonts to
* iteratively retrieve the colored glyph layers associated with the
* current glyph slot.
*
* https://docs.microsoft.com/en-us/typography/opentype/spec/colr
*
* The glyph layer data for a given glyph index, if present, provides an
* alternative, multi-color glyph representation: Instead of rendering
* the outline or bitmap with the given glyph index, glyphs with the
* indices and colors returned by this function are rendered layer by
* layer.
*
* The returned elements are ordered in the z~direction from bottom to
* top; the 'n'th element should be rendered with the associated palette
* color and blended on top of the already rendered layers (elements 0,
* 1, ..., n-1).
*
* @input:
* face ::
* A handle to the parent face object.
*
* base_glyph ::
* The glyph index the colored glyph layers are associated with.
*
* @inout:
* iterator ::
* An @FT_LayerIterator object. For the first call you should set
* `iterator->p` to `NULL`. For all following calls, simply use the
* same object again.
*
* @output:
* aglyph_index ::
* The glyph index of the current layer.
*
* acolor_index ::
* The color index into the font face's color palette of the current
* layer. The value 0xFFFF is special; it doesn't reference a palette
* entry but indicates that the text foreground color should be used
* instead (to be set up by the application outside of FreeType).
*
* The color palette can be retrieved with @FT_Palette_Select.
*
* @return:
* Value~1 if everything is OK. If there are no more layers (or if there
* are no layers at all), value~0 gets returned. In case of an error,
* value~0 is returned also.
*
* @note:
* This function is necessary if you want to handle glyph layers by
* yourself. In particular, functions that operate with @FT_GlyphRec
* objects (like @FT_Get_Glyph or @FT_Glyph_To_Bitmap) don't have access
* to this information.
*
* Note that @FT_Render_Glyph is able to handle colored glyph layers
* automatically if the @FT_LOAD_COLOR flag is passed to a previous call
* to @FT_Load_Glyph. [This is an experimental feature.]
*
* @example:
* ```
* FT_Color* palette;
* FT_LayerIterator iterator;
*
* FT_Bool have_layers;
* FT_UInt layer_glyph_index;
* FT_UInt layer_color_index;
*
*
* error = FT_Palette_Select( face, palette_index, &palette );
* if ( error )
* palette = NULL;
*
* iterator.p = NULL;
* have_layers = FT_Get_Color_Glyph_Layer( face,
* glyph_index,
* &layer_glyph_index,
* &layer_color_index,
* &iterator );
*
* if ( palette && have_layers )
* {
* do
* {
* FT_Color layer_color;
*
*
* if ( layer_color_index == 0xFFFF )
* layer_color = text_foreground_color;
* else
* layer_color = palette[layer_color_index];
*
* // Load and render glyph `layer_glyph_index', then
* // blend resulting pixmap (using color `layer_color')
* // with previously created pixmaps.
*
* } while ( FT_Get_Color_Glyph_Layer( face,
* glyph_index,
* &layer_glyph_index,
* &layer_color_index,
* &iterator ) );
* }
* ```
*/
FT_EXPORT( FT_Bool )
FT_Get_Color_Glyph_Layer( FT_Face face,
FT_UInt base_glyph,
FT_UInt *aglyph_index,
FT_UInt *acolor_index,
FT_LayerIterator* iterator );
/**************************************************************************
*
* @section:
@ -4267,6 +4436,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.8
*
*/
FT_EXPORT( FT_UShort )
FT_Get_FSType_Flags( FT_Face face );
@ -4360,6 +4530,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
*
*/
FT_EXPORT( FT_UInt )
FT_Face_GetCharVariantIndex( FT_Face face,
@ -4396,6 +4567,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
*
*/
FT_EXPORT( FT_Int )
FT_Face_GetCharVariantIsDefault( FT_Face face,
@ -4427,6 +4599,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
*
*/
FT_EXPORT( FT_UInt32* )
FT_Face_GetVariantSelectors( FT_Face face );
@ -4460,6 +4633,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
*
*/
FT_EXPORT( FT_UInt32* )
FT_Face_GetVariantsOfChar( FT_Face face,
@ -4494,6 +4668,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.6
*
*/
FT_EXPORT( FT_UInt32* )
FT_Face_GetCharsOfVariant( FT_Face face,
@ -4766,8 +4941,8 @@ FT_BEGIN_HEADER
*
*/
#define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 10
#define FREETYPE_PATCH 4
#define FREETYPE_MINOR 12
#define FREETYPE_PATCH 1
/**************************************************************************
@ -4829,6 +5004,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.5
*
*/
FT_EXPORT( FT_Bool )
FT_Face_CheckTrueTypePatents( FT_Face face );
@ -4857,6 +5033,7 @@ FT_BEGIN_HEADER
*
* @since:
* 2.3.5
*
*/
FT_EXPORT( FT_Bool )
FT_Face_SetUnpatentedHinting( FT_Face face,

View File

@ -4,7 +4,7 @@
*
* Quick computation of advance widths (specification only).
*
* Copyright (C) 2008-2020 by
* Copyright (C) 2008-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

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

View File

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

View File

@ -4,7 +4,7 @@
*
* FreeType utility functions for bitmaps (specification).
*
* Copyright (C) 2004-2020 by
* Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* Bzip2-compressed stream support.
*
* Copyright (C) 2010-2020 by
* Copyright (C) 2010-2022 by
* Joel Klinghed.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* FreeType Cache subsystem (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -86,8 +86,8 @@ FT_BEGIN_HEADER
* later use @FTC_CMapCache_Lookup to perform the equivalent of
* @FT_Get_Char_Index, only much faster.
*
* If you want to use the @FT_Glyph caching, call @FTC_ImageCache, then
* later use @FTC_ImageCache_Lookup to retrieve the corresponding
* If you want to use the @FT_Glyph caching, call @FTC_ImageCache_New,
* then later use @FTC_ImageCache_Lookup to retrieve the corresponding
* @FT_Glyph objects from the cache.
*
* If you need lots of small bitmaps, it is much more memory efficient to

View File

@ -15,6 +15,7 @@
* General Remarks
*
* @sections:
* preamble
* header_inclusion
* user_allocation
*
@ -61,6 +62,7 @@
* cid_fonts
* pfr_fonts
* winfnt_fonts
* svg_fonts
* font_formats
* gasp_table
*
@ -81,6 +83,7 @@
* t1_cid_driver
* tt_driver
* pcf_driver
* ot_svg_driver
* properties
* parameter_tags
* lcd_rendering
@ -123,6 +126,7 @@
* gzip
* lzw
* bzip2
* debugging_apis
*
*/

View File

@ -4,7 +4,7 @@
*
* FreeType API for accessing CID font information (specification).
*
* Copyright (C) 2007-2020 by
* Copyright (C) 2007-2022 by
* Dereg Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,

File diff suppressed because it is too large Load Diff

View File

@ -4,7 +4,7 @@
*
* FreeType API for controlling driver modules (specification only).
*
* Copyright (C) 2017-2020 by
* Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -53,10 +53,10 @@ FT_BEGIN_HEADER
* reasons.
*
* Available properties are @increase-x-height, @no-stem-darkening
* (experimental), @darkening-parameters (experimental), @warping
* (experimental), @glyph-to-script-map (experimental), @fallback-script
* (experimental), and @default-script (experimental), as documented in
* the @properties section.
* (experimental), @darkening-parameters (experimental),
* @glyph-to-script-map (experimental), @fallback-script (experimental),
* and @default-script (experimental), as documented in the @properties
* section.
*
*/
@ -84,15 +84,15 @@ FT_BEGIN_HEADER
* @properties section.
*
*
* **Hinting and antialiasing principles of the new engine**
* **Hinting and anti-aliasing principles of the new engine**
*
* The rasterizer is positioning horizontal features (e.g., ascender
* height & x-height, or crossbars) on the pixel grid and minimizing the
* amount of antialiasing applied to them, while placing vertical
* amount of anti-aliasing applied to them, while placing vertical
* features (vertical stems) on the pixel grid without hinting, thus
* representing the stem position and weight accurately. Sometimes the
* vertical stems may be only partially black. In this context,
* 'antialiasing' means that stems are not positioned exactly on pixel
* 'anti-aliasing' means that stems are not positioned exactly on pixel
* borders, causing a fuzzy appearance.
*
* There are two principles behind this approach.
@ -108,7 +108,7 @@ FT_BEGIN_HEADER
* sizes are comparable to kerning values and thus would be noticeable
* (and distracting) while reading if hinting were applied.
*
* One of the reasons to not hint horizontally is antialiasing for LCD
* One of the reasons to not hint horizontally is anti-aliasing for LCD
* screens: The pixel geometry of modern displays supplies three vertical
* subpixels as the eye moves horizontally across each visible pixel. On
* devices where we can be certain this characteristic is present a
@ -116,7 +116,7 @@ FT_BEGIN_HEADER
* weight. In Western writing systems this turns out to be the more
* critical direction anyway; the weights and spacing of vertical stems
* (see above) are central to Armenian, Cyrillic, Greek, and Latin type
* designs. Even when the rasterizer uses greyscale antialiasing instead
* designs. Even when the rasterizer uses greyscale anti-aliasing instead
* of color (a necessary compromise when one doesn't know the screen
* characteristics), the unhinted vertical features preserve the design's
* weight and spacing much better than aliased type would.
@ -212,16 +212,14 @@ FT_BEGIN_HEADER
* @description:
* While FreeType's TrueType driver doesn't expose API functions by
* itself, it is possible to control its behaviour with @FT_Property_Set
* and @FT_Property_Get. The following lists the available properties
* together with the necessary macros and structures.
* and @FT_Property_Get.
*
* The TrueType driver's module name is 'truetype'.
* The TrueType driver's module name is 'truetype'; a single property
* @interpreter-version is available, as documented in the @properties
* section.
*
* A single property @interpreter-version is available, as documented in
* the @properties section.
*
* We start with a list of definitions, kindly provided by Greg
* Hitchcock.
* To help understand the differences between interpreter versions, we
* introduce a list of definitions, kindly provided by Greg Hitchcock.
*
* _Bi-Level Rendering_
*
@ -300,6 +298,31 @@ FT_BEGIN_HEADER
*/
/**************************************************************************
*
* @section:
* ot_svg_driver
*
* @title:
* The SVG driver
*
* @abstract:
* Controlling the external rendering of OT-SVG glyphs.
*
* @description:
* By default, FreeType can only load the 'SVG~' table of OpenType fonts
* if configuration macro `FT_CONFIG_OPTION_SVG` is defined. To make it
* render SVG glyphs, an external SVG rendering library is needed. All
* details on the interface between FreeType and the external library
* via function hooks can be found in section @svg_fonts.
*
* The OT-SVG driver's module name is 'ot-svg'; it supports a single
* property called @svg-hooks, documented below in the @properties
* section.
*
*/
/**************************************************************************
*
* @section:
@ -362,12 +385,8 @@ FT_BEGIN_HEADER
* The same holds for the Type~1 and CID modules if compiled with
* `T1_CONFIG_OPTION_OLD_ENGINE`.
*
* For the 'cff' module, the default engine is 'freetype' if
* `CFF_CONFIG_OPTION_OLD_ENGINE` is defined, and 'adobe' otherwise.
*
* For both the 'type1' and 't1cid' modules, the default engine is
* 'freetype' if `T1_CONFIG_OPTION_OLD_ENGINE` is defined, and 'adobe'
* otherwise.
* For the 'cff' module, the default engine is 'adobe'. For both the
* 'type1' and 't1cid' modules, the default engine is 'adobe', too.
*
* @note:
* This property can be used with @FT_Property_Get also.
@ -802,6 +821,40 @@ FT_BEGIN_HEADER
*/
/**************************************************************************
*
* @property:
* svg-hooks
*
* @description:
* Set up the interface between FreeType and an extern SVG rendering
* library like 'librsvg'. All details on the function hooks can be
* found in section @svg_fonts.
*
* @example:
* The following example code expects that the four hook functions
* `svg_*` are defined elsewhere. Error handling is omitted, too.
*
* ```
* FT_Library library;
* SVG_RendererHooks hooks = {
* (SVG_Lib_Init_Func)svg_init,
* (SVG_Lib_Free_Func)svg_free,
* (SVG_Lib_Render_Func)svg_render,
* (SVG_Lib_Preset_Slot_Func)svg_preset_slot };
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "ot-svg",
* "svg-hooks", &hooks );
* ```
*
* @since:
* 2.12
*/
/**************************************************************************
*
* @property:
@ -1166,48 +1219,18 @@ FT_BEGIN_HEADER
* warping
*
* @description:
* **Experimental only**
* **Obsolete**
*
* If FreeType gets compiled with option `AF_CONFIG_OPTION_USE_WARPER` to
* activate the warp hinting code in the auto-hinter, this property
* switches warping on and off.
* This property was always experimental and probably never worked
* correctly. It was entirely removed from the FreeType~2 sources. This
* entry is only here for historical reference.
*
* Warping only works in 'normal' auto-hinting mode replacing it. The
* idea of the code is to slightly scale and shift a glyph along the
* Warping only worked in 'normal' auto-hinting mode replacing it. The
* idea of the code was to slightly scale and shift a glyph along the
* non-hinted dimension (which is usually the horizontal axis) so that as
* much of its segments are aligned (more or less) to the grid. To find
* much of its segments were aligned (more or less) to the grid. To find
* out a glyph's optimal scaling and shifting value, various parameter
* combinations are tried and scored.
*
* By default, warping is off.
*
* @note:
* This property can be used with @FT_Property_Get also.
*
* This property can be set via the `FREETYPE_PROPERTIES` environment
* variable (using values 1 and 0 for 'on' and 'off', respectively).
*
* The warping code can also change advance widths. Have a look at the
* `lsb_delta` and `rsb_delta` fields in the @FT_GlyphSlotRec structure
* for details on improving inter-glyph distances while rendering.
*
* Since warping is a global property of the auto-hinter it is best to
* change its value before rendering any face. Otherwise, you should
* reload all faces that get auto-hinted in 'normal' hinting mode.
*
* @example:
* This example shows how to switch on warping (omitting the error
* handling).
*
* ```
* FT_Library library;
* FT_Bool warping = 1;
*
*
* FT_Init_FreeType( &library );
*
* FT_Property_Set( library, "autofitter", "warping", &warping );
* ```
* combinations were tried and scored.
*
* @since:
* 2.6

View File

@ -4,7 +4,7 @@
*
* FreeType error codes (specification).
*
* Copyright (C) 2002-2020 by
* Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -101,6 +101,8 @@
"too many hints" )
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
"invalid pixel size" )
FT_ERRORDEF_( Invalid_SVG_Document, 0x18,
"invalid SVG document" )
/* handle errors */
@ -234,6 +236,8 @@
"found FDEF or IDEF opcode in glyf bytecode" )
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
"missing bitmap in strike" )
FT_ERRORDEF_( Missing_SVG_Hooks, 0x9E,
"SVG hooks have not been set" )
/* CFF, CID, and Type 1 errors */

View File

@ -4,7 +4,7 @@
*
* FreeType error code handling (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -281,6 +281,8 @@ FT_BEGIN_HEADER
FT_EXPORT( const char* )
FT_Error_String( FT_Error error_code );
/* */
FT_END_HEADER

View File

@ -4,7 +4,7 @@
*
* Support functions for font formats.
*
* Copyright (C) 2002-2020 by
* Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* Access of TrueType's 'gasp' table (specification).
*
* Copyright (C) 2007-2020 by
* Copyright (C) 2007-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* FreeType convenience functions to handle glyphs (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -126,7 +126,7 @@ FT_BEGIN_HEADER
*
* @description:
* A handle to an object used to model a bitmap glyph image. This is a
* sub-class of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.
* 'sub-class' of @FT_Glyph, and a pointer to @FT_BitmapGlyphRec.
*/
typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
@ -142,7 +142,7 @@ FT_BEGIN_HEADER
*
* @fields:
* root ::
* The root @FT_Glyph fields.
* The root fields of @FT_Glyph.
*
* left ::
* The left-side bearing, i.e., the horizontal distance from the
@ -181,7 +181,7 @@ FT_BEGIN_HEADER
*
* @description:
* A handle to an object used to model an outline glyph image. This is a
* sub-class of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec.
* 'sub-class' of @FT_Glyph, and a pointer to @FT_OutlineGlyphRec.
*/
typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
@ -222,6 +222,92 @@ FT_BEGIN_HEADER
} FT_OutlineGlyphRec;
/**************************************************************************
*
* @type:
* FT_SvgGlyph
*
* @description:
* A handle to an object used to model an SVG glyph. This is a
* 'sub-class' of @FT_Glyph, and a pointer to @FT_SvgGlyphRec.
*
* @since:
* 2.12
*/
typedef struct FT_SvgGlyphRec_* FT_SvgGlyph;
/**************************************************************************
*
* @struct:
* FT_SvgGlyphRec
*
* @description:
* A structure used for OT-SVG glyphs. This is a 'sub-class' of
* @FT_GlyphRec.
*
* @fields:
* root ::
* The root @FT_GlyphRec fields.
*
* svg_document ::
* A pointer to the SVG document.
*
* svg_document_length ::
* The length of `svg_document`.
*
* glyph_index ::
* The index of the glyph to be rendered.
*
* metrics ::
* A metrics object storing the size information.
*
* units_per_EM ::
* The size of the EM square.
*
* start_glyph_id ::
* The first glyph ID in the glyph range covered by this document.
*
* end_glyph_id ::
* The last glyph ID in the glyph range covered by this document.
*
* transform ::
* A 2x2 transformation matrix to apply to the glyph while rendering
* it.
*
* delta ::
* Translation to apply to the glyph while rendering.
*
* @note:
* The Glyph Management API requires @FT_Glyph or its 'sub-class' to have
* all the information needed to completely define the glyph's rendering.
* Outline-based glyphs can directly apply transformations to the outline
* but this is not possible for an SVG document that hasn't been parsed.
* Therefore, the transformation is stored along with the document. In
* the absence of a 'ViewBox' or 'Width'/'Height' attribute, the size of
* the ViewPort should be assumed to be 'units_per_EM'.
*/
typedef struct FT_SvgGlyphRec_
{
FT_GlyphRec root;
FT_Byte* svg_document;
FT_ULong svg_document_length;
FT_UInt glyph_index;
FT_Size_Metrics metrics;
FT_UShort units_per_EM;
FT_UShort start_glyph_id;
FT_UShort end_glyph_id;
FT_Matrix transform;
FT_Vector delta;
} FT_SvgGlyphRec;
/**************************************************************************
*
* @function:
@ -337,9 +423,9 @@ FT_BEGIN_HEADER
* vector.
*/
FT_EXPORT( FT_Error )
FT_Glyph_Transform( FT_Glyph glyph,
FT_Matrix* matrix,
FT_Vector* delta );
FT_Glyph_Transform( FT_Glyph glyph,
const FT_Matrix* matrix,
const FT_Vector* delta );
/**************************************************************************
@ -498,9 +584,9 @@ FT_BEGIN_HEADER
* The glyph image is translated with the `origin` vector before
* rendering.
*
* The first parameter is a pointer to an @FT_Glyph handle, that will be
* The first parameter is a pointer to an @FT_Glyph handle that will be
* _replaced_ by this function (with newly allocated data). Typically,
* you would use (omitting error handling):
* you would do something like the following (omitting error handling).
*
* ```
* FT_Glyph glyph;
@ -517,7 +603,7 @@ FT_BEGIN_HEADER
* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )
* {
* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,
* 0, 1 );
* 0, 1 );
* if ( error ) // `glyph' unchanged
* ...
* }
@ -532,7 +618,7 @@ FT_BEGIN_HEADER
* FT_Done_Glyph( glyph );
* ```
*
* Here is another example, again without error handling:
* Here is another example, again without error handling.
*
* ```
* FT_Glyph glyphs[MAX_GLYPHS]
@ -569,10 +655,10 @@ FT_BEGIN_HEADER
* ```
*/
FT_EXPORT( FT_Error )
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
FT_Render_Mode render_mode,
FT_Vector* origin,
FT_Bool destroy );
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
FT_Render_Mode render_mode,
const FT_Vector* origin,
FT_Bool destroy );
/**************************************************************************

View File

@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
* Copyright (C) 2004-2020 by
* Copyright (C) 2004-2022 by
* Masatake YAMATO, Redhat K.K,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*

View File

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

View File

@ -5,7 +5,7 @@
* FreeType glyph image formats and default raster interface
* (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -28,11 +28,6 @@
#define FTIMAGE_H_
/* STANDALONE_ is from ftgrays.c */
#ifndef STANDALONE_
#endif
FT_BEGIN_HEADER
@ -201,6 +196,11 @@ FT_BEGIN_HEADER
#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
/* */
/* For debugging, the @FT_Pixel_Mode enumeration must stay in sync */
/* with the `pixel_modes` array in file `ftobjs.c`. */
/**************************************************************************
*
@ -401,11 +401,11 @@ FT_BEGIN_HEADER
* information.
*
* FT_OUTLINE_OVERLAP ::
* This flag indicates that this outline contains overlapping contrours
* and the anti-aliased renderer should perform oversampling to
* mitigate possible artifacts. This flag should _not_ be set for
* well designed glyphs without overlaps because it quadruples the
* rendering time.
* [Since 2.10.3] This flag indicates that this outline contains
* overlapping contours and the anti-aliased renderer should perform
* oversampling to mitigate possible artifacts. This flag should _not_
* be set for well designed glyphs without overlaps because it quadruples
* the rendering time.
*
* FT_OUTLINE_HIGH_PRECISION ::
* This flag indicates that the scan-line converter should try to
@ -695,11 +695,13 @@ FT_BEGIN_HEADER
* to get a simple enumeration without assigning special numbers.
*/
#ifndef FT_IMAGE_TAG
#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
value = ( ( (unsigned long)_x1 << 24 ) | \
( (unsigned long)_x2 << 16 ) | \
( (unsigned long)_x3 << 8 ) | \
(unsigned long)_x4 )
#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
value = ( ( FT_STATIC_BYTE_CAST( unsigned long, _x1 ) << 24 ) | \
( FT_STATIC_BYTE_CAST( unsigned long, _x2 ) << 16 ) | \
( FT_STATIC_BYTE_CAST( unsigned long, _x3 ) << 8 ) | \
FT_STATIC_BYTE_CAST( unsigned long, _x4 ) )
#endif /* FT_IMAGE_TAG */
@ -739,6 +741,10 @@ FT_BEGIN_HEADER
* contours. Some Type~1 fonts, like those in the Hershey family,
* contain glyphs in this format. These are described as @FT_Outline,
* but FreeType isn't currently capable of rendering them correctly.
*
* FT_GLYPH_FORMAT_SVG ::
* [Since 2.12] The glyph is represented by an SVG document in the
* 'SVG~' table.
*/
typedef enum FT_Glyph_Format_
{
@ -747,7 +753,8 @@ FT_BEGIN_HEADER
FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_BITMAP, 'b', 'i', 't', 's' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' )
FT_IMAGE_TAG( FT_GLYPH_FORMAT_PLOTTER, 'p', 'l', 'o', 't' ),
FT_IMAGE_TAG( FT_GLYPH_FORMAT_SVG, 'S', 'V', 'G', ' ' )
} FT_Glyph_Format;
@ -772,17 +779,6 @@ FT_BEGIN_HEADER
/*************************************************************************/
/**************************************************************************
*
* A raster is a scan converter, in charge of rendering an outline into a
* bitmap. This section contains the public API for rasters.
*
* Note that in FreeType 2, all rasters are now encapsulated within
* specific modules called 'renderers'. See `ftrender.h` for more details
* on renderers.
*
*/
/**************************************************************************
*
@ -796,16 +792,35 @@ FT_BEGIN_HEADER
* How vectorial outlines are converted into bitmaps and pixmaps.
*
* @description:
* This section contains technical definitions.
* A raster or a rasterizer is a scan converter in charge of producing a
* pixel coverage bitmap that can be used as an alpha channel when
* compositing a glyph with a background. FreeType comes with two
* rasterizers: bilevel `raster1` and anti-aliased `smooth` are two
* separate modules. They are usually called from the high-level
* @FT_Load_Glyph or @FT_Render_Glyph functions and produce the entire
* coverage bitmap at once, while staying largely invisible to users.
*
* Instead of working with complete coverage bitmaps, it is also possible
* to intercept consecutive pixel runs on the same scanline with the same
* coverage, called _spans_, and process them individually. Only the
* `smooth` rasterizer permits this when calling @FT_Outline_Render with
* @FT_Raster_Params as described below.
*
* Working with either complete bitmaps or spans it is important to think
* of them as colorless coverage objects suitable as alpha channels to
* blend arbitrary colors with a background. For best results, it is
* recommended to use gamma correction, too.
*
* This section also describes the public API needed to set up alternative
* @FT_Renderer modules.
*
* @order:
* FT_Raster
* FT_Span
* FT_SpanFunc
*
* FT_Raster_Params
* FT_RASTER_FLAG_XXX
*
* FT_Raster
* FT_Raster_NewFunc
* FT_Raster_DoneFunc
* FT_Raster_ResetFunc
@ -816,26 +831,14 @@ FT_BEGIN_HEADER
*/
/**************************************************************************
*
* @type:
* FT_Raster
*
* @description:
* An opaque handle (pointer) to a raster object. Each object can be
* used independently to convert an outline into a bitmap or pixmap.
*/
typedef struct FT_RasterRec_* FT_Raster;
/**************************************************************************
*
* @struct:
* FT_Span
*
* @description:
* A structure used to model a single span of gray pixels when rendering
* an anti-aliased bitmap.
* A structure to model a single span of consecutive pixels when
* rendering an anti-aliased bitmap.
*
* @fields:
* x ::
@ -852,8 +855,8 @@ FT_BEGIN_HEADER
* This structure is used by the span drawing callback type named
* @FT_SpanFunc that takes the y~coordinate of the span as a parameter.
*
* The coverage value is always between 0 and 255. If you want less gray
* values, the callback function has to reduce them.
* The anti-aliased rasterizer produces coverage values from 0 to 255,
* this is, from completely transparent to completely opaque.
*/
typedef struct FT_Span_
{
@ -871,8 +874,8 @@ FT_BEGIN_HEADER
*
* @description:
* A function used as a call-back by the anti-aliased renderer in order
* to let client applications draw themselves the gray pixel spans on
* each scan line.
* to let client applications draw themselves the pixel spans on each
* scan line.
*
* @input:
* y ::
@ -888,11 +891,12 @@ FT_BEGIN_HEADER
* User-supplied data that is passed to the callback.
*
* @note:
* This callback allows client applications to directly render the gray
* spans of the anti-aliased bitmap to any kind of surfaces.
* This callback allows client applications to directly render the spans
* of the anti-aliased bitmap to any kind of surfaces.
*
* This can be used to write anti-aliased outlines directly to a given
* background bitmap, and even perform translucency.
* background bitmap using alpha compositing. It can also be used for
* oversampling and averaging.
*/
typedef void
(*FT_SpanFunc)( int y,
@ -962,11 +966,17 @@ FT_BEGIN_HEADER
* will be clipped to a box specified in the `clip_box` field of the
* @FT_Raster_Params structure. Otherwise, the `clip_box` is
* effectively set to the bounding box and all spans are generated.
*
* FT_RASTER_FLAG_SDF ::
* This flag is set to indicate that a signed distance field glyph
* image should be generated. This is only used while rendering with
* the @FT_RENDER_MODE_SDF render mode.
*/
#define FT_RASTER_FLAG_DEFAULT 0x0
#define FT_RASTER_FLAG_AA 0x1
#define FT_RASTER_FLAG_DIRECT 0x2
#define FT_RASTER_FLAG_CLIP 0x4
#define FT_RASTER_FLAG_SDF 0x8
/* these constants are deprecated; use the corresponding */
/* `FT_RASTER_FLAG_XXX` values instead */
@ -1047,6 +1057,23 @@ FT_BEGIN_HEADER
} FT_Raster_Params;
/**************************************************************************
*
* @type:
* FT_Raster
*
* @description:
* An opaque handle (pointer) to a raster object. Each object can be
* used independently to convert an outline into a bitmap or pixmap.
*
* @note:
* In FreeType 2, all rasters are now encapsulated within specific
* @FT_Renderer modules and only used in their context.
*
*/
typedef struct FT_RasterRec_* FT_Raster;
/**************************************************************************
*
* @functype:

View File

@ -4,7 +4,7 @@
*
* FreeType incremental loading (specification).
*
* Copyright (C) 2002-2020 by
* Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -213,9 +213,14 @@ FT_BEGIN_HEADER
*
* @description:
* A function used to retrieve the basic metrics of a given glyph index
* before accessing its data. This is necessary because, in certain
* formats like TrueType, the metrics are stored in a different place
* from the glyph images proper.
* before accessing its data. This allows for handling font types such
* as PCL~XL Format~1, Class~2 downloaded TrueType fonts, where the glyph
* metrics (`hmtx` and `vmtx` tables) are permitted to be omitted from
* the font, and the relevant metrics included in the header of the glyph
* outline data. Importantly, this is not intended to allow custom glyph
* metrics (for example, Postscript Metrics dictionaries), because that
* conflicts with the requirements of outline hinting. Such custom
* metrics must be handled separately, by the calling application.
*
* @input:
* incremental ::
@ -235,7 +240,7 @@ FT_BEGIN_HEADER
*
* @output:
* ametrics ::
* The replacement glyph metrics in font units.
* The glyph metrics in font units.
*
*/
typedef FT_Error
@ -264,7 +269,7 @@ FT_BEGIN_HEADER
*
* get_glyph_metrics ::
* The function to get glyph metrics. May be null if the font does not
* provide overriding glyph metrics.
* require it.
*
*/
typedef struct FT_Incremental_FuncsRec_

View File

@ -5,7 +5,7 @@
* FreeType API for color filtering of subpixel bitmap glyphs
* (specification).
*
* Copyright (C) 2006-2020 by
* Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -44,7 +44,7 @@ FT_BEGIN_HEADER
* API to control subpixel rendering.
*
* @description:
* FreeType provides two alternative subpixel rendering technologies.
* FreeType provides two alternative subpixel rendering technologies.
* Should you define `FT_CONFIG_OPTION_SUBPIXEL_RENDERING` in your
* `ftoption.h` file, this enables ClearType-style rendering.
* Otherwise, Harmony LCD rendering is enabled. These technologies are
@ -55,13 +55,12 @@ FT_BEGIN_HEADER
* ClearType-style LCD rendering exploits the color-striped structure of
* LCD pixels, increasing the available resolution in the direction of
* the stripe (usually horizontal RGB) by a factor of~3. Using the
* subpixels coverages unfiltered can create severe color fringes
* subpixel coverages unfiltered can create severe color fringes
* especially when rendering thin features. Indeed, to produce
* black-on-white text, the nearby color subpixels must be dimmed
* equally.
*
* A good 5-tap FIR filter should be applied to subpixel coverages
* regardless of pixel boundaries and should have these properties:
* evenly. Therefore, an equalizing 5-tap FIR filter should be applied
* to subpixel coverages regardless of pixel boundaries and should have
* these properties:
*
* 1. It should be symmetrical, like {~a, b, c, b, a~}, to avoid
* any shifts in appearance.
@ -84,7 +83,7 @@ FT_BEGIN_HEADER
* Harmony LCD rendering is suitable to panels with any regular subpixel
* structure, not just monitors with 3 color striped subpixels, as long
* as the color subpixels have fixed positions relative to the pixel
* center. In this case, each color channel is then rendered separately
* center. In this case, each color channel can be rendered separately
* after shifting the outline opposite to the subpixel shift so that the
* coverage maps are aligned. This method is immune to color fringes
* because the shifts do not change integral coverage.
@ -101,9 +100,9 @@ FT_BEGIN_HEADER
* clockwise. Harmony with default LCD geometry is equivalent to
* ClearType with light filter.
*
* As a result of ClearType filtering or Harmony rendering, the
* dimensions of LCD bitmaps can be either wider or taller than the
* dimensions of the corresponding outline with regard to the pixel grid.
* As a result of ClearType filtering or Harmony shifts, the resulting
* dimensions of LCD bitmaps can be slightly wider or taller than the
* dimensions the original outline with regard to the pixel grid.
* For example, for @FT_RENDER_MODE_LCD, the filter adds 2~subpixels to
* the left, and 2~subpixels to the right. The bitmap offset values are
* adjusted accordingly, so clients shouldn't need to modify their layout

View File

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

View File

@ -0,0 +1,184 @@
/****************************************************************************
*
* ftlogging.h
*
* Additional debugging APIs.
*
* 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.
*
*/
#ifndef FTLOGGING_H_
#define FTLOGGING_H_
#include <ft2build.h>
#include FT_CONFIG_CONFIG_H
FT_BEGIN_HEADER
/**************************************************************************
*
* @section:
* debugging_apis
*
* @title:
* External Debugging APIs
*
* @abstract:
* Public APIs to control the `FT_DEBUG_LOGGING` macro.
*
* @description:
* This section contains the declarations of public functions that
* enables fine control of what the `FT_DEBUG_LOGGING` macro outputs.
*
*/
/**************************************************************************
*
* @function:
* FT_Trace_Set_Level
*
* @description:
* Change the levels of tracing components of FreeType at run time.
*
* @input:
* tracing_level ::
* New tracing value.
*
* @example:
* The following call makes FreeType trace everything but the 'memory'
* component.
*
* ```
* FT_Trace_Set_Level( "any:7 memory:0 );
* ```
*
* @note:
* This function does nothing if compilation option `FT_DEBUG_LOGGING`
* isn't set.
*
* @since:
* 2.11
*
*/
FT_EXPORT( void )
FT_Trace_Set_Level( const char* tracing_level );
/**************************************************************************
*
* @function:
* FT_Trace_Set_Default_Level
*
* @description:
* Reset tracing value of FreeType's components to the default value
* (i.e., to the value of the `FT2_DEBUG` environment value or to NULL
* if `FT2_DEBUG` is not set).
*
* @note:
* This function does nothing if compilation option `FT_DEBUG_LOGGING`
* isn't set.
*
* @since:
* 2.11
*
*/
FT_EXPORT( void )
FT_Trace_Set_Default_Level( void );
/**************************************************************************
*
* @functype:
* FT_Custom_Log_Handler
*
* @description:
* A function typedef that is used to handle the logging of tracing and
* debug messages on a file system.
*
* @input:
* ft_component ::
* The name of `FT_COMPONENT` from which the current debug or error
* message is produced.
*
* fmt ::
* Actual debug or tracing message.
*
* args::
* Arguments of debug or tracing messages.
*
* @since:
* 2.11
*
*/
typedef void
(*FT_Custom_Log_Handler)( const char* ft_component,
const char* fmt,
va_list args );
/**************************************************************************
*
* @function:
* FT_Set_Log_Handler
*
* @description:
* A function to set a custom log handler.
*
* @input:
* handler ::
* New logging function.
*
* @note:
* This function does nothing if compilation option `FT_DEBUG_LOGGING`
* isn't set.
*
* @since:
* 2.11
*
*/
FT_EXPORT( void )
FT_Set_Log_Handler( FT_Custom_Log_Handler handler );
/**************************************************************************
*
* @function:
* FT_Set_Default_Log_Handler
*
* @description:
* A function to undo the effect of @FT_Set_Log_Handler, resetting the
* log handler to FreeType's built-in version.
*
* @note:
* This function does nothing if compilation option `FT_DEBUG_LOGGING`
* isn't set.
*
* @since:
* 2.11
*
*/
FT_EXPORT( void )
FT_Set_Default_Log_Handler( void );
/* */
FT_END_HEADER
#endif /* FTLOGGING_H_ */
/* END */

View File

@ -4,7 +4,7 @@
*
* LZW-compressed stream support.
*
* Copyright (C) 2004-2020 by
* Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

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

View File

@ -4,7 +4,7 @@
*
* FreeType Multiple Master font interface (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -47,6 +47,9 @@ FT_BEGIN_HEADER
* MM fonts, others will work with all three types. They are similar
* enough that a consistent interface makes sense.
*
* For Adobe MM fonts, macro @FT_IS_SFNT returns false. For GX and
* OpenType variation fonts, it returns true.
*
*/

View File

@ -4,7 +4,7 @@
*
* FreeType modules public interface (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -45,10 +45,12 @@ FT_BEGIN_HEADER
*
* @description:
* The definitions below are used to manage modules within FreeType.
* Modules can be added, upgraded, and removed at runtime. Additionally,
* some module properties can be controlled also.
* Internal and external modules can be added, upgraded, and removed at
* runtime. For example, an alternative renderer or proprietary font
* driver can be registered and prioritized. Additionally, some module
* properties can also be controlled.
*
* Here is a list of possible values of the `module_name` field in the
* Here is a list of existing values of the `module_name` field in the
* @FT_Module_Class structure.
*
* ```
@ -86,6 +88,7 @@ FT_BEGIN_HEADER
* FT_Remove_Module
* FT_Add_Default_Modules
*
* FT_FACE_DRIVER_NAME
* FT_Property_Set
* FT_Property_Get
* FT_Set_Default_Properties
@ -328,6 +331,27 @@ FT_BEGIN_HEADER
FT_Module module );
/**************************************************************************
*
* @macro:
* FT_FACE_DRIVER_NAME
*
* @description:
* A macro that retrieves the name of a font driver from a face object.
*
* @note:
* The font driver name is a valid `module_name` for @FT_Property_Set
* and @FT_Property_Get. This is not the same as @FT_Get_Font_Format.
*
* @since:
* 2.11
*
*/
#define FT_FACE_DRIVER_NAME( face ) \
( ( *FT_REINTERPRET_CAST( FT_Module_Class**, \
( face )->driver ) )->module_name )
/**************************************************************************
*
* @function:
@ -485,8 +509,7 @@ FT_BEGIN_HEADER
*
* ```
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
* cff:no-stem-darkening=0 \
* autofitter:warping=1
* cff:no-stem-darkening=0
* ```
*
* @inout:

View File

@ -4,7 +4,7 @@
*
* FreeType module error offsets (specification).
*
* Copyright (C) 2001-2020 by
* Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -171,6 +171,7 @@
FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" )
FT_MODERRDEF( Sdf, 0x1700, "Signed distance field raster module" )
#ifdef FT_MODERR_END_LIST

View File

@ -4,7 +4,7 @@
*
* FreeType API for validating OpenType tables (specification).
*
* Copyright (C) 2004-2020 by
* Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -5,7 +5,7 @@
* Support for the FT_Outline type used to store glyph shapes of
* most scalable font formats (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -109,11 +109,13 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
* A contour that contains a single point only is represented by a 'move
* to' operation followed by 'line to' to the same point. In most cases,
* it is best to filter this out before using the outline for stroking
* purposes (otherwise it would result in a visible dot when round caps
* are used).
* Degenerate contours, segments, and Bezier arcs may be reported. In
* most cases, it is best to filter these out before using the outline
* for stroking or other path modification purposes (which may cause
* degenerate segments to become non-degenrate and visible, like when
* stroke caps are used or the path is otherwise outset). Some glyph
* outlines may contain deliberate degenerate single points for mark
* attachement.
*
* Similarly, the function returns success for an empty outline also
* (doing nothing, this is, not calling any emitter); if necessary, you

View File

@ -4,7 +4,7 @@
*
* FreeType API for possible FT_Parameter tags (specification only).
*
* Copyright (C) 2017-2020 by
* Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -112,6 +112,21 @@ FT_BEGIN_HEADER
FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
/**************************************************************************
*
* @enum:
* FT_PARAM_TAG_IGNORE_SBIX
*
* @description:
* A tag for @FT_Parameter to make @FT_Open_Face ignore an 'sbix' table
* while loading a font. Use this if @FT_FACE_FLAG_SBIX is set and you
* want to access the outline glyphs in the font.
*
*/
#define FT_PARAM_TAG_IGNORE_SBIX \
FT_MAKE_TAG( 'i', 's', 'b', 'x' )
/**************************************************************************
*
* @enum:

View File

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

View File

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

View File

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

View File

@ -7,7 +7,7 @@
*
* This is _not_ used to retrieve glyph names!
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

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

View File

@ -5,7 +5,7 @@
* FreeType synthesizing code for emboldening and slanting
* (specification).
*
* Copyright (C) 2000-2020 by
* Copyright (C) 2000-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

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

View File

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

View File

@ -4,7 +4,7 @@
*
* FreeType simple types definitions (specification only).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -413,7 +413,7 @@ FT_BEGIN_HEADER
typedef struct FT_Data_
{
const FT_Byte* pointer;
FT_Int length;
FT_UInt length;
} FT_Data;
@ -479,18 +479,17 @@ FT_BEGIN_HEADER
*
* @description:
* This macro converts four-letter tags that are used to label TrueType
* tables into an unsigned long, to be used within FreeType.
* tables into an `FT_Tag` type, to be used within FreeType.
*
* @note:
* The produced values **must** be 32-bit integers. Don't redefine this
* macro.
*/
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
(FT_Tag) \
( ( (FT_ULong)_x1 << 24 ) | \
( (FT_ULong)_x2 << 16 ) | \
( (FT_ULong)_x3 << 8 ) | \
(FT_ULong)_x4 )
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
( ( FT_STATIC_BYTE_CAST( FT_Tag, _x1 ) << 24 ) | \
( FT_STATIC_BYTE_CAST( FT_Tag, _x2 ) << 16 ) | \
( FT_STATIC_BYTE_CAST( FT_Tag, _x3 ) << 8 ) | \
FT_STATIC_BYTE_CAST( FT_Tag, _x4 ) )
/*************************************************************************/
@ -588,7 +587,7 @@ FT_BEGIN_HEADER
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
#define FT_BOOL( x ) ( (FT_Bool)( (x) != 0 ) )
#define FT_BOOL( x ) FT_STATIC_CAST( FT_Bool, (x) != 0 )
/* concatenate C tokens */
#define FT_ERR_XCAT( x, y ) x ## y

View File

@ -4,7 +4,7 @@
*
* FreeType API for accessing Windows fnt-specific data.
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -55,7 +55,7 @@ FT_BEGIN_HEADER
* FT_WinFNT_ID_XXX
*
* @description:
* A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec.
* A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec.
* Exact mapping tables for the various 'cpXXXX' encodings (except for
* 'cp1361') can be found at 'ftp://ftp.unicode.org/Public/' in the
* `MAPPINGS/VENDORS/MICSFT/WINDOWS` subdirectory. 'cp1361' is roughly a

View File

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

View File

@ -4,7 +4,7 @@
*
* Basic OpenType/CFF object type definitions (specification).
*
* Copyright (C) 2017-2020 by
* Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -5,7 +5,7 @@
* Basic OpenType/CFF type definitions and interface (specification
* only).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* Compiler-specific macro definitions used internally by FreeType.
*
* Copyright (C) 2020 by
* 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,
@ -71,12 +71,18 @@ FT_BEGIN_HEADER
*/
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
#ifdef _WIN64
#ifdef __UINTPTR_TYPE__
/*
* GCC and Clang both provide a `__UINTPTR_TYPE__` that can be used to
* avoid a dependency on `stdint.h`.
*/
# define FT_UINT_TO_POINTER( x ) (void *)(__UINTPTR_TYPE__)(x)
#elif defined( _WIN64 )
/* only 64bit Windows uses the LLP64 data model, i.e., */
/* 32-bit integers, 64-bit pointers. */
#define FT_UINT_TO_POINTER( x ) (void *)(unsigned __int64)(x)
# define FT_UINT_TO_POINTER( x ) (void *)(unsigned __int64)(x)
#else
#define FT_UINT_TO_POINTER( x ) (void *)(unsigned long)(x)
# define FT_UINT_TO_POINTER( x ) (void *)(unsigned long)(x)
#endif
/*
@ -216,79 +222,93 @@ FT_BEGIN_HEADER
#define FT_EXPORT_VAR( x ) FT_FUNCTION_DECLARATION( x )
#endif
/* When compiling FreeType as a DLL or DSO with hidden visibility, */
/* some systems/compilers need a special attribute in front OR after */
/* the return type of function declarations. */
/* */
/* Two macros are used within the FreeType source code to define */
/* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`. */
/* */
/* - `FT_EXPORT( return_type )` */
/* */
/* is used in a function declaration, as in */
/* */
/* ``` */
/* FT_EXPORT( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ); */
/* ``` */
/* */
/* - `FT_EXPORT_DEF( return_type )` */
/* */
/* is used in a function definition, as in */
/* */
/* ``` */
/* FT_EXPORT_DEF( FT_Error ) */
/* FT_Init_FreeType( FT_Library* alibrary ) */
/* { */
/* ... some code ... */
/* return FT_Err_Ok; */
/* } */
/* ``` */
/* */
/* You can provide your own implementation of `FT_EXPORT` and */
/* `FT_EXPORT_DEF` here if you want. */
/* */
/* To export a variable, use `FT_EXPORT_VAR`. */
/* */
/*
* When compiling FreeType as a DLL or DSO with hidden visibility,
* some systems/compilers need a special attribute in front OR after
* the return type of function declarations.
*
* Two macros are used within the FreeType source code to define
* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`.
*
* - `FT_EXPORT( return_type )`
*
* is used in a function declaration, as in
*
* ```
* FT_EXPORT( FT_Error )
* FT_Init_FreeType( FT_Library* alibrary );
* ```
*
* - `FT_EXPORT_DEF( return_type )`
*
* is used in a function definition, as in
*
* ```
* FT_EXPORT_DEF( FT_Error )
* FT_Init_FreeType( FT_Library* alibrary )
* {
* ... some code ...
* return FT_Err_Ok;
* }
* ```
*
* You can provide your own implementation of `FT_EXPORT` and
* `FT_EXPORT_DEF` here if you want.
*
* To export a variable, use `FT_EXPORT_VAR`.
*/
/* See `freetype/config/compiler_macros.h` for the `FT_EXPORT` definition */
#define FT_EXPORT_DEF( x ) FT_FUNCTION_DEFINITION( x )
/* The following macros are needed to compile the library with a */
/* C++ compiler and with 16bit compilers. */
/* */
/*
* The following macros are needed to compile the library with a
* C++ compiler and with 16bit compilers.
*/
/* This is special. Within C++, you must specify `extern "C"` for */
/* functions which are used via function pointers, and you also */
/* must do that for structures which contain function pointers to */
/* assure C linkage -- it's not possible to have (local) anonymous */
/* functions which are accessed by (global) function pointers. */
/* */
/* */
/* FT_CALLBACK_DEF is used to _define_ a callback function, */
/* located in the same source code file as the structure that uses */
/* it. */
/* */
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
/* and define a callback function, respectively, in a similar way */
/* as FT_BASE and FT_BASE_DEF work. */
/* */
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
/* contains pointers to callback functions. */
/* */
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
/* that contains pointers to callback functions. */
/* */
/* */
/* Some 16bit compilers have to redefine these macros to insert */
/* the infamous `_cdecl` or `__fastcall` declarations. */
/* */
/*
* This is special. Within C++, you must specify `extern "C"` for
* functions which are used via function pointers, and you also
* must do that for structures which contain function pointers to
* assure C linkage -- it's not possible to have (local) anonymous
* functions which are accessed by (global) function pointers.
*
*
* FT_CALLBACK_DEF is used to _define_ a callback function,
* located in the same source code file as the structure that uses
* it. FT_COMPARE_DEF, in addition, ensures the `cdecl` calling
* convention on x86, required by the C library function `qsort`.
*
* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare
* and define a callback function, respectively, in a similar way
* as FT_BASE and FT_BASE_DEF work.
*
* FT_CALLBACK_TABLE is used to _declare_ a constant variable that
* contains pointers to callback functions.
*
* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable
* that contains pointers to callback functions.
*
*
* Some 16bit compilers have to redefine these macros to insert
* the infamous `_cdecl` or `__fastcall` declarations.
*/
#ifdef __cplusplus
#define FT_CALLBACK_DEF( x ) extern "C" x
#else
#define FT_CALLBACK_DEF( x ) static x
#endif
#if defined( __GNUC__ ) && defined( __i386__ )
#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x ) __attribute__(( cdecl ))
#elif defined( _MSC_VER ) && defined( _M_IX86 )
#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x ) __cdecl
#elif defined( __WATCOMC__ ) && __WATCOMC__ >= 1240
#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x ) __watcall
#else
#define FT_COMPARE_DEF( x ) FT_CALLBACK_DEF( x )
#endif
#define FT_BASE_CALLBACK( x ) FT_FUNCTION_DECLARATION( x )
#define FT_BASE_CALLBACK_DEF( x ) FT_FUNCTION_DEFINITION( x )

View File

@ -4,7 +4,7 @@
*
* Arithmetic computations (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -359,8 +359,8 @@ FT_BEGIN_HEADER
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
#if defined( __GNUC__ ) && \
( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
#if defined( __clang__ ) || ( defined( __GNUC__ ) && \
( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) ) )
#if FT_SIZEOF_INT == 4
@ -370,12 +370,25 @@ FT_BEGIN_HEADER
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
#endif /* __GNUC__ */
#endif
#elif defined( _MSC_VER ) && _MSC_VER >= 1400
#elif defined( _MSC_VER ) && ( _MSC_VER >= 1400 )
#if defined( _WIN32_WCE )
#if FT_SIZEOF_INT == 4
#include <cmnintrin.h>
#pragma intrinsic( _CountLeadingZeros )
#define FT_MSB( x ) ( 31 - _CountLeadingZeros( x ) )
#elif defined( _M_ARM64 ) || defined( _M_ARM )
#include <intrin.h>
#pragma intrinsic( _CountLeadingZeros )
#define FT_MSB( x ) ( 31 - _CountLeadingZeros( x ) )
#elif defined( _M_IX86 ) || defined( _M_AMD64 ) || defined( _M_IA64 )
#include <intrin.h>
#pragma intrinsic( _BitScanReverse )
@ -391,15 +404,40 @@ FT_BEGIN_HEADER
return (FT_Int32)where;
}
#define FT_MSB( x ) ( FT_MSB_i386( x ) )
#define FT_MSB( x ) FT_MSB_i386( x )
#endif
#endif /* _MSC_VER */
#elif defined( __WATCOMC__ ) && defined( __386__ )
extern __inline FT_Int32
FT_MSB_i386( FT_UInt32 x );
#pragma aux FT_MSB_i386 = \
"bsr eax, eax" \
parm [eax] nomemory \
value [eax] \
modify exact [eax] nomemory;
#define FT_MSB( x ) FT_MSB_i386( x )
#elif defined( __DECC ) || defined( __DECCXX )
#include <builtins.h>
#define FT_MSB( x ) (FT_Int)( 63 - _leadz( x ) )
#elif defined( _CRAYC )
#include <intrinsics.h>
#define FT_MSB( x ) (FT_Int)( 31 - _leadz32( x ) )
#endif /* FT_MSB macro definitions */
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
#ifndef FT_MSB
FT_BASE( FT_Int )
@ -487,7 +525,7 @@ FT_BEGIN_HEADER
#define NEG_INT32( a ) \
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
#ifdef FT_LONG64
#ifdef FT_INT64
#define ADD_INT64( a, b ) \
(FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
@ -498,7 +536,7 @@ FT_BEGIN_HEADER
#define NEG_INT64( a ) \
(FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
#endif /* FT_LONG64 */
#endif /* FT_INT64 */
FT_END_HEADER

View File

@ -4,7 +4,7 @@
*
* Debugging and logging component (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -31,9 +31,24 @@
#include "compiler-macros.h"
#ifdef FT_DEBUG_LOGGING
#define DLG_STATIC
#include <dlg/output.h>
#include <dlg/dlg.h>
#include <freetype/ftlogging.h>
#endif /* FT_DEBUG_LOGGING */
FT_BEGIN_HEADER
/* force the definition of FT_DEBUG_LEVEL_TRACE if FT_DEBUG_LOGGING is */
/* already defined. */
/* */
#ifdef FT_DEBUG_LOGGING
#undef FT_DEBUG_LEVEL_TRACE
#define FT_DEBUG_LEVEL_TRACE
#endif
/* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
/* is already defined; this simplifies the following #ifdefs */
@ -82,20 +97,66 @@ FT_BEGIN_HEADER
* Each component must define the macro FT_COMPONENT to a valid FT_Trace
* value before using any TRACE macro.
*
* To get consistent logging output, there should be no newline character
* (i.e., '\n') or a single trailing one in the message string of
* `FT_TRACEx` and `FT_ERROR`.
*/
/*************************************************************************
*
* If FT_DEBUG_LOGGING is enabled, tracing messages are sent to dlg's API.
* If FT_DEBUG_LOGGING is disabled, tracing messages are sent to
* `FT_Message` (defined in ftdebug.c).
*/
#ifdef FT_DEBUG_LOGGING
/* we need two macros to convert the names of `FT_COMPONENT` to a string */
#define FT_LOGGING_TAG( x ) FT_LOGGING_TAG_( x )
#define FT_LOGGING_TAG_( x ) #x
/* we need two macros to convert the component and the trace level */
/* to a string that combines them */
#define FT_LOGGING_TAGX( x, y ) FT_LOGGING_TAGX_( x, y )
#define FT_LOGGING_TAGX_( x, y ) #x ":" #y
#define FT_LOG( level, varformat ) \
do \
{ \
const char* dlg_tag = FT_LOGGING_TAGX( FT_COMPONENT, level ); \
\
\
ft_add_tag( dlg_tag ); \
if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
{ \
if ( custom_output_handler != NULL ) \
FT_Logging_Callback varformat; \
else \
dlg_trace varformat; \
} \
ft_remove_tag( dlg_tag ); \
} while( 0 )
#else /* !FT_DEBUG_LOGGING */
#define FT_LOG( level, varformat ) \
do \
{ \
if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
FT_Message varformat; \
} while ( 0 )
#endif /* !FT_DEBUG_LOGGING */
#ifdef FT_DEBUG_LEVEL_TRACE
/* we need two macros here to make cpp expand `FT_COMPONENT' */
#define FT_TRACE_COMP( x ) FT_TRACE_COMP_( x )
#define FT_TRACE_COMP_( x ) trace_ ## x
#define FT_TRACE( level, varformat ) \
do \
{ \
if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
FT_Message varformat; \
} while ( 0 )
#define FT_TRACE( level, varformat ) FT_LOG( level, varformat )
#else /* !FT_DEBUG_LEVEL_TRACE */
@ -204,7 +265,32 @@ FT_BEGIN_HEADER
#ifdef FT_DEBUG_LEVEL_ERROR
#define FT_ERROR( varformat ) FT_Message varformat
/**************************************************************************
*
* If FT_DEBUG_LOGGING is enabled, error messages are sent to dlg's API.
* If FT_DEBUG_LOGGING is disabled, error messages are sent to `FT_Message`
* (defined in ftdebug.c).
*
*/
#ifdef FT_DEBUG_LOGGING
#define FT_ERROR( varformat ) \
do \
{ \
const char* dlg_tag = FT_LOGGING_TAG( FT_COMPONENT ); \
\
\
ft_add_tag( dlg_tag ); \
dlg_trace varformat; \
ft_remove_tag( dlg_tag ); \
} while ( 0 )
#else /* !FT_DEBUG_LOGGING */
#define FT_ERROR( varformat ) FT_Message varformat
#endif /* !FT_DEBUG_LOGGING */
#else /* !FT_DEBUG_LEVEL_ERROR */
@ -277,6 +363,77 @@ FT_BEGIN_HEADER
FT_BASE( void )
ft_debug_init( void );
#ifdef FT_DEBUG_LOGGING
/**************************************************************************
*
* 'dlg' uses output handlers to control how and where log messages are
* printed. Therefore we need to define a default output handler for
* FreeType.
*/
FT_BASE( void )
ft_log_handler( const struct dlg_origin* origin,
const char* string,
void* data );
/**************************************************************************
*
* 1. `ft_default_log_handler` stores the function pointer that is used
* internally by FreeType to print logs to a file.
*
* 2. `custom_output_handler` stores the function pointer to the callback
* function provided by the user.
*
* It is defined in `ftdebug.c`.
*/
extern dlg_handler ft_default_log_handler;
extern FT_Custom_Log_Handler custom_output_handler;
/**************************************************************************
*
* If FT_DEBUG_LOGGING macro is enabled, FreeType needs to initialize and
* un-initialize `FILE*`.
*
* These functions are defined in `ftdebug.c`.
*/
FT_BASE( void )
ft_logging_init( void );
FT_BASE( void )
ft_logging_deinit( void );
/**************************************************************************
*
* For printing the name of `FT_COMPONENT` along with the actual log we
* need to add a tag with the name of `FT_COMPONENT`.
*
* These functions are defined in `ftdebug.c`.
*/
FT_BASE( void )
ft_add_tag( const char* tag );
FT_BASE( void )
ft_remove_tag( const char* tag );
/**************************************************************************
*
* A function to print log data using a custom callback logging function
* (which is set using `FT_Set_Log_Handler`).
*
* This function is defined in `ftdebug.c`.
*/
FT_BASE( void )
FT_Logging_Callback( const char* fmt,
... );
#endif /* FT_DEBUG_LOGGING */
FT_END_HEADER
#endif /* FTDEBUG_H_ */

View File

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

View File

@ -4,7 +4,7 @@
*
* The FreeType glyph loader (specification).
*
* Copyright (C) 2002-2020 by
* Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
@ -22,6 +22,7 @@
#include <freetype/freetype.h>
#include "compiler-macros.h"
FT_BEGIN_HEADER

View File

@ -4,7 +4,7 @@
*
* The FreeType memory management macros (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg
*
* This file is part of the FreeType project, and may only be used,
@ -344,14 +344,13 @@ extern "C++"
#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
#define FT_QNEW( ptr ) \
FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
#define FT_QNEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
#define FT_QNEW_ARRAY( ptr, count ) \
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
#define FT_QNEW_ARRAY( ptr, count ) \
FT_MEM_SET_ERROR( FT_MEM_QNEW_ARRAY( ptr, count ) )
#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
FT_MEM_SET_ERROR( FT_MEM_QRENEW_ARRAY( ptr, curcnt, newcnt ) )
FT_BASE( FT_Pointer )

View File

@ -4,7 +4,7 @@
*
* The FreeType private base classes (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -418,7 +418,8 @@ FT_BEGIN_HEADER
* initializing the glyph slot.
*/
#define FT_GLYPH_OWN_BITMAP 0x1U
#define FT_GLYPH_OWN_BITMAP 0x1U
#define FT_GLYPH_OWN_GZIP_SVG 0x2U
typedef struct FT_Slot_InternalRec_
{
@ -673,7 +674,7 @@ FT_BEGIN_HEADER
/* Set the metrics according to a size request. */
FT_BASE( void )
FT_BASE( FT_Error )
FT_Request_Metrics( FT_Face face,
FT_Size_Request req );

View File

@ -4,7 +4,7 @@
*
* Get and set properties of PostScript drivers (specification).
*
* Copyright (C) 2017-2020 by
* Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* Embedded resource forks accessor (specification).
*
* Copyright (C) 2004-2020 by
* Copyright (C) 2004-2022 by
* Masatake YAMATO and Redhat K.K.
*
* This file is part of the FreeType project, and may only be used,

View File

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

View File

@ -4,7 +4,7 @@
*
* Stream handling (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -196,9 +196,9 @@ FT_BEGIN_HEADER
FT_BYTE_U32( p, 2, 8 ) | \
FT_BYTE_U32( p, 3, 0 ) )
#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 2, 0 ) )
#define FT_PEEK_OFF3( p ) ( FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
FT_BYTE_U32( p, 1, 16 ) | \
FT_BYTE_U32( p, 2, 8 ) ) >> 8 )
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
@ -220,9 +220,9 @@ FT_BEGIN_HEADER
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
FT_BYTE_U32( p, 0, 0 ) )
#define FT_PEEK_OFF3_LE( p ) ( FT_INT32( FT_BYTE_U32( p, 2, 24 ) | \
FT_BYTE_U32( p, 1, 16 ) | \
FT_BYTE_U32( p, 0, 8 ) ) >> 8 )
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
FT_BYTE_U32( p, 1, 8 ) | \
@ -305,11 +305,10 @@ FT_BEGIN_HEADER
#else
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetByte, FT_Char )
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetByte, FT_Byte )
#define FT_GET_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Short )
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
@ -333,11 +332,10 @@ FT_BEGIN_HEADER
* `FT_STREAM_POS'. They use the full machinery to check whether a read is
* valid.
*/
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadByte, FT_Byte, var )
#define FT_READ_CHAR( var ) FT_READ_MACRO( FT_Stream_ReadByte, FT_Char, var )
#define FT_READ_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Short, var )
#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
#define FT_READ_OFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_Long, var )
#define FT_READ_UOFF3( var ) FT_READ_MACRO( FT_Stream_ReadUOffset, FT_ULong, var )
#define FT_READ_LONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_Long, var )
#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
@ -457,8 +455,8 @@ FT_BEGIN_HEADER
/* read a byte from an entered frame */
FT_BASE( FT_Char )
FT_Stream_GetChar( FT_Stream stream );
FT_BASE( FT_Byte )
FT_Stream_GetByte( FT_Stream stream );
/* read a 16-bit big-endian unsigned integer from an entered frame */
FT_BASE( FT_UShort )
@ -482,8 +480,8 @@ FT_BEGIN_HEADER
/* read a byte from a stream */
FT_BASE( FT_Char )
FT_Stream_ReadChar( FT_Stream stream,
FT_BASE( FT_Byte )
FT_Stream_ReadByte( FT_Stream stream,
FT_Error* error );
/* read a 16-bit big-endian unsigned integer from a stream */

View File

@ -4,7 +4,7 @@
*
* Tracing handling (specification only).
*
* Copyright (C) 2002-2020 by
* Copyright (C) 2002-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,
@ -18,6 +18,11 @@
/* definitions of trace levels for FreeType 2 */
/* the maximum string length (if the argument to `FT_TRACE_DEF` */
/* gets used as a string) plus one charachter for ':' plus */
/* another one for the trace level */
#define FT_MAX_TRACE_LEVEL_LENGTH (9 + 1 + 1)
/* the first level must always be `trace_any' */
FT_TRACE_DEF( any )
@ -38,12 +43,17 @@ FT_TRACE_DEF( checksum ) /* bitmap checksum (ftobjs.c) */
FT_TRACE_DEF( mm ) /* MM interface (ftmm.c) */
FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.c) */
FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
/* Cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
/* rasterizers */
FT_TRACE_DEF( raster ) /* monochrome rasterizer (ftraster.c) */
FT_TRACE_DEF( smooth ) /* anti-aliasing raster (ftgrays.c) */
/* ot-svg module */
FT_TRACE_DEF( otsvg ) /* OT-SVG renderer (ftsvg.c) */
/* cache sub-system */
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
/* SFNT driver components */
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
@ -54,6 +64,7 @@ FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */
FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */
FT_TRACE_DEF( ttsvg ) /* OpenType SVG table (ttsvg.c) */
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
@ -77,6 +88,7 @@ FT_TRACE_DEF( t1objs )
FT_TRACE_DEF( t1parse )
/* PostScript helper module `psaux' */
FT_TRACE_DEF( afmparse )
FT_TRACE_DEF( cffdecode )
FT_TRACE_DEF( psconv )
FT_TRACE_DEF( psobjs )
@ -151,8 +163,10 @@ FT_TRACE_DEF( afglobal )
FT_TRACE_DEF( afhints )
FT_TRACE_DEF( afmodule )
FT_TRACE_DEF( aflatin )
FT_TRACE_DEF( aflatin2 )
FT_TRACE_DEF( afshaper )
FT_TRACE_DEF( afwarp )
/* SDF components */
FT_TRACE_DEF( sdf ) /* signed distance raster for outlines (ftsdf.c) */
FT_TRACE_DEF( bsdf ) /* signed distance raster for bitmaps (ftbsdf.c) */
/* END */

View File

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

View File

@ -5,7 +5,7 @@
* Auxiliary functions and data structures related to PostScript fonts
* (specification).
*
* Copyright (C) 1996-2020 by
* Copyright (C) 1996-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -6,7 +6,7 @@
* recorders (specification only). These are used to support native
* T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
*
* Copyright (C) 2001-2020 by
* Copyright (C) 2001-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

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

View File

@ -4,7 +4,7 @@
*
* The FreeType CFF tables loader service (specification).
*
* Copyright (C) 2017-2020 by
* Copyright (C) 2017-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType CID font services (specification).
*
* Copyright (C) 2007-2020 by
* Copyright (C) 2007-2022 by
* Derek Clegg and Michael Toftdal.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType font format service (specification only).
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType glyph dictionary services (specification).
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* FreeType API for validating TrueTypeGX/AAT tables (specification).
*
* Copyright (C) 2004-2020 by
* Copyright (C) 2004-2022 by
* Masatake YAMATO, Red Hat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*

View File

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

View File

@ -4,7 +4,7 @@
*
* The FreeType services for metrics variations (specification).
*
* Copyright (C) 2016-2020 by
* Copyright (C) 2016-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType Multiple Masters and GX var services (specification).
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType OpenType validation service (specification).
*
* Copyright (C) 2004-2020 by
* Copyright (C) 2004-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* Internal PFR service functions (specification).
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType PostScript name services (specification).
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

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

View File

@ -4,7 +4,7 @@
*
* The FreeType PostScript charmap service (specification).
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType PostScript info service (specification).
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType SFNT table loading service (specification).
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType TrueType/sfnt cmap extra information service.
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* Masatake YAMATO, Redhat K.K.,
* David Turner, Robert Wilhelm, and Werner Lemberg.
*

View File

@ -4,7 +4,7 @@
*
* The FreeType TrueType engine query service (specification).
*
* Copyright (C) 2006-2020 by
* Copyright (C) 2006-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType TrueType glyph service.
*
* Copyright (C) 2007-2020 by
* Copyright (C) 2007-2022 by
* David Turner.
*
* This file is part of the FreeType project, and may only be used,

View File

@ -4,7 +4,7 @@
*
* The FreeType Windows FNT/FONT service (specification).
*
* Copyright (C) 2003-2020 by
* Copyright (C) 2003-2022 by
* David Turner, Robert Wilhelm, and Werner Lemberg.
*
* This file is part of the FreeType project, and may only be used,

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