mirror of
https://github.com/openjdk/jdk8u.git
synced 2025-12-10 21:05:56 -06:00
8348596: Update FreeType to 2.13.3
8285686: Update FreeType to 2.12.0 8290334: Update FreeType to 2.12.1 8298974: Add ftcolor.c to imported freetype sources 8293672: Update freetype md file 8316028: Update FreeType to 2.13.2 8306881: Update FreeType to 2.13.0 Reviewed-by: andrew Backport-of: 428c2a292a8670f44bdb617014caaed0de591907
This commit is contained in:
parent
6a3f7bb9a0
commit
de76f06b9d
@ -1028,12 +1028,12 @@ That's all there is to it!
|
|||||||
|
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
|
|
||||||
%% This notice is provided with respect to Freetype v2.9 which may be
|
%% This notice is provided with respect to Freetype v2.13.3 which may be
|
||||||
included with JRE 8, JDK 8, and OpenJDK 8.
|
included with JRE 8, JDK 8, and OpenJDK 8.
|
||||||
|
|
||||||
--- begin of LICENSE ---
|
--- begin of LICENSE ---
|
||||||
|
|
||||||
## The FreeType Project: Freetype v2.10.4
|
## The FreeType Project: Freetype v2.13.3
|
||||||
|
|
||||||
|
|
||||||
### FreeType Notice
|
### FreeType Notice
|
||||||
@ -1055,7 +1055,27 @@ which fits your needs best.
|
|||||||
|
|
||||||
### FreeType License
|
### FreeType License
|
||||||
```
|
```
|
||||||
The FreeType Project LICENSE
|
|
||||||
|
Copyright (C) 1996-2024 by David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
Copyright (C) 2007-2024 by Dereg Clegg and Michael Toftdal.
|
||||||
|
Copyright (C) 1996-2024 by Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
Copyright (C) 2022-2024 by David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and
|
||||||
|
Copyright (C) 2004-2024 by Masatake YAMATO and Redhat K.K.
|
||||||
|
Copyright (C) 2007-2024 by Derek Clegg and Michael Toftdal.
|
||||||
|
Copyright (C) 2003-2024 by Masatake YAMATO, Red Hat K.K.,
|
||||||
|
Copyright (C) 1996-2024 by David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
|
||||||
|
Copyright (C) 2007-2024 by David Turner.
|
||||||
|
Copyright (C) 2022-2024 by David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
|
||||||
|
Copyright (C) 2007-2024 by Rahul Bhalerao <rahul.bhalerao@redhat.com>, <b.rahul.pm@gmail.com>.
|
||||||
|
Copyright (C) 2008-2024 by David Turner, Robert Wilhelm, Werner Lemberg, and suzuki toshiya.
|
||||||
|
Copyright (C) 2013-2024 by Google, Inc.
|
||||||
|
Copyright (C) 2019-2024 by Nikhil Ramakrishnan, David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
|
Copyright (C) 2009-2024 by Oran Agra and Mickey Gabel.
|
||||||
|
Copyright (C) 2018-2024 by David Turner, Robert Wilhelm, Dominik Röttsches, and Werner Lemberg.
|
||||||
|
Copyright (C) 2004-2024 by David Turner, Robert Wilhelm, Werner Lemberg, and George Williams.
|
||||||
|
|
||||||
|
|
||||||
|
The FreeType Project LICENSE
|
||||||
----------------------------
|
----------------------------
|
||||||
|
|
||||||
2006-Jan-27
|
2006-Jan-27
|
||||||
@ -1220,7 +1240,7 @@ Legal Terms
|
|||||||
|
|
||||||
Our home page can be found at
|
Our home page can be found at
|
||||||
|
|
||||||
http://www.freetype.org
|
https://www.freetype.org
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -1568,45 +1588,36 @@ consider it more useful to permit linking proprietary applications with the
|
|||||||
library. If this is what you want to do, use the GNU Library General
|
library. If this is what you want to do, use the GNU Library General
|
||||||
Public License instead of this License.
|
Public License instead of this License.
|
||||||
|
|
||||||
#########################################################################
|
```
|
||||||
|
|
||||||
--- fthash.c and fthash.h are covered by the following notices ---
|
### Additional Freetype Attributions
|
||||||
|
```
|
||||||
|
|
||||||
/*
|
---------------------------------
|
||||||
* Copyright 2000 Computing Research Labs, New Mexico State University
|
The below applies to the following file(s):
|
||||||
* Copyright 2001-2015
|
libfreetype/src/psaux/psarrst.c
|
||||||
* Francesco Zappa Nardelli
|
libfreetype/src/psaux/psarrst.h
|
||||||
*
|
libfreetype/src/psaux/psblues.c
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
libfreetype/src/psaux/psblues.h
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
libfreetype/src/psaux/pserror.c
|
||||||
* to deal in the Software without restriction, including without limitation
|
libfreetype/src/psaux/pserror.h
|
||||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
libfreetype/src/psaux/psfixed.h
|
||||||
* and/or sell copies of the Software, and to permit persons to whom the
|
libfreetype/src/psaux/psfont.c
|
||||||
* Software is furnished to do so, subject to the following conditions:
|
libfreetype/src/psaux/psfont.h
|
||||||
*
|
libfreetype/src/psaux/psft.c
|
||||||
* The above copyright notice and this permission notice shall be included in
|
libfreetype/src/psaux/psft.h
|
||||||
* all copies or substantial portions of the Software.
|
libfreetype/src/psaux/psglue.h
|
||||||
*
|
libfreetype/src/psaux/pshints.c
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
libfreetype/src/psaux/pshints.h
|
||||||
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
libfreetype/src/psaux/psintrp.c
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
libfreetype/src/psaux/psintrp.h
|
||||||
* THE COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY BE LIABLE FOR ANY
|
libfreetype/src/psaux/psread.c
|
||||||
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
|
libfreetype/src/psaux/psread.h
|
||||||
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
|
libfreetype/src/psaux/psstack.c
|
||||||
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
libfreetype/src/psaux/psstack.h
|
||||||
*/
|
libfreetype/src/psaux/pstypes.h
|
||||||
|
|
||||||
/**************************************************************************
|
Copyright (C) 2006-2014 Adobe Systems Incorporated.
|
||||||
*
|
|
||||||
* This file is based on code from bdf.c,v 1.22 2000/03/16 20:08:50
|
|
||||||
*
|
|
||||||
* taken from Mark Leisher's xmbdfed package
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
--- FreeType 2 PSaux module is covered by the following notices ---
|
|
||||||
|
|
||||||
Copyright 2006-2014 Adobe Systems Incorporated.
|
|
||||||
|
|
||||||
This software, and all works of authorship, whether in source or
|
This software, and all works of authorship, whether in source or
|
||||||
object code form as indicated by the copyright notice(s) included
|
object code form as indicated by the copyright notice(s) included
|
||||||
@ -1635,41 +1646,40 @@ have read and understood the terms and conditions of the
|
|||||||
FreeType Project License as well as those provided in this section,
|
FreeType Project License as well as those provided in this section,
|
||||||
and you accept them fully.
|
and you accept them fully.
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
--- FreeType 2 PSaux module is covered by the following notices ---
|
### MIT License
|
||||||
|
```
|
||||||
|
|
||||||
Copyright 2006-2014 Adobe Systems Incorporated.
|
---------------------------------
|
||||||
|
The below applies to the following file(s):
|
||||||
|
libfreetype/include/freetype/internal/fthash.h
|
||||||
|
libfreetype/src/base/fthash.c
|
||||||
|
|
||||||
This software, and all works of authorship, whether in source or
|
Copyright (C) 2000 Computing Research Labs, New Mexico State University
|
||||||
object code form as indicated by the copyright notice(s) included
|
Copyright (C) 2001-2015
|
||||||
herein (collectively, the "Work") is made available, and may only be
|
|
||||||
used, modified, and distributed under the FreeType Project License,
|
|
||||||
LICENSE.TXT. Additionally, subject to the terms and conditions of the
|
|
||||||
FreeType Project License, each contributor to the Work hereby grants
|
|
||||||
to any individual or legal entity exercising permissions granted by
|
|
||||||
the FreeType Project License and this section (hereafter, "You" or
|
|
||||||
"Your") a perpetual, worldwide, non-exclusive, no-charge,
|
|
||||||
royalty-free, irrevocable (except as stated in this section) patent
|
|
||||||
license to make, have made, use, offer to sell, sell, import, and
|
|
||||||
otherwise transfer the Work, where such license applies only to those
|
|
||||||
patent claims licensable by such contributor that are necessarily
|
|
||||||
infringed by their contribution(s) alone or by combination of their
|
|
||||||
contribution(s) with the Work to which such contribution(s) was
|
|
||||||
submitted. If You institute patent litigation against any entity
|
|
||||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
|
||||||
the Work or a contribution incorporated within the Work constitutes
|
|
||||||
direct or contributory patent infringement, then any patent licenses
|
|
||||||
granted to You under this License for that Work shall terminate as of
|
|
||||||
the date such litigation is filed.
|
|
||||||
|
|
||||||
By using, modifying, or distributing the Work you indicate that you
|
Francesco Zappa Nardelli
|
||||||
have read and understood the terms and conditions of the
|
|
||||||
FreeType Project License as well as those provided in this section,
|
Permission is hereby granted, free of charge, to any person obtaining a
|
||||||
and you accept them fully.
|
copy of this software and associated documentation files (the "Software"),
|
||||||
|
to deal in the Software without restriction, including without limitation
|
||||||
|
the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||||
|
and/or sell copies of the Software, and to permit persons to whom the
|
||||||
|
Software is furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
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 COMPUTING RESEARCH LAB OR NEW MEXICO STATE UNIVERSITY 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.
|
||||||
|
|
||||||
#########################################################################
|
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,6 @@ src/java.desktop/share/legal/freetype.md
|
|||||||
|
|
||||||
When updating specify --with-freetype=bundled to test builds to
|
When updating specify --with-freetype=bundled to test builds to
|
||||||
expose build issues.
|
expose build issues.
|
||||||
This is important because presently on Linux and Solaris the build
|
This is important because presently on Linux the build
|
||||||
defaults to linking against the system library and does not attempt
|
defaults to linking against the system library and does not attempt
|
||||||
to compile the sources.
|
to compile the sources.
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* ANSI-specific configuration file (specification only).
|
* ANSI-specific configuration file (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Build macros of the FreeType 2 library.
|
* Build macros of the FreeType 2 library.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -777,6 +777,18 @@
|
|||||||
#define FT_COLOR_H <freetype/ftcolor.h>
|
#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. */
|
/* These header files don't need to be included by the user. */
|
||||||
|
|||||||
@ -19,12 +19,15 @@ FT_USE_MODULE( FT_Driver_ClassRec, t1cid_driver_class )
|
|||||||
// FT_USE_MODULE( FT_Driver_ClassRec, t42_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, winfnt_driver_class )
|
||||||
// FT_USE_MODULE( FT_Driver_ClassRec, pcf_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, psaux_module_class )
|
||||||
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
|
FT_USE_MODULE( FT_Module_Class, psnames_module_class )
|
||||||
FT_USE_MODULE( FT_Module_Class, pshinter_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_Module_Class, sfnt_module_class )
|
||||||
FT_USE_MODULE( FT_Renderer_Class, ft_smooth_renderer_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 */
|
/* EOF */
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* User-selectable configuration macros (specification only).
|
* User-selectable configuration macros (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -105,8 +105,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
|
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
|
||||||
* cff:no-stem-darkening=1 \
|
* cff:no-stem-darkening=1
|
||||||
* autofitter:warping=1
|
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@ -220,6 +219,10 @@ FT_BEGIN_HEADER
|
|||||||
* If you use a build system like cmake or the `configure` script,
|
* If you use a build system like cmake or the `configure` script,
|
||||||
* options set by those programs have precedence, overwriting the value
|
* options set by those programs have precedence, overwriting the value
|
||||||
* here with the configured one.
|
* 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 */
|
/* #define FT_CONFIG_OPTION_SYSTEM_ZLIB */
|
||||||
|
|
||||||
@ -431,6 +434,23 @@ FT_BEGIN_HEADER
|
|||||||
/* #define FT_DEBUG_LEVEL_TRACE */
|
/* #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
|
* Autofitter debugging
|
||||||
@ -441,9 +461,9 @@ FT_BEGIN_HEADER
|
|||||||
* while compiling in 'release' mode):
|
* while compiling in 'release' mode):
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* _af_debug_disable_horz_hints
|
* af_debug_disable_horz_hints_
|
||||||
* _af_debug_disable_vert_hints
|
* af_debug_disable_vert_hints_
|
||||||
* _af_debug_disable_blue_hints
|
* af_debug_disable_blue_hints_
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Additionally, the following functions provide dumps of various
|
* Additionally, the following functions provide dumps of various
|
||||||
@ -460,7 +480,7 @@ FT_BEGIN_HEADER
|
|||||||
* As an argument, they use another global variable:
|
* As an argument, they use another global variable:
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* _af_debug_hints
|
* af_debug_hints_
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* Please have a look at the `ftgrid` demo program to see how those
|
* Please have a look at the `ftgrid` demo program to see how those
|
||||||
@ -507,6 +527,20 @@ FT_BEGIN_HEADER
|
|||||||
#undef FT_CONFIG_OPTION_USE_MODULE_ERRORS
|
#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
|
* Error Strings
|
||||||
@ -550,12 +584,12 @@ FT_BEGIN_HEADER
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Define `TT_CONFIG_OPTION_POSTSCRIPT_NAMES` if you want to be able to
|
* Define `TT_CONFIG_OPTION_POSTSCRIPT_NAMES` if you want to be able to
|
||||||
* load and enumerate the glyph Postscript names in a TrueType or OpenType
|
* load and enumerate Postscript names of glyphs in a TrueType or OpenType
|
||||||
* file.
|
* file.
|
||||||
*
|
*
|
||||||
* Note that when you do not compile the 'psnames' module by undefining the
|
* Note that if you do not compile the 'psnames' module by undefining the
|
||||||
* above `FT_CONFIG_OPTION_POSTSCRIPT_NAMES`, the 'sfnt' module will
|
* above `FT_CONFIG_OPTION_POSTSCRIPT_NAMES` macro, the 'sfnt' module will
|
||||||
* contain additional code used to read the PS Names table from a font.
|
* contain additional code to read the PostScript name table from a font.
|
||||||
*
|
*
|
||||||
* (By default, the module uses 'psnames' to extract glyph names.)
|
* (By default, the module uses 'psnames' to extract glyph names.)
|
||||||
*/
|
*/
|
||||||
@ -627,36 +661,12 @@ FT_BEGIN_HEADER
|
|||||||
* not) instructions in a certain way so that all TrueType fonts look like
|
* not) instructions in a certain way so that all TrueType fonts look like
|
||||||
* they do in a Windows ClearType (DirectWrite) environment. See [1] for a
|
* they do in a Windows ClearType (DirectWrite) environment. See [1] for a
|
||||||
* technical overview on what this means. See `ttinterp.h` for more
|
* technical overview on what this means. See `ttinterp.h` for more
|
||||||
* details on the LEAN option.
|
* details on this option.
|
||||||
*
|
*
|
||||||
* There are three possible values.
|
* The new default mode focuses on applying a minimal set of rules to all
|
||||||
*
|
* fonts indiscriminately so that modern and web fonts render well while
|
||||||
* Value 1:
|
* legacy fonts render okay. The corresponding interpreter version is v40.
|
||||||
* This value is associated with the 'Infinality' moniker, contributed by
|
* The so-called Infinality mode (v38) is no longer available in FreeType.
|
||||||
* an individual nicknamed Infinality with the goal of making TrueType
|
|
||||||
* fonts render better than on Windows. A high amount of configurability
|
|
||||||
* and flexibility, down to rules for single glyphs in fonts, but also
|
|
||||||
* very slow. Its experimental and slow nature and the original
|
|
||||||
* developer losing interest meant that this option was never enabled in
|
|
||||||
* default builds.
|
|
||||||
*
|
|
||||||
* The corresponding interpreter version is v38.
|
|
||||||
*
|
|
||||||
* Value 2:
|
|
||||||
* The new default mode for the TrueType driver. The Infinality code
|
|
||||||
* base was stripped to the bare minimum and all configurability removed
|
|
||||||
* in the name of speed and simplicity. The configurability was mainly
|
|
||||||
* aimed at legacy fonts like 'Arial', 'Times New Roman', or 'Courier'.
|
|
||||||
* Legacy fonts are fonts that modify vertical stems to achieve clean
|
|
||||||
* black-and-white bitmaps. The new mode focuses on applying a minimal
|
|
||||||
* set of rules to all fonts indiscriminately so that modern and web
|
|
||||||
* fonts render well while legacy fonts render okay.
|
|
||||||
*
|
|
||||||
* The corresponding interpreter version is v40.
|
|
||||||
*
|
|
||||||
* Value 3:
|
|
||||||
* Compile both, making both v38 and v40 available (the latter is the
|
|
||||||
* default).
|
|
||||||
*
|
*
|
||||||
* By undefining these, you get rendering behavior like on Windows without
|
* By undefining these, you get rendering behavior like on Windows without
|
||||||
* ClearType, i.e., Windows XP without ClearType enabled and Win9x
|
* ClearType, i.e., Windows XP without ClearType enabled and Win9x
|
||||||
@ -671,9 +681,7 @@ FT_BEGIN_HEADER
|
|||||||
* [1]
|
* [1]
|
||||||
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
|
* https://www.microsoft.com/typography/cleartype/truetypecleartype.aspx
|
||||||
*/
|
*/
|
||||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING 1 */
|
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
||||||
#define TT_CONFIG_OPTION_SUBPIXEL_HINTING 2
|
|
||||||
/* #define TT_CONFIG_OPTION_SUBPIXEL_HINTING ( 1 | 2 ) */
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -705,6 +713,24 @@ FT_BEGIN_HEADER
|
|||||||
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#define TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* Define `TT_CONFIG_OPTION_NO_BORING_EXPANSION` if you want to exclude
|
||||||
|
* support for 'boring' OpenType specification expansions.
|
||||||
|
*
|
||||||
|
* https://github.com/harfbuzz/boring-expansion-spec
|
||||||
|
*
|
||||||
|
* Right now, the following features are covered:
|
||||||
|
*
|
||||||
|
* - 'avar' version 2.0
|
||||||
|
*
|
||||||
|
* Most likely, this is a temporary configuration option to be removed in
|
||||||
|
* the near future, since it is assumed that eventually those features are
|
||||||
|
* added to the OpenType standard.
|
||||||
|
*/
|
||||||
|
/* #define TT_CONFIG_OPTION_NO_BORING_EXPANSION */
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Define `TT_CONFIG_OPTION_BDF` if you want to include support for an
|
* Define `TT_CONFIG_OPTION_BDF` if you want to include support for an
|
||||||
@ -731,6 +757,22 @@ FT_BEGIN_HEADER
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* Option `TT_CONFIG_OPTION_GPOS_KERNING` enables a basic GPOS kerning
|
||||||
|
* implementation (for TrueType fonts only). With this defined, FreeType
|
||||||
|
* is able to get kerning pair data from the GPOS 'kern' feature as well as
|
||||||
|
* legacy 'kern' tables; without this defined, FreeType will only be able
|
||||||
|
* to use legacy 'kern' tables.
|
||||||
|
*
|
||||||
|
* Note that FreeType does not support more advanced GPOS layout features;
|
||||||
|
* even the 'kern' feature implemented here doesn't handle more
|
||||||
|
* sophisticated kerning variants. Use a higher-level library like
|
||||||
|
* HarfBuzz instead for that.
|
||||||
|
*/
|
||||||
|
/* #define TT_CONFIG_OPTION_GPOS_KERNING */
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/**** ****/
|
/**** ****/
|
||||||
@ -892,24 +934,6 @@ FT_BEGIN_HEADER
|
|||||||
#endif
|
#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.
|
* Use TrueType-like size metrics for 'light' auto-hinting.
|
||||||
@ -943,21 +967,29 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The next three macros are defined if native TrueType hinting is
|
* The next two macros are defined if native TrueType hinting is
|
||||||
* requested by the definitions above. Don't change this.
|
* requested by the definitions above. Don't change this.
|
||||||
*/
|
*/
|
||||||
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||||
#define TT_USE_BYTECODE_INTERPRETER
|
#define TT_USE_BYTECODE_INTERPRETER
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
||||||
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 1
|
|
||||||
#define TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if TT_CONFIG_OPTION_SUBPIXEL_HINTING & 2
|
|
||||||
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
#define TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#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
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -989,8 +1021,8 @@ FT_BEGIN_HEADER
|
|||||||
#error "Invalid CFF darkening parameters!"
|
#error "Invalid CFF darkening parameters!"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
FT_END_HEADER
|
|
||||||
|
|
||||||
|
FT_END_HEADER
|
||||||
|
|
||||||
#endif /* FTOPTION_H_ */
|
#endif /* FTOPTION_H_ */
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* ANSI-specific library and header configuration file (specification
|
* ANSI-specific library and header configuration file (specification
|
||||||
* only).
|
* only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002-2020 by
|
* Copyright (C) 2002-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -43,7 +43,8 @@
|
|||||||
*
|
*
|
||||||
* `UINT_MAX` and `ULONG_MAX` are used to automatically compute the size of
|
* `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
|
* `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
|
* 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
|
* 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_MIN LONG_MIN
|
||||||
#define FT_LONG_MAX LONG_MAX
|
#define FT_LONG_MAX LONG_MAX
|
||||||
#define FT_ULONG_MAX ULONG_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
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -101,13 +111,13 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
#define FT_FILE FILE
|
#define FT_FILE FILE
|
||||||
#define ft_fclose fclose
|
#define ft_fclose fclose
|
||||||
#define ft_fopen fopen
|
#define ft_fopen fopen
|
||||||
#define ft_fread fread
|
#define ft_fread fread
|
||||||
#define ft_fseek fseek
|
#define ft_fseek fseek
|
||||||
#define ft_ftell ftell
|
#define ft_ftell ftell
|
||||||
#define ft_sprintf sprintf
|
#define ft_snprintf snprintf
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType integer types definitions.
|
* FreeType integer types definitions.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -60,6 +60,18 @@
|
|||||||
|
|
||||||
#endif /* !defined(FT_SIZEOF_LONG) */
|
#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:
|
* @section:
|
||||||
@ -174,15 +186,17 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
/* determine whether we have a 64-bit `int` type for platforms without */
|
/* determine whether we have a 64-bit integer type */
|
||||||
/* Autoconf */
|
|
||||||
#if FT_SIZEOF_LONG == ( 64 / FT_CHAR_BIT )
|
#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_INT64 long
|
||||||
#define FT_UINT64 unsigned 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
|
* 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 )
|
#elif !defined( __STDC__ ) || defined( FT_CONFIG_OPTION_FORCE_INT64 )
|
||||||
|
|
||||||
#if defined( __STDC_VERSION__ ) && __STDC_VERSION__ >= 199901L
|
#if defined( _MSC_VER ) && _MSC_VER >= 900 /* Visual C++ (and Intel C++) */
|
||||||
|
|
||||||
#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++) */
|
|
||||||
|
|
||||||
/* this compiler provides the `__int64` type */
|
/* this compiler provides the `__int64` type */
|
||||||
#define FT_LONG64
|
|
||||||
#define FT_INT64 __int64
|
#define FT_INT64 __int64
|
||||||
#define FT_UINT64 unsigned __int64
|
#define FT_UINT64 unsigned __int64
|
||||||
|
|
||||||
@ -211,32 +218,30 @@
|
|||||||
/* to test the compiler version. */
|
/* to test the compiler version. */
|
||||||
|
|
||||||
/* this compiler provides the `__int64` type */
|
/* this compiler provides the `__int64` type */
|
||||||
#define FT_LONG64
|
|
||||||
#define FT_INT64 __int64
|
#define FT_INT64 __int64
|
||||||
#define FT_UINT64 unsigned __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 */
|
#elif defined( __MWERKS__ ) /* Metrowerks CodeWarrior */
|
||||||
|
|
||||||
#define FT_LONG64
|
|
||||||
#define FT_INT64 long long int
|
#define FT_INT64 long long int
|
||||||
#define FT_UINT64 unsigned long long int
|
#define FT_UINT64 unsigned long long int
|
||||||
|
|
||||||
#elif defined( __GNUC__ )
|
#elif defined( __GNUC__ )
|
||||||
|
|
||||||
/* GCC provides the `long long` type */
|
/* GCC provides the `long long` type */
|
||||||
#define FT_LONG64
|
|
||||||
#define FT_INT64 long long int
|
#define FT_INT64 long long int
|
||||||
#define FT_UINT64 unsigned long long int
|
#define FT_UINT64 unsigned long long int
|
||||||
|
|
||||||
#endif /* __STDC_VERSION__ >= 199901L */
|
#endif /* !__STDC__ */
|
||||||
|
|
||||||
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
|
#endif /* FT_SIZEOF_LONG == (64 / FT_CHAR_BIT) */
|
||||||
|
|
||||||
#ifdef FT_LONG64
|
#ifdef FT_INT64
|
||||||
typedef FT_INT64 FT_Int64;
|
typedef FT_INT64 FT_Int64;
|
||||||
typedef FT_UINT64 FT_UInt64;
|
typedef FT_UINT64 FT_UInt64;
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Mac/OS X support configuration header.
|
* Mac/OS X support configuration header.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Define a set of compiler macros used in public FreeType headers.
|
* Define a set of compiler macros used in public FreeType headers.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2020 by
|
* Copyright (C) 2020-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -103,6 +103,7 @@ FT_BEGIN_HEADER
|
|||||||
*/
|
*/
|
||||||
#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
|
#define FT_EXPORT( x ) FT_PUBLIC_FUNCTION_ATTRIBUTE extern x
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* `FT_UNUSED` indicates that a given parameter is not used -- this is
|
* `FT_UNUSED` indicates that a given parameter is not used -- this is
|
||||||
* only used to get rid of unpleasant compiler warnings.
|
* only used to get rid of unpleasant compiler warnings.
|
||||||
@ -115,6 +116,23 @@ FT_BEGIN_HEADER
|
|||||||
#endif
|
#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
|
FT_END_HEADER
|
||||||
|
|
||||||
#endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */
|
#endif /* FREETYPE_CONFIG_PUBLIC_MACROS_H_ */
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Quick computation of advance widths (specification only).
|
* Quick computation of advance widths (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2020 by
|
* Copyright (C) 2008-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType exact bbox computation (specification).
|
* FreeType exact bbox computation (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType API for accessing BDF-specific strings (specification).
|
* FreeType API for accessing BDF-specific strings (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002-2020 by
|
* Copyright (C) 2002-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType utility functions for bitmaps (specification).
|
* FreeType utility functions for bitmaps (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004-2020 by
|
* Copyright (C) 2004-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -15,6 +15,7 @@
|
|||||||
* General Remarks
|
* General Remarks
|
||||||
*
|
*
|
||||||
* @sections:
|
* @sections:
|
||||||
|
* preamble
|
||||||
* header_inclusion
|
* header_inclusion
|
||||||
* user_allocation
|
* user_allocation
|
||||||
*
|
*
|
||||||
@ -30,9 +31,28 @@
|
|||||||
* Core API
|
* Core API
|
||||||
*
|
*
|
||||||
* @sections:
|
* @sections:
|
||||||
* version
|
|
||||||
* basic_types
|
* basic_types
|
||||||
* base_interface
|
* library_setup
|
||||||
|
* face_creation
|
||||||
|
* font_testing_macros
|
||||||
|
* sizing_and_scaling
|
||||||
|
* glyph_retrieval
|
||||||
|
* character_mapping
|
||||||
|
* information_retrieval
|
||||||
|
* other_api_data
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @chapter:
|
||||||
|
* extended_api
|
||||||
|
*
|
||||||
|
* @title:
|
||||||
|
* Extended API
|
||||||
|
*
|
||||||
|
* @sections:
|
||||||
* glyph_variants
|
* glyph_variants
|
||||||
* color_management
|
* color_management
|
||||||
* layer_management
|
* layer_management
|
||||||
@ -61,6 +81,7 @@
|
|||||||
* cid_fonts
|
* cid_fonts
|
||||||
* pfr_fonts
|
* pfr_fonts
|
||||||
* winfnt_fonts
|
* winfnt_fonts
|
||||||
|
* svg_fonts
|
||||||
* font_formats
|
* font_formats
|
||||||
* gasp_table
|
* gasp_table
|
||||||
*
|
*
|
||||||
@ -81,6 +102,7 @@
|
|||||||
* t1_cid_driver
|
* t1_cid_driver
|
||||||
* tt_driver
|
* tt_driver
|
||||||
* pcf_driver
|
* pcf_driver
|
||||||
|
* ot_svg_driver
|
||||||
* properties
|
* properties
|
||||||
* parameter_tags
|
* parameter_tags
|
||||||
* lcd_rendering
|
* lcd_rendering
|
||||||
@ -123,6 +145,7 @@
|
|||||||
* gzip
|
* gzip
|
||||||
* lzw
|
* lzw
|
||||||
* bzip2
|
* bzip2
|
||||||
|
* debugging_apis
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType API for accessing CID font information (specification).
|
* FreeType API for accessing CID font information (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2020 by
|
* Copyright (C) 2007-2024 by
|
||||||
* Dereg Clegg and Michael Toftdal.
|
* Dereg Clegg and Michael Toftdal.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType API for controlling driver modules (specification only).
|
* FreeType API for controlling driver modules (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-2020 by
|
* Copyright (C) 2017-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -53,10 +53,10 @@ FT_BEGIN_HEADER
|
|||||||
* reasons.
|
* reasons.
|
||||||
*
|
*
|
||||||
* Available properties are @increase-x-height, @no-stem-darkening
|
* Available properties are @increase-x-height, @no-stem-darkening
|
||||||
* (experimental), @darkening-parameters (experimental), @warping
|
* (experimental), @darkening-parameters (experimental),
|
||||||
* (experimental), @glyph-to-script-map (experimental), @fallback-script
|
* @glyph-to-script-map (experimental), @fallback-script (experimental),
|
||||||
* (experimental), and @default-script (experimental), as documented in
|
* and @default-script (experimental), as documented in the @properties
|
||||||
* the @properties section.
|
* section.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -84,15 +84,15 @@ FT_BEGIN_HEADER
|
|||||||
* @properties section.
|
* @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
|
* The rasterizer is positioning horizontal features (e.g., ascender
|
||||||
* height & x-height, or crossbars) on the pixel grid and minimizing the
|
* 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
|
* features (vertical stems) on the pixel grid without hinting, thus
|
||||||
* representing the stem position and weight accurately. Sometimes the
|
* representing the stem position and weight accurately. Sometimes the
|
||||||
* vertical stems may be only partially black. In this context,
|
* 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.
|
* borders, causing a fuzzy appearance.
|
||||||
*
|
*
|
||||||
* There are two principles behind this approach.
|
* 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
|
* sizes are comparable to kerning values and thus would be noticeable
|
||||||
* (and distracting) while reading if hinting were applied.
|
* (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
|
* screens: The pixel geometry of modern displays supplies three vertical
|
||||||
* subpixels as the eye moves horizontally across each visible pixel. On
|
* subpixels as the eye moves horizontally across each visible pixel. On
|
||||||
* devices where we can be certain this characteristic is present a
|
* 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
|
* weight. In Western writing systems this turns out to be the more
|
||||||
* critical direction anyway; the weights and spacing of vertical stems
|
* critical direction anyway; the weights and spacing of vertical stems
|
||||||
* (see above) are central to Armenian, Cyrillic, Greek, and Latin type
|
* (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
|
* of color (a necessary compromise when one doesn't know the screen
|
||||||
* characteristics), the unhinted vertical features preserve the design's
|
* characteristics), the unhinted vertical features preserve the design's
|
||||||
* weight and spacing much better than aliased type would.
|
* weight and spacing much better than aliased type would.
|
||||||
@ -134,7 +134,7 @@ FT_BEGIN_HEADER
|
|||||||
* each being rounded to the nearest pixel edge, taking care of overshoot
|
* each being rounded to the nearest pixel edge, taking care of overshoot
|
||||||
* suppression at small sizes, stem darkening, and scaling.
|
* suppression at small sizes, stem darkening, and scaling.
|
||||||
*
|
*
|
||||||
* Hstems (this is, hint values defined in the font to help align
|
* Hstems (that is, hint values defined in the font to help align
|
||||||
* horizontal features) that fall within a blue zone are said to be
|
* horizontal features) that fall within a blue zone are said to be
|
||||||
* 'captured' and are aligned to that zone. Uncaptured stems are moved
|
* 'captured' and are aligned to that zone. Uncaptured stems are moved
|
||||||
* in one of four ways, top edge up or down, bottom edge up or down.
|
* in one of four ways, top edge up or down, bottom edge up or down.
|
||||||
@ -212,16 +212,14 @@ FT_BEGIN_HEADER
|
|||||||
* @description:
|
* @description:
|
||||||
* While FreeType's TrueType driver doesn't expose API functions by
|
* While FreeType's TrueType driver doesn't expose API functions by
|
||||||
* itself, it is possible to control its behaviour with @FT_Property_Set
|
* itself, it is possible to control its behaviour with @FT_Property_Set
|
||||||
* and @FT_Property_Get. The following lists the available properties
|
* and @FT_Property_Get.
|
||||||
* together with the necessary macros and structures.
|
|
||||||
*
|
*
|
||||||
* 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
|
* To help understand the differences between interpreter versions, we
|
||||||
* the @properties section.
|
* introduce a list of definitions, kindly provided by Greg Hitchcock.
|
||||||
*
|
|
||||||
* We start with a list of definitions, kindly provided by Greg
|
|
||||||
* Hitchcock.
|
|
||||||
*
|
*
|
||||||
* _Bi-Level Rendering_
|
* _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:
|
* @section:
|
||||||
@ -362,12 +385,8 @@ FT_BEGIN_HEADER
|
|||||||
* The same holds for the Type~1 and CID modules if compiled with
|
* The same holds for the Type~1 and CID modules if compiled with
|
||||||
* `T1_CONFIG_OPTION_OLD_ENGINE`.
|
* `T1_CONFIG_OPTION_OLD_ENGINE`.
|
||||||
*
|
*
|
||||||
* For the 'cff' module, the default engine is 'freetype' if
|
* For the 'cff' module, the default engine is 'adobe'. For both the
|
||||||
* `CFF_CONFIG_OPTION_OLD_ENGINE` is defined, and 'adobe' otherwise.
|
* 'type1' and 't1cid' modules, the default engine is 'adobe', too.
|
||||||
*
|
|
||||||
* For both the 'type1' and 't1cid' modules, the default engine is
|
|
||||||
* 'freetype' if `T1_CONFIG_OPTION_OLD_ENGINE` is defined, and 'adobe'
|
|
||||||
* otherwise.
|
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* This property can be used with @FT_Property_Get also.
|
* This property can be used with @FT_Property_Get also.
|
||||||
@ -427,7 +446,7 @@ FT_BEGIN_HEADER
|
|||||||
* at smaller sizes.
|
* at smaller sizes.
|
||||||
*
|
*
|
||||||
* For the auto-hinter, stem-darkening is experimental currently and thus
|
* For the auto-hinter, stem-darkening is experimental currently and thus
|
||||||
* switched off by default (this is, `no-stem-darkening` is set to TRUE
|
* switched off by default (that is, `no-stem-darkening` is set to TRUE
|
||||||
* by default). Total consistency with the CFF driver is not achieved
|
* by default). Total consistency with the CFF driver is not achieved
|
||||||
* right now because the emboldening method differs and glyphs must be
|
* right now because the emboldening method differs and glyphs must be
|
||||||
* scaled down on the Y-axis to keep outline points inside their
|
* scaled down on the Y-axis to keep outline points inside their
|
||||||
@ -632,11 +651,8 @@ FT_BEGIN_HEADER
|
|||||||
* Windows~98; only grayscale and B/W rasterizing is supported.
|
* Windows~98; only grayscale and B/W rasterizing is supported.
|
||||||
*
|
*
|
||||||
* TT_INTERPRETER_VERSION_38 ::
|
* TT_INTERPRETER_VERSION_38 ::
|
||||||
* Version~38 corresponds to MS rasterizer v.1.9; it is roughly
|
* Version~38 is the same Version~40. The original 'Infinality' code is
|
||||||
* equivalent to the hinting provided by DirectWrite ClearType (as can
|
* no longer available.
|
||||||
* be found, for example, in the Internet Explorer~9 running on
|
|
||||||
* Windows~7). It is used in FreeType to select the 'Infinality'
|
|
||||||
* subpixel hinting code. The code may be removed in a future version.
|
|
||||||
*
|
*
|
||||||
* TT_INTERPRETER_VERSION_40 ::
|
* TT_INTERPRETER_VERSION_40 ::
|
||||||
* Version~40 corresponds to MS rasterizer v.2.1; it is roughly
|
* Version~40 corresponds to MS rasterizer v.2.1; it is roughly
|
||||||
@ -802,6 +818,113 @@ FT_BEGIN_HEADER
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @property:
|
||||||
|
* spread
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* This property of the 'sdf' and 'bsdf' renderers defines how the signed
|
||||||
|
* distance field (SDF) is represented in the output bitmap. The output
|
||||||
|
* values are calculated as follows, '128 * ( SDF / spread + 1 )', with
|
||||||
|
* the result clamped to the 8-bit range [0..255]. Therefore, 'spread'
|
||||||
|
* is also the maximum euclidean distance from the edge after which the
|
||||||
|
* values are clamped. The spread is specified in pixels with the
|
||||||
|
* default value of 8. For accurate SDF texture mapping (interpolation),
|
||||||
|
* the spread should be large enough to accommodate the target grid unit.
|
||||||
|
*
|
||||||
|
* @example:
|
||||||
|
* The following example code demonstrates how to set the SDF spread
|
||||||
|
* (omitting the error handling).
|
||||||
|
*
|
||||||
|
* ```
|
||||||
|
* FT_Library library;
|
||||||
|
* FT_Int spread = 2;
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* FT_Init_FreeType( &library );
|
||||||
|
*
|
||||||
|
* FT_Property_Set( library, "sdf", "spread", &spread );
|
||||||
|
* ```
|
||||||
|
*
|
||||||
|
* @note:
|
||||||
|
* 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
|
||||||
|
* intersects itself at some point; having these in your font
|
||||||
|
* definitely poses 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.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.11
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @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:
|
* @property:
|
||||||
@ -1166,48 +1289,18 @@ FT_BEGIN_HEADER
|
|||||||
* warping
|
* warping
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* **Experimental only**
|
* **Obsolete**
|
||||||
*
|
*
|
||||||
* If FreeType gets compiled with option `AF_CONFIG_OPTION_USE_WARPER` to
|
* This property was always experimental and probably never worked
|
||||||
* activate the warp hinting code in the auto-hinter, this property
|
* correctly. It was entirely removed from the FreeType~2 sources. This
|
||||||
* switches warping on and off.
|
* entry is only here for historical reference.
|
||||||
*
|
*
|
||||||
* Warping only works in 'normal' auto-hinting mode replacing it. The
|
* Warping only worked in 'normal' auto-hinting mode replacing it. The
|
||||||
* idea of the code is to slightly scale and shift a glyph along 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
|
* 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
|
* out a glyph's optimal scaling and shifting value, various parameter
|
||||||
* combinations are tried and scored.
|
* combinations were 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 );
|
|
||||||
* ```
|
|
||||||
*
|
*
|
||||||
* @since:
|
* @since:
|
||||||
* 2.6
|
* 2.6
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType error codes (specification).
|
* FreeType error codes (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002-2020 by
|
* Copyright (C) 2002-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -101,6 +101,8 @@
|
|||||||
"too many hints" )
|
"too many hints" )
|
||||||
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
|
FT_ERRORDEF_( Invalid_Pixel_Size, 0x17,
|
||||||
"invalid pixel size" )
|
"invalid pixel size" )
|
||||||
|
FT_ERRORDEF_( Invalid_SVG_Document, 0x18,
|
||||||
|
"invalid SVG document" )
|
||||||
|
|
||||||
/* handle errors */
|
/* handle errors */
|
||||||
|
|
||||||
@ -234,6 +236,8 @@
|
|||||||
"found FDEF or IDEF opcode in glyf bytecode" )
|
"found FDEF or IDEF opcode in glyf bytecode" )
|
||||||
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
|
FT_ERRORDEF_( Missing_Bitmap, 0x9D,
|
||||||
"missing bitmap in strike" )
|
"missing bitmap in strike" )
|
||||||
|
FT_ERRORDEF_( Missing_SVG_Hooks, 0x9E,
|
||||||
|
"SVG hooks have not been set" )
|
||||||
|
|
||||||
/* CFF, CID, and Type 1 errors */
|
/* CFF, CID, and Type 1 errors */
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType error code handling (specification).
|
* FreeType error code handling (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -29,7 +29,7 @@
|
|||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* The header file `fterrors.h` (which is automatically included by
|
* The header file `fterrors.h` (which is automatically included by
|
||||||
* `freetype.h` defines the handling of FreeType's enumeration
|
* `freetype.h`) defines the handling of FreeType's enumeration
|
||||||
* constants. It can also be used to generate error message strings
|
* constants. It can also be used to generate error message strings
|
||||||
* with a small macro trick explained below.
|
* with a small macro trick explained below.
|
||||||
*
|
*
|
||||||
@ -281,6 +281,8 @@ FT_BEGIN_HEADER
|
|||||||
FT_EXPORT( const char* )
|
FT_EXPORT( const char* )
|
||||||
FT_Error_String( FT_Error error_code );
|
FT_Error_String( FT_Error error_code );
|
||||||
|
|
||||||
|
/* */
|
||||||
|
|
||||||
FT_END_HEADER
|
FT_END_HEADER
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Support functions for font formats.
|
* Support functions for font formats.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002-2020 by
|
* Copyright (C) 2002-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Access of TrueType's 'gasp' table (specification).
|
* Access of TrueType's 'gasp' table (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2020 by
|
* Copyright (C) 2007-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType convenience functions to handle glyphs (specification).
|
* FreeType convenience functions to handle glyphs (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -126,7 +126,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* A handle to an object used to model a bitmap glyph image. This is a
|
* 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;
|
typedef struct FT_BitmapGlyphRec_* FT_BitmapGlyph;
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @fields:
|
* @fields:
|
||||||
* root ::
|
* root ::
|
||||||
* The root @FT_Glyph fields.
|
* The root fields of @FT_Glyph.
|
||||||
*
|
*
|
||||||
* left ::
|
* left ::
|
||||||
* The left-side bearing, i.e., the horizontal distance from the
|
* The left-side bearing, i.e., the horizontal distance from the
|
||||||
@ -181,7 +181,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* A handle to an object used to model an outline glyph image. This is a
|
* 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;
|
typedef struct FT_OutlineGlyphRec_* FT_OutlineGlyph;
|
||||||
|
|
||||||
@ -222,6 +222,92 @@ FT_BEGIN_HEADER
|
|||||||
} FT_OutlineGlyphRec;
|
} 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:
|
* @function:
|
||||||
@ -269,7 +355,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* aglyph ::
|
* aglyph ::
|
||||||
* A handle to the glyph object.
|
* A handle to the glyph object. `NULL` in case of error.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
@ -299,7 +385,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* target ::
|
* target ::
|
||||||
* A handle to the target glyph object. 0~in case of error.
|
* A handle to the target glyph object. `NULL` in case of error.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
@ -327,7 +413,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* delta ::
|
* delta ::
|
||||||
* A pointer to a 2d vector to apply. Coordinates are expressed in
|
* A pointer to a 2d vector to apply. Coordinates are expressed in
|
||||||
* 1/64th of a pixel.
|
* 1/64 of a pixel.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code (if not 0, the glyph format is not scalable).
|
* FreeType error code (if not 0, the glyph format is not scalable).
|
||||||
@ -337,9 +423,9 @@ FT_BEGIN_HEADER
|
|||||||
* vector.
|
* vector.
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error )
|
||||||
FT_Glyph_Transform( FT_Glyph glyph,
|
FT_Glyph_Transform( FT_Glyph glyph,
|
||||||
FT_Matrix* matrix,
|
const FT_Matrix* matrix,
|
||||||
FT_Vector* delta );
|
const FT_Vector* delta );
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -414,7 +500,7 @@ FT_BEGIN_HEADER
|
|||||||
* @output:
|
* @output:
|
||||||
* acbox ::
|
* acbox ::
|
||||||
* The glyph coordinate bounding box. Coordinates are expressed in
|
* The glyph coordinate bounding box. Coordinates are expressed in
|
||||||
* 1/64th of pixels if it is grid-fitted.
|
* 1/64 of pixels if it is grid-fitted.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* Coordinates are relative to the glyph origin, using the y~upwards
|
* Coordinates are relative to the glyph origin, using the y~upwards
|
||||||
@ -498,9 +584,9 @@ FT_BEGIN_HEADER
|
|||||||
* The glyph image is translated with the `origin` vector before
|
* The glyph image is translated with the `origin` vector before
|
||||||
* rendering.
|
* 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,
|
* _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;
|
* FT_Glyph glyph;
|
||||||
@ -517,7 +603,7 @@ FT_BEGIN_HEADER
|
|||||||
* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )
|
* if ( glyph->format != FT_GLYPH_FORMAT_BITMAP )
|
||||||
* {
|
* {
|
||||||
* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,
|
* error = FT_Glyph_To_Bitmap( &glyph, FT_RENDER_MODE_NORMAL,
|
||||||
* 0, 1 );
|
* 0, 1 );
|
||||||
* if ( error ) // `glyph' unchanged
|
* if ( error ) // `glyph' unchanged
|
||||||
* ...
|
* ...
|
||||||
* }
|
* }
|
||||||
@ -532,7 +618,7 @@ FT_BEGIN_HEADER
|
|||||||
* FT_Done_Glyph( glyph );
|
* 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]
|
* FT_Glyph glyphs[MAX_GLYPHS]
|
||||||
@ -569,10 +655,10 @@ FT_BEGIN_HEADER
|
|||||||
* ```
|
* ```
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error )
|
||||||
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
|
FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
|
||||||
FT_Render_Mode render_mode,
|
FT_Render_Mode render_mode,
|
||||||
FT_Vector* origin,
|
const FT_Vector* origin,
|
||||||
FT_Bool destroy );
|
FT_Bool destroy );
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -585,7 +671,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* glyph ::
|
* glyph ::
|
||||||
* A handle to the target glyph object.
|
* A handle to the target glyph object. Can be `NULL`.
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( void )
|
FT_EXPORT( void )
|
||||||
FT_Done_Glyph( FT_Glyph glyph );
|
FT_Done_Glyph( FT_Glyph glyph );
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Gzip-compressed stream support.
|
* Gzip-compressed stream support.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002-2020 by
|
* Copyright (C) 2002-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* FreeType glyph image formats and default raster interface
|
* FreeType glyph image formats and default raster interface
|
||||||
* (specification).
|
* (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -19,7 +19,12 @@
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* Note: A 'raster' is simply a scan-line converter, used to render
|
* Note: A 'raster' is simply a scan-line converter, used to render
|
||||||
* FT_Outlines into FT_Bitmaps.
|
* `FT_Outline`s into `FT_Bitmap`s.
|
||||||
|
*
|
||||||
|
* Note: This file can be used for `STANDALONE_` compilation of raster
|
||||||
|
* (B/W) and smooth (anti-aliased) renderers. Therefore, it must
|
||||||
|
* rely on standard variable types only instead of aliases in
|
||||||
|
* `fttypes.h`.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -28,11 +33,6 @@
|
|||||||
#define FTIMAGE_H_
|
#define FTIMAGE_H_
|
||||||
|
|
||||||
|
|
||||||
/* STANDALONE_ is from ftgrays.c */
|
|
||||||
#ifndef STANDALONE_
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
FT_BEGIN_HEADER
|
FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
@ -201,6 +201,11 @@ FT_BEGIN_HEADER
|
|||||||
#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
|
#define ft_pixel_mode_pal2 FT_PIXEL_MODE_GRAY2
|
||||||
#define ft_pixel_mode_pal4 FT_PIXEL_MODE_GRAY4
|
#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`. */
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -256,6 +261,12 @@ FT_BEGIN_HEADER
|
|||||||
* palette ::
|
* palette ::
|
||||||
* A typeless pointer to the bitmap palette; this field is intended for
|
* A typeless pointer to the bitmap palette; this field is intended for
|
||||||
* paletted pixel modes. Not used currently.
|
* paletted pixel modes. Not used currently.
|
||||||
|
*
|
||||||
|
* @note:
|
||||||
|
* `width` and `rows` refer to the *physical* size of the bitmap, not the
|
||||||
|
* *logical* one. For example, if @FT_Pixel_Mode is set to
|
||||||
|
* `FT_PIXEL_MODE_LCD`, the logical width is a just a third of the
|
||||||
|
* physical one.
|
||||||
*/
|
*/
|
||||||
typedef struct FT_Bitmap_
|
typedef struct FT_Bitmap_
|
||||||
{
|
{
|
||||||
@ -312,7 +323,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* If bit~2 is set, bits 5-7 contain the drop-out mode (as defined in
|
* If bit~2 is set, bits 5-7 contain the drop-out mode (as defined in
|
||||||
* the OpenType specification; the value is the same as the argument to
|
* the OpenType specification; the value is the same as the argument to
|
||||||
* the 'SCANMODE' instruction).
|
* the 'SCANTYPE' instruction).
|
||||||
*
|
*
|
||||||
* Bits 3 and~4 are reserved for internal purposes.
|
* Bits 3 and~4 are reserved for internal purposes.
|
||||||
*
|
*
|
||||||
@ -335,14 +346,14 @@ FT_BEGIN_HEADER
|
|||||||
*/
|
*/
|
||||||
typedef struct FT_Outline_
|
typedef struct FT_Outline_
|
||||||
{
|
{
|
||||||
short n_contours; /* number of contours in glyph */
|
unsigned short n_contours; /* number of contours in glyph */
|
||||||
short n_points; /* number of points in the glyph */
|
unsigned short n_points; /* number of points in the glyph */
|
||||||
|
|
||||||
FT_Vector* points; /* the outline's points */
|
FT_Vector* points; /* the outline's points */
|
||||||
char* tags; /* the points flags */
|
unsigned char* tags; /* the points flags */
|
||||||
short* contours; /* the contour end points */
|
unsigned short* contours; /* the contour end points */
|
||||||
|
|
||||||
int flags; /* outline masks */
|
int flags; /* outline masks */
|
||||||
|
|
||||||
} FT_Outline;
|
} FT_Outline;
|
||||||
|
|
||||||
@ -350,8 +361,8 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
/* Following limits must be consistent with */
|
/* Following limits must be consistent with */
|
||||||
/* FT_Outline.{n_contours,n_points} */
|
/* FT_Outline.{n_contours,n_points} */
|
||||||
#define FT_OUTLINE_CONTOURS_MAX SHRT_MAX
|
#define FT_OUTLINE_CONTOURS_MAX USHRT_MAX
|
||||||
#define FT_OUTLINE_POINTS_MAX SHRT_MAX
|
#define FT_OUTLINE_POINTS_MAX USHRT_MAX
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -401,11 +412,11 @@ FT_BEGIN_HEADER
|
|||||||
* information.
|
* information.
|
||||||
*
|
*
|
||||||
* FT_OUTLINE_OVERLAP ::
|
* FT_OUTLINE_OVERLAP ::
|
||||||
* This flag indicates that this outline contains overlapping contrours
|
* [Since 2.10.3] This flag indicates that this outline contains
|
||||||
* and the anti-aliased renderer should perform oversampling to
|
* overlapping contours and the anti-aliased renderer should perform
|
||||||
* mitigate possible artifacts. This flag should _not_ be set for
|
* oversampling to mitigate possible artifacts. This flag should _not_
|
||||||
* well designed glyphs without overlaps because it quadruples the
|
* be set for well designed glyphs without overlaps because it quadruples
|
||||||
* rendering time.
|
* the rendering time.
|
||||||
*
|
*
|
||||||
* FT_OUTLINE_HIGH_PRECISION ::
|
* FT_OUTLINE_HIGH_PRECISION ::
|
||||||
* This flag indicates that the scan-line converter should try to
|
* This flag indicates that the scan-line converter should try to
|
||||||
@ -428,8 +439,8 @@ FT_BEGIN_HEADER
|
|||||||
* rasterizer; see the `tags` field in @FT_Outline.
|
* rasterizer; see the `tags` field in @FT_Outline.
|
||||||
*
|
*
|
||||||
* Please refer to the description of the 'SCANTYPE' instruction in the
|
* Please refer to the description of the 'SCANTYPE' instruction in the
|
||||||
* OpenType specification (in file `ttinst1.doc`) how simple drop-outs,
|
* [OpenType specification](https://learn.microsoft.com/en-us/typography/opentype/spec/tt_instructions#scantype)
|
||||||
* smart drop-outs, and stubs are defined.
|
* how simple drop-outs, smart drop-outs, and stubs are defined.
|
||||||
*/
|
*/
|
||||||
#define FT_OUTLINE_NONE 0x0
|
#define FT_OUTLINE_NONE 0x0
|
||||||
#define FT_OUTLINE_OWNER 0x1
|
#define FT_OUTLINE_OWNER 0x1
|
||||||
@ -695,11 +706,13 @@ FT_BEGIN_HEADER
|
|||||||
* to get a simple enumeration without assigning special numbers.
|
* to get a simple enumeration without assigning special numbers.
|
||||||
*/
|
*/
|
||||||
#ifndef FT_IMAGE_TAG
|
#ifndef FT_IMAGE_TAG
|
||||||
#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
|
|
||||||
value = ( ( (unsigned long)_x1 << 24 ) | \
|
#define FT_IMAGE_TAG( value, _x1, _x2, _x3, _x4 ) \
|
||||||
( (unsigned long)_x2 << 16 ) | \
|
value = ( ( FT_STATIC_BYTE_CAST( unsigned long, _x1 ) << 24 ) | \
|
||||||
( (unsigned long)_x3 << 8 ) | \
|
( FT_STATIC_BYTE_CAST( unsigned long, _x2 ) << 16 ) | \
|
||||||
(unsigned long)_x4 )
|
( FT_STATIC_BYTE_CAST( unsigned long, _x3 ) << 8 ) | \
|
||||||
|
FT_STATIC_BYTE_CAST( unsigned long, _x4 ) )
|
||||||
|
|
||||||
#endif /* FT_IMAGE_TAG */
|
#endif /* FT_IMAGE_TAG */
|
||||||
|
|
||||||
|
|
||||||
@ -739,6 +752,10 @@ FT_BEGIN_HEADER
|
|||||||
* contours. Some Type~1 fonts, like those in the Hershey family,
|
* contours. Some Type~1 fonts, like those in the Hershey family,
|
||||||
* contain glyphs in this format. These are described as @FT_Outline,
|
* contain glyphs in this format. These are described as @FT_Outline,
|
||||||
* but FreeType isn't currently capable of rendering them correctly.
|
* 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_
|
typedef enum FT_Glyph_Format_
|
||||||
{
|
{
|
||||||
@ -747,7 +764,8 @@ FT_BEGIN_HEADER
|
|||||||
FT_IMAGE_TAG( FT_GLYPH_FORMAT_COMPOSITE, 'c', 'o', 'm', 'p' ),
|
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_BITMAP, 'b', 'i', 't', 's' ),
|
||||||
FT_IMAGE_TAG( FT_GLYPH_FORMAT_OUTLINE, 'o', 'u', 't', 'l' ),
|
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;
|
} FT_Glyph_Format;
|
||||||
|
|
||||||
@ -772,17 +790,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 +803,35 @@ FT_BEGIN_HEADER
|
|||||||
* How vectorial outlines are converted into bitmaps and pixmaps.
|
* How vectorial outlines are converted into bitmaps and pixmaps.
|
||||||
*
|
*
|
||||||
* @description:
|
* @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:
|
* @order:
|
||||||
* FT_Raster
|
|
||||||
* FT_Span
|
* FT_Span
|
||||||
* FT_SpanFunc
|
* FT_SpanFunc
|
||||||
*
|
|
||||||
* FT_Raster_Params
|
* FT_Raster_Params
|
||||||
* FT_RASTER_FLAG_XXX
|
* FT_RASTER_FLAG_XXX
|
||||||
*
|
*
|
||||||
|
* FT_Raster
|
||||||
* FT_Raster_NewFunc
|
* FT_Raster_NewFunc
|
||||||
* FT_Raster_DoneFunc
|
* FT_Raster_DoneFunc
|
||||||
* FT_Raster_ResetFunc
|
* FT_Raster_ResetFunc
|
||||||
@ -816,26 +842,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:
|
* @struct:
|
||||||
* FT_Span
|
* FT_Span
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* A structure used to model a single span of gray pixels when rendering
|
* A structure to model a single span of consecutive pixels when
|
||||||
* an anti-aliased bitmap.
|
* rendering an anti-aliased bitmap.
|
||||||
*
|
*
|
||||||
* @fields:
|
* @fields:
|
||||||
* x ::
|
* x ::
|
||||||
@ -852,8 +866,8 @@ FT_BEGIN_HEADER
|
|||||||
* This structure is used by the span drawing callback type named
|
* This structure is used by the span drawing callback type named
|
||||||
* @FT_SpanFunc that takes the y~coordinate of the span as a parameter.
|
* @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
|
* The anti-aliased rasterizer produces coverage values from 0 to 255,
|
||||||
* values, the callback function has to reduce them.
|
* that is, from completely transparent to completely opaque.
|
||||||
*/
|
*/
|
||||||
typedef struct FT_Span_
|
typedef struct FT_Span_
|
||||||
{
|
{
|
||||||
@ -871,8 +885,8 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* A function used as a call-back by the anti-aliased renderer in order
|
* 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
|
* to let client applications draw themselves the pixel spans on each
|
||||||
* each scan line.
|
* scan line.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* y ::
|
* y ::
|
||||||
@ -888,11 +902,12 @@ FT_BEGIN_HEADER
|
|||||||
* User-supplied data that is passed to the callback.
|
* User-supplied data that is passed to the callback.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* This callback allows client applications to directly render the gray
|
* This callback allows client applications to directly render the spans
|
||||||
* spans of the anti-aliased bitmap to any kind of surfaces.
|
* of the anti-aliased bitmap to any kind of surfaces.
|
||||||
*
|
*
|
||||||
* This can be used to write anti-aliased outlines directly to a given
|
* 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
|
typedef void
|
||||||
(*FT_SpanFunc)( int y,
|
(*FT_SpanFunc)( int y,
|
||||||
@ -962,11 +977,17 @@ FT_BEGIN_HEADER
|
|||||||
* will be clipped to a box specified in the `clip_box` field of the
|
* will be clipped to a box specified in the `clip_box` field of the
|
||||||
* @FT_Raster_Params structure. Otherwise, the `clip_box` is
|
* @FT_Raster_Params structure. Otherwise, the `clip_box` is
|
||||||
* effectively set to the bounding box and all spans are generated.
|
* 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_DEFAULT 0x0
|
||||||
#define FT_RASTER_FLAG_AA 0x1
|
#define FT_RASTER_FLAG_AA 0x1
|
||||||
#define FT_RASTER_FLAG_DIRECT 0x2
|
#define FT_RASTER_FLAG_DIRECT 0x2
|
||||||
#define FT_RASTER_FLAG_CLIP 0x4
|
#define FT_RASTER_FLAG_CLIP 0x4
|
||||||
|
#define FT_RASTER_FLAG_SDF 0x8
|
||||||
|
|
||||||
/* these constants are deprecated; use the corresponding */
|
/* these constants are deprecated; use the corresponding */
|
||||||
/* `FT_RASTER_FLAG_XXX` values instead */
|
/* `FT_RASTER_FLAG_XXX` values instead */
|
||||||
@ -1047,6 +1068,23 @@ FT_BEGIN_HEADER
|
|||||||
} FT_Raster_Params;
|
} 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:
|
* @functype:
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType incremental loading (specification).
|
* FreeType incremental loading (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002-2020 by
|
* Copyright (C) 2002-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -213,9 +213,14 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* A function used to retrieve the basic metrics of a given glyph index
|
* A function used to retrieve the basic metrics of a given glyph index
|
||||||
* before accessing its data. This is necessary because, in certain
|
* before accessing its data. This allows for handling font types such
|
||||||
* formats like TrueType, the metrics are stored in a different place
|
* as PCL~XL Format~1, Class~2 downloaded TrueType fonts, where the glyph
|
||||||
* from the glyph images proper.
|
* 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:
|
* @input:
|
||||||
* incremental ::
|
* incremental ::
|
||||||
@ -235,7 +240,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* ametrics ::
|
* ametrics ::
|
||||||
* The replacement glyph metrics in font units.
|
* The glyph metrics in font units.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
@ -264,7 +269,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* get_glyph_metrics ::
|
* get_glyph_metrics ::
|
||||||
* The function to get glyph metrics. May be null if the font does not
|
* 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_
|
typedef struct FT_Incremental_FuncsRec_
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* FreeType API for color filtering of subpixel bitmap glyphs
|
* FreeType API for color filtering of subpixel bitmap glyphs
|
||||||
* (specification).
|
* (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 by
|
* Copyright (C) 2006-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -55,13 +55,12 @@ FT_BEGIN_HEADER
|
|||||||
* ClearType-style LCD rendering exploits the color-striped structure of
|
* ClearType-style LCD rendering exploits the color-striped structure of
|
||||||
* LCD pixels, increasing the available resolution in the direction of
|
* LCD pixels, increasing the available resolution in the direction of
|
||||||
* the stripe (usually horizontal RGB) by a factor of~3. Using the
|
* 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
|
* especially when rendering thin features. Indeed, to produce
|
||||||
* black-on-white text, the nearby color subpixels must be dimmed
|
* black-on-white text, the nearby color subpixels must be dimmed
|
||||||
* equally.
|
* evenly. Therefore, an equalizing 5-tap FIR filter should be applied
|
||||||
*
|
* to subpixel coverages regardless of pixel boundaries and should have
|
||||||
* A good 5-tap FIR filter should be applied to subpixel coverages
|
* these properties:
|
||||||
* regardless of pixel boundaries and should have these properties:
|
|
||||||
*
|
*
|
||||||
* 1. It should be symmetrical, like {~a, b, c, b, a~}, to avoid
|
* 1. It should be symmetrical, like {~a, b, c, b, a~}, to avoid
|
||||||
* any shifts in appearance.
|
* any shifts in appearance.
|
||||||
@ -84,7 +83,7 @@ FT_BEGIN_HEADER
|
|||||||
* Harmony LCD rendering is suitable to panels with any regular subpixel
|
* Harmony LCD rendering is suitable to panels with any regular subpixel
|
||||||
* structure, not just monitors with 3 color striped subpixels, as long
|
* structure, not just monitors with 3 color striped subpixels, as long
|
||||||
* as the color subpixels have fixed positions relative to the pixel
|
* 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
|
* after shifting the outline opposite to the subpixel shift so that the
|
||||||
* coverage maps are aligned. This method is immune to color fringes
|
* coverage maps are aligned. This method is immune to color fringes
|
||||||
* because the shifts do not change integral coverage.
|
* because the shifts do not change integral coverage.
|
||||||
@ -101,9 +100,9 @@ FT_BEGIN_HEADER
|
|||||||
* clockwise. Harmony with default LCD geometry is equivalent to
|
* clockwise. Harmony with default LCD geometry is equivalent to
|
||||||
* ClearType with light filter.
|
* ClearType with light filter.
|
||||||
*
|
*
|
||||||
* As a result of ClearType filtering or Harmony rendering, the
|
* As a result of ClearType filtering or Harmony shifts, the resulting
|
||||||
* dimensions of LCD bitmaps can be either wider or taller than the
|
* dimensions of LCD bitmaps can be slightly wider or taller than the
|
||||||
* dimensions of the corresponding outline with regard to the pixel grid.
|
* dimensions the original outline with regard to the pixel grid.
|
||||||
* For example, for @FT_RENDER_MODE_LCD, the filter adds 2~subpixels to
|
* 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
|
* the left, and 2~subpixels to the right. The bitmap offset values are
|
||||||
* adjusted accordingly, so clients shouldn't need to modify their layout
|
* adjusted accordingly, so clients shouldn't need to modify their layout
|
||||||
@ -138,11 +137,11 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* FT_LCD_FILTER_DEFAULT ::
|
* FT_LCD_FILTER_DEFAULT ::
|
||||||
* This is a beveled, normalized, and color-balanced five-tap filter
|
* This is a beveled, normalized, and color-balanced five-tap filter
|
||||||
* with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256th units.
|
* with weights of [0x08 0x4D 0x56 0x4D 0x08] in 1/256 units.
|
||||||
*
|
*
|
||||||
* FT_LCD_FILTER_LIGHT ::
|
* FT_LCD_FILTER_LIGHT ::
|
||||||
* this is a boxy, normalized, and color-balanced three-tap filter with
|
* this is a boxy, normalized, and color-balanced three-tap filter with
|
||||||
* weights of [0x00 0x55 0x56 0x55 0x00] in 1/256th units.
|
* weights of [0x00 0x55 0x56 0x55 0x00] in 1/256 units.
|
||||||
*
|
*
|
||||||
* FT_LCD_FILTER_LEGACY ::
|
* FT_LCD_FILTER_LEGACY ::
|
||||||
* FT_LCD_FILTER_LEGACY1 ::
|
* FT_LCD_FILTER_LEGACY1 ::
|
||||||
@ -227,7 +226,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* weights ::
|
* weights ::
|
||||||
* A pointer to an array; the function copies the first five bytes and
|
* A pointer to an array; the function copies the first five bytes and
|
||||||
* uses them to specify the filter weights in 1/256th units.
|
* uses them to specify the filter weights in 1/256 units.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Generic list support for FreeType (specification).
|
* Generic list support for FreeType (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -0,0 +1,184 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
*
|
||||||
|
* ftlogging.h
|
||||||
|
*
|
||||||
|
* Additional debugging APIs.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2020-2024 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 */
|
||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Additional Mac-specific API.
|
* Additional Mac-specific API.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
|
* Just van Rossum, David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType Multiple Master font interface (specification).
|
* FreeType Multiple Master font interface (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -19,8 +19,13 @@
|
|||||||
#ifndef FTMM_H_
|
#ifndef FTMM_H_
|
||||||
#define FTMM_H_
|
#define FTMM_H_
|
||||||
|
|
||||||
|
#include <freetype/freetype.h>
|
||||||
|
|
||||||
#include <freetype/t1tables.h>
|
#ifdef FREETYPE_H
|
||||||
|
#error "freetype.h of FreeType 1 has been loaded!"
|
||||||
|
#error "Please fix the directory search order for header files"
|
||||||
|
#error "so that freetype.h of FreeType 2 is found first."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
FT_BEGIN_HEADER
|
FT_BEGIN_HEADER
|
||||||
@ -47,9 +52,36 @@ FT_BEGIN_HEADER
|
|||||||
* MM fonts, others will work with all three types. They are similar
|
* MM fonts, others will work with all three types. They are similar
|
||||||
* enough that a consistent interface makes sense.
|
* 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.
|
||||||
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @enum:
|
||||||
|
* T1_MAX_MM_XXX
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Multiple Masters limits as defined in their specifications.
|
||||||
|
*
|
||||||
|
* @values:
|
||||||
|
* T1_MAX_MM_AXIS ::
|
||||||
|
* The maximum number of Multiple Masters axes.
|
||||||
|
*
|
||||||
|
* T1_MAX_MM_DESIGNS ::
|
||||||
|
* The maximum number of Multiple Masters designs.
|
||||||
|
*
|
||||||
|
* T1_MAX_MM_MAP_POINTS ::
|
||||||
|
* The maximum number of elements in a design map.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
#define T1_MAX_MM_AXIS 4
|
||||||
|
#define T1_MAX_MM_DESIGNS 16
|
||||||
|
#define T1_MAX_MM_MAP_POINTS 20
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
@ -150,7 +182,7 @@ FT_BEGIN_HEADER
|
|||||||
* @note:
|
* @note:
|
||||||
* The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
|
* The fields `minimum`, `def`, and `maximum` are 16.16 fractional values
|
||||||
* for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the
|
* for TrueType GX and OpenType variation fonts. For Adobe MM fonts, the
|
||||||
* values are integers.
|
* values are whole numbers (i.e., the fractional part is zero).
|
||||||
*/
|
*/
|
||||||
typedef struct FT_Var_Axis_
|
typedef struct FT_Var_Axis_
|
||||||
{
|
{
|
||||||
@ -395,6 +427,10 @@ FT_BEGIN_HEADER
|
|||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
|
* The design coordinates are 16.16 fractional values for TrueType GX and
|
||||||
|
* OpenType variation fonts. For Adobe MM fonts, the values are supposed
|
||||||
|
* to be whole numbers (i.e., the fractional part is zero).
|
||||||
|
*
|
||||||
* [Since 2.8.1] To reset all axes to the default values, call the
|
* [Since 2.8.1] To reset all axes to the default values, call the
|
||||||
* function with `num_coords` set to zero and `coords` set to `NULL`.
|
* function with `num_coords` set to zero and `coords` set to `NULL`.
|
||||||
* [Since 2.9] 'Default values' means the currently selected named
|
* [Since 2.9] 'Default values' means the currently selected named
|
||||||
@ -437,6 +473,11 @@ FT_BEGIN_HEADER
|
|||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
*
|
*
|
||||||
|
* @note:
|
||||||
|
* The design coordinates are 16.16 fractional values for TrueType GX and
|
||||||
|
* OpenType variation fonts. For Adobe MM fonts, the values are whole
|
||||||
|
* numbers (i.e., the fractional part is zero).
|
||||||
|
*
|
||||||
* @since:
|
* @since:
|
||||||
* 2.7.1
|
* 2.7.1
|
||||||
*/
|
*/
|
||||||
@ -468,9 +509,9 @@ FT_BEGIN_HEADER
|
|||||||
* the number of axes, use default values for the remaining axes.
|
* the number of axes, use default values for the remaining axes.
|
||||||
*
|
*
|
||||||
* coords ::
|
* coords ::
|
||||||
* The design coordinates array (each element must be between 0 and 1.0
|
* The design coordinates array. Each element is a 16.16 fractional
|
||||||
* for Adobe MM fonts, and between -1.0 and 1.0 for TrueType GX and
|
* value and must be between 0 and 1.0 for Adobe MM fonts, and between
|
||||||
* OpenType variation fonts).
|
* -1.0 and 1.0 for TrueType GX and OpenType variation fonts.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
@ -515,7 +556,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* coords ::
|
* coords ::
|
||||||
* The normalized blend coordinates array.
|
* The normalized blend coordinates array (as 16.16 fractional values).
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
@ -590,10 +631,12 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* Adobe Multiple Master fonts limit the number of designs, and thus the
|
* Adobe Multiple Master fonts limit the number of designs, and thus the
|
||||||
* length of the weight vector to~16.
|
* length of the weight vector to 16~elements.
|
||||||
*
|
*
|
||||||
* If `len` is zero and `weightvector` is `NULL`, the weight vector array
|
* If `len` is larger than zero, this function sets the
|
||||||
* is reset to the default values.
|
* @FT_FACE_FLAG_VARIATION bit in @FT_Face's `face_flags` field (i.e.,
|
||||||
|
* @FT_IS_VARIATION will return true). If `len` is zero, this bit flag
|
||||||
|
* is unset and the weight vector array is reset to the default values.
|
||||||
*
|
*
|
||||||
* The Adobe documentation also states that the values in the
|
* The Adobe documentation also states that the values in the
|
||||||
* WeightVector array must total 1.0 +/-~0.001. In practice this does
|
* WeightVector array must total 1.0 +/-~0.001. In practice this does
|
||||||
@ -741,6 +784,45 @@ FT_BEGIN_HEADER
|
|||||||
FT_Set_Named_Instance( FT_Face face,
|
FT_Set_Named_Instance( FT_Face face,
|
||||||
FT_UInt instance_index );
|
FT_UInt instance_index );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @function:
|
||||||
|
* FT_Get_Default_Named_Instance
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Retrieve the index of the default named instance, to be used with
|
||||||
|
* @FT_Set_Named_Instance.
|
||||||
|
*
|
||||||
|
* The default instance of a variation font is that instance for which
|
||||||
|
* the nth axis coordinate is equal to `axis[n].def` (as specified in the
|
||||||
|
* @FT_MM_Var structure), with~n covering all axes.
|
||||||
|
*
|
||||||
|
* FreeType synthesizes a named instance for the default instance if the
|
||||||
|
* font does not contain such an entry.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* face ::
|
||||||
|
* A handle to the source face.
|
||||||
|
*
|
||||||
|
* @output:
|
||||||
|
* instance_index ::
|
||||||
|
* The index of the default named instance.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* FreeType error code. 0~means success.
|
||||||
|
*
|
||||||
|
* @note:
|
||||||
|
* For Adobe MM fonts (which don't have named instances) this function
|
||||||
|
* always returns zero for `instance_index`.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.13.1
|
||||||
|
*/
|
||||||
|
FT_EXPORT( FT_Error )
|
||||||
|
FT_Get_Default_Named_Instance( FT_Face face,
|
||||||
|
FT_UInt *instance_index );
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType modules public interface (specification).
|
* FreeType modules public interface (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -45,10 +45,12 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* The definitions below are used to manage modules within FreeType.
|
* The definitions below are used to manage modules within FreeType.
|
||||||
* Modules can be added, upgraded, and removed at runtime. Additionally,
|
* Internal and external modules can be added, upgraded, and removed at
|
||||||
* some module properties can be controlled also.
|
* 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.
|
* @FT_Module_Class structure.
|
||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
@ -86,6 +88,7 @@ FT_BEGIN_HEADER
|
|||||||
* FT_Remove_Module
|
* FT_Remove_Module
|
||||||
* FT_Add_Default_Modules
|
* FT_Add_Default_Modules
|
||||||
*
|
*
|
||||||
|
* FT_FACE_DRIVER_NAME
|
||||||
* FT_Property_Set
|
* FT_Property_Set
|
||||||
* FT_Property_Get
|
* FT_Property_Get
|
||||||
* FT_Set_Default_Properties
|
* FT_Set_Default_Properties
|
||||||
@ -328,6 +331,27 @@ FT_BEGIN_HEADER
|
|||||||
FT_Module module );
|
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:
|
* @function:
|
||||||
@ -485,8 +509,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* ```
|
* ```
|
||||||
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
|
* FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
|
||||||
* cff:no-stem-darkening=0 \
|
* cff:no-stem-darkening=0
|
||||||
* autofitter:warping=1
|
|
||||||
* ```
|
* ```
|
||||||
*
|
*
|
||||||
* @inout:
|
* @inout:
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType module error offsets (specification).
|
* FreeType module error offsets (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2001-2020 by
|
* Copyright (C) 2001-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -171,6 +171,7 @@
|
|||||||
FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
|
FT_MODERRDEF( Type42, 0x1400, "Type 42 module" )
|
||||||
FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
|
FT_MODERRDEF( Winfonts, 0x1500, "Windows FON/FNT module" )
|
||||||
FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" )
|
FT_MODERRDEF( GXvalid, 0x1600, "GX validation module" )
|
||||||
|
FT_MODERRDEF( Sdf, 0x1700, "Signed distance field raster module" )
|
||||||
|
|
||||||
|
|
||||||
#ifdef FT_MODERR_END_LIST
|
#ifdef FT_MODERR_END_LIST
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Support for the FT_Outline type used to store glyph shapes of
|
* Support for the FT_Outline type used to store glyph shapes of
|
||||||
* most scalable font formats (specification).
|
* most scalable font formats (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -109,14 +109,16 @@ FT_BEGIN_HEADER
|
|||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* A contour that contains a single point only is represented by a 'move
|
* Degenerate contours, segments, and Bezier arcs may be reported. In
|
||||||
* to' operation followed by 'line to' to the same point. In most cases,
|
* most cases, it is best to filter these out before using the outline
|
||||||
* it is best to filter this out before using the outline for stroking
|
* for stroking or other path modification purposes (which may cause
|
||||||
* purposes (otherwise it would result in a visible dot when round caps
|
* degenerate segments to become non-degenerate and visible, like when
|
||||||
* are used).
|
* 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
|
* Similarly, the function returns success for an empty outline also
|
||||||
* (doing nothing, this is, not calling any emitter); if necessary, you
|
* (doing nothing, that is, not calling any emitter); if necessary, you
|
||||||
* should filter this out, too.
|
* should filter this out, too.
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error )
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType API for possible FT_Parameter tags (specification only).
|
* FreeType API for possible FT_Parameter tags (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-2020 by
|
* Copyright (C) 2017-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -112,6 +112,21 @@ FT_BEGIN_HEADER
|
|||||||
FT_MAKE_TAG( 'i', 'n', 'c', 'r' )
|
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:
|
* @enum:
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType renderer modules public interface (specification).
|
* FreeType renderer modules public interface (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -158,7 +158,7 @@ FT_BEGIN_HEADER
|
|||||||
FT_Renderer_GetCBoxFunc get_glyph_cbox;
|
FT_Renderer_GetCBoxFunc get_glyph_cbox;
|
||||||
FT_Renderer_SetModeFunc set_mode;
|
FT_Renderer_SetModeFunc set_mode;
|
||||||
|
|
||||||
FT_Raster_Funcs* raster_class;
|
const FT_Raster_Funcs* raster_class;
|
||||||
|
|
||||||
} FT_Renderer_Class;
|
} FT_Renderer_Class;
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType size objects management (specification).
|
* FreeType size objects management (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* This is _not_ used to retrieve glyph names!
|
* This is _not_ used to retrieve glyph names!
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType path stroker (specification).
|
* FreeType path stroker (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002-2020 by
|
* Copyright (C) 2002-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -293,7 +293,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* miter_limit ::
|
* miter_limit ::
|
||||||
* The maximum reciprocal sine of half-angle at the miter join,
|
* The maximum reciprocal sine of half-angle at the miter join,
|
||||||
* expressed as 16.16 fixed point value.
|
* expressed as 16.16 fixed-point value.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* The `radius` is expressed in the same units as the outline
|
* The `radius` is expressed in the same units as the outline
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* FreeType synthesizing code for emboldening and slanting
|
* FreeType synthesizing code for emboldening and slanting
|
||||||
* (specification).
|
* (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2000-2020 by
|
* Copyright (C) 2000-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -68,10 +68,31 @@ FT_BEGIN_HEADER
|
|||||||
FT_EXPORT( void )
|
FT_EXPORT( void )
|
||||||
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
|
FT_GlyphSlot_Embolden( FT_GlyphSlot slot );
|
||||||
|
|
||||||
/* Slant an outline glyph to the right by about 12 degrees. */
|
/* Precisely adjust the glyph weight either horizontally or vertically. */
|
||||||
|
/* The `xdelta` and `ydelta` values are fractions of the face Em size */
|
||||||
|
/* (in fixed-point format). Considering that a regular face would have */
|
||||||
|
/* stem widths on the order of 0.1 Em, a delta of 0.05 (0x0CCC) should */
|
||||||
|
/* be very noticeable. To increase or decrease the weight, use positive */
|
||||||
|
/* or negative values, respectively. */
|
||||||
|
FT_EXPORT( void )
|
||||||
|
FT_GlyphSlot_AdjustWeight( FT_GlyphSlot slot,
|
||||||
|
FT_Fixed xdelta,
|
||||||
|
FT_Fixed ydelta );
|
||||||
|
|
||||||
|
|
||||||
|
/* Slant an outline glyph to the right by about 12 degrees. */
|
||||||
FT_EXPORT( void )
|
FT_EXPORT( void )
|
||||||
FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
|
FT_GlyphSlot_Oblique( FT_GlyphSlot slot );
|
||||||
|
|
||||||
|
/* Slant an outline glyph by a given sine of an angle. You can apply */
|
||||||
|
/* slant along either x- or y-axis by choosing a corresponding non-zero */
|
||||||
|
/* argument. If both slants are non-zero, some affine transformation */
|
||||||
|
/* will result. */
|
||||||
|
FT_EXPORT( void )
|
||||||
|
FT_GlyphSlot_Slant( FT_GlyphSlot slot,
|
||||||
|
FT_Fixed xslant,
|
||||||
|
FT_Fixed yslant );
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType low-level system interface definition (specification).
|
* FreeType low-level system interface definition (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -229,7 +229,7 @@ FT_BEGIN_HEADER
|
|||||||
* A handle to the source stream.
|
* A handle to the source stream.
|
||||||
*
|
*
|
||||||
* offset ::
|
* offset ::
|
||||||
* The offset of read in stream (always from start).
|
* The offset from the start of the stream to seek to.
|
||||||
*
|
*
|
||||||
* buffer ::
|
* buffer ::
|
||||||
* The address of the read buffer.
|
* The address of the read buffer.
|
||||||
@ -238,11 +238,9 @@ FT_BEGIN_HEADER
|
|||||||
* The number of bytes to read from the stream.
|
* The number of bytes to read from the stream.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* The number of bytes effectively read by the stream.
|
* If count >~0, return the number of bytes effectively read by the
|
||||||
*
|
* stream (after seeking to `offset`). If count ==~0, return the status
|
||||||
* @note:
|
* of the seek operation (non-zero indicates an error).
|
||||||
* This function might be called to perform a seek or skip operation with
|
|
||||||
* a `count` of~0. A non-zero return value then indicates an error.
|
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
typedef unsigned long
|
typedef unsigned long
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType trigonometric functions (specification).
|
* FreeType trigonometric functions (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2001-2020 by
|
* Copyright (C) 2001-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType simple types definitions (specification only).
|
* FreeType simple types definitions (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -45,7 +45,10 @@ FT_BEGIN_HEADER
|
|||||||
* @description:
|
* @description:
|
||||||
* This section contains the basic data types defined by FreeType~2,
|
* This section contains the basic data types defined by FreeType~2,
|
||||||
* ranging from simple scalar types to bitmap descriptors. More
|
* ranging from simple scalar types to bitmap descriptors. More
|
||||||
* font-specific structures are defined in a different section.
|
* font-specific structures are defined in a different section. Note
|
||||||
|
* that FreeType does not use floating-point data types. Fractional
|
||||||
|
* values are represented by fixed-point integers, with lower bits
|
||||||
|
* storing the fractional part.
|
||||||
*
|
*
|
||||||
* @order:
|
* @order:
|
||||||
* FT_Byte
|
* FT_Byte
|
||||||
@ -413,7 +416,7 @@ FT_BEGIN_HEADER
|
|||||||
typedef struct FT_Data_
|
typedef struct FT_Data_
|
||||||
{
|
{
|
||||||
const FT_Byte* pointer;
|
const FT_Byte* pointer;
|
||||||
FT_Int length;
|
FT_UInt length;
|
||||||
|
|
||||||
} FT_Data;
|
} FT_Data;
|
||||||
|
|
||||||
@ -479,18 +482,17 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* This macro converts four-letter tags that are used to label TrueType
|
* 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:
|
* @note:
|
||||||
* The produced values **must** be 32-bit integers. Don't redefine this
|
* The produced values **must** be 32-bit integers. Don't redefine this
|
||||||
* macro.
|
* macro.
|
||||||
*/
|
*/
|
||||||
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
|
#define FT_MAKE_TAG( _x1, _x2, _x3, _x4 ) \
|
||||||
(FT_Tag) \
|
( ( FT_STATIC_BYTE_CAST( FT_Tag, _x1 ) << 24 ) | \
|
||||||
( ( (FT_ULong)_x1 << 24 ) | \
|
( FT_STATIC_BYTE_CAST( FT_Tag, _x2 ) << 16 ) | \
|
||||||
( (FT_ULong)_x2 << 16 ) | \
|
( FT_STATIC_BYTE_CAST( FT_Tag, _x3 ) << 8 ) | \
|
||||||
( (FT_ULong)_x3 << 8 ) | \
|
FT_STATIC_BYTE_CAST( FT_Tag, _x4 ) )
|
||||||
(FT_ULong)_x4 )
|
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
@ -588,7 +590,7 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
|
|
||||||
#define FT_IS_EMPTY( list ) ( (list).head == 0 )
|
#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 */
|
/* concatenate C tokens */
|
||||||
#define FT_ERR_XCAT( x, y ) x ## y
|
#define FT_ERR_XCAT( x, y ) x ## y
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* High-level 'autohint' module-specific interface (specification).
|
* High-level 'autohint' module-specific interface (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Basic OpenType/CFF object type definitions (specification).
|
* Basic OpenType/CFF object type definitions (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-2020 by
|
* Copyright (C) 2017-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Basic OpenType/CFF type definitions and interface (specification
|
* Basic OpenType/CFF type definitions and interface (specification
|
||||||
* only).
|
* only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -248,10 +248,10 @@ FT_BEGIN_HEADER
|
|||||||
FT_Byte num_family_blues;
|
FT_Byte num_family_blues;
|
||||||
FT_Byte num_family_other_blues;
|
FT_Byte num_family_other_blues;
|
||||||
|
|
||||||
FT_Pos blue_values[14];
|
FT_Fixed blue_values[14];
|
||||||
FT_Pos other_blues[10];
|
FT_Fixed other_blues[10];
|
||||||
FT_Pos family_blues[14];
|
FT_Fixed family_blues[14];
|
||||||
FT_Pos family_other_blues[10];
|
FT_Fixed family_other_blues[10];
|
||||||
|
|
||||||
FT_Fixed blue_scale;
|
FT_Fixed blue_scale;
|
||||||
FT_Pos blue_shift;
|
FT_Pos blue_shift;
|
||||||
@ -315,7 +315,7 @@ FT_BEGIN_HEADER
|
|||||||
/* The normal stack then points to these values instead of the DICT */
|
/* The normal stack then points to these values instead of the DICT */
|
||||||
/* because all other operators in Private DICT clear the stack. */
|
/* because all other operators in Private DICT clear the stack. */
|
||||||
/* `blend_stack' could be cleared at each operator other than blend. */
|
/* `blend_stack' could be cleared at each operator other than blend. */
|
||||||
/* Blended values are stored as 5-byte fixed point values. */
|
/* Blended values are stored as 5-byte fixed-point values. */
|
||||||
|
|
||||||
FT_Byte* blend_stack; /* base of stack allocation */
|
FT_Byte* blend_stack; /* base of stack allocation */
|
||||||
FT_Byte* blend_top; /* first empty slot */
|
FT_Byte* blend_top; /* first empty slot */
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Compiler-specific macro definitions used internally by FreeType.
|
* Compiler-specific macro definitions used internally by FreeType.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2020 by
|
* Copyright (C) 2020-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -34,6 +34,22 @@ FT_BEGIN_HEADER
|
|||||||
# if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
|
# if defined( _COMPILER_VERSION ) && ( _COMPILER_VERSION >= 730 )
|
||||||
# pragma set woff 3505
|
# pragma set woff 3505
|
||||||
# endif
|
# endif
|
||||||
|
#endif
|
||||||
|
|
||||||
|
/* Newer compilers warn for fall-through case statements. */
|
||||||
|
#ifndef FALL_THROUGH
|
||||||
|
# if ( defined( __STDC_VERSION__ ) && __STDC_VERSION__ > 201710L ) || \
|
||||||
|
( defined( __cplusplus ) && __cplusplus > 201402L )
|
||||||
|
# define FALL_THROUGH [[__fallthrough__]]
|
||||||
|
# elif ( defined( __GNUC__ ) && __GNUC__ >= 7 ) || \
|
||||||
|
( defined( __clang__ ) && \
|
||||||
|
( defined( __apple_build_version__ ) \
|
||||||
|
? __apple_build_version__ >= 12000000 \
|
||||||
|
: __clang_major__ >= 10 ) )
|
||||||
|
# define FALL_THROUGH __attribute__(( __fallthrough__ ))
|
||||||
|
# else
|
||||||
|
# define FALL_THROUGH ( (void)0 )
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -71,12 +87,18 @@ FT_BEGIN_HEADER
|
|||||||
*/
|
*/
|
||||||
#define FT_DUMMY_STMNT FT_BEGIN_STMNT FT_END_STMNT
|
#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., */
|
/* only 64bit Windows uses the LLP64 data model, i.e., */
|
||||||
/* 32-bit integers, 64-bit pointers. */
|
/* 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
|
#else
|
||||||
#define FT_UINT_TO_POINTER( x ) (void *)(unsigned long)(x)
|
# define FT_UINT_TO_POINTER( x ) (void *)(unsigned long)(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -216,79 +238,93 @@ FT_BEGIN_HEADER
|
|||||||
#define FT_EXPORT_VAR( x ) FT_FUNCTION_DECLARATION( x )
|
#define FT_EXPORT_VAR( x ) FT_FUNCTION_DECLARATION( x )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* When compiling FreeType as a DLL or DSO with hidden visibility, */
|
/*
|
||||||
/* some systems/compilers need a special attribute in front OR after */
|
* When compiling FreeType as a DLL or DSO with hidden visibility,
|
||||||
/* the return type of function declarations. */
|
* 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`. */
|
* Two macros are used within the FreeType source code to define
|
||||||
/* */
|
* exported library functions: `FT_EXPORT` and `FT_EXPORT_DEF`.
|
||||||
/* - `FT_EXPORT( return_type )` */
|
*
|
||||||
/* */
|
* - `FT_EXPORT( return_type )`
|
||||||
/* is used in a function declaration, as in */
|
*
|
||||||
/* */
|
* is used in a function declaration, as in
|
||||||
/* ``` */
|
*
|
||||||
/* FT_EXPORT( FT_Error ) */
|
* ```
|
||||||
/* FT_Init_FreeType( FT_Library* alibrary ); */
|
* FT_EXPORT( FT_Error )
|
||||||
/* ``` */
|
* FT_Init_FreeType( FT_Library* alibrary );
|
||||||
/* */
|
* ```
|
||||||
/* - `FT_EXPORT_DEF( return_type )` */
|
*
|
||||||
/* */
|
* - `FT_EXPORT_DEF( return_type )`
|
||||||
/* is used in a function definition, as in */
|
*
|
||||||
/* */
|
* is used in a function definition, as in
|
||||||
/* ``` */
|
*
|
||||||
/* FT_EXPORT_DEF( FT_Error ) */
|
* ```
|
||||||
/* FT_Init_FreeType( FT_Library* alibrary ) */
|
* FT_EXPORT_DEF( FT_Error )
|
||||||
/* { */
|
* FT_Init_FreeType( FT_Library* alibrary )
|
||||||
/* ... some code ... */
|
* {
|
||||||
/* return FT_Err_Ok; */
|
* ... some code ...
|
||||||
/* } */
|
* return FT_Err_Ok;
|
||||||
/* ``` */
|
* }
|
||||||
/* */
|
* ```
|
||||||
/* You can provide your own implementation of `FT_EXPORT` and */
|
*
|
||||||
/* `FT_EXPORT_DEF` here if you want. */
|
* 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`. */
|
*
|
||||||
/* */
|
* To export a variable, use `FT_EXPORT_VAR`.
|
||||||
|
*/
|
||||||
|
|
||||||
/* See `freetype/config/compiler_macros.h` for the `FT_EXPORT` definition */
|
/* See `freetype/config/public-macros.h` for the `FT_EXPORT` definition */
|
||||||
#define FT_EXPORT_DEF( x ) FT_FUNCTION_DEFINITION( x )
|
#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 */
|
* This is special. Within C++, you must specify `extern "C"` for
|
||||||
/* must do that for structures which contain function pointers to */
|
* functions which are used via function pointers, and you also
|
||||||
/* assure C linkage -- it's not possible to have (local) anonymous */
|
* must do that for structures which contain function pointers to
|
||||||
/* functions which are accessed by (global) function pointers. */
|
* 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 */
|
* FT_CALLBACK_DEF is used to _define_ a callback function,
|
||||||
/* it. */
|
* located in the same source code file as the structure that uses
|
||||||
/* */
|
* it. FT_COMPARE_DEF, in addition, ensures the `cdecl` calling
|
||||||
/* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare */
|
* convention on x86, required by the C library function `qsort`.
|
||||||
/* and define a callback function, respectively, in a similar way */
|
*
|
||||||
/* as FT_BASE and FT_BASE_DEF work. */
|
* FT_BASE_CALLBACK and FT_BASE_CALLBACK_DEF are used to declare
|
||||||
/* */
|
* and define a callback function, respectively, in a similar way
|
||||||
/* FT_CALLBACK_TABLE is used to _declare_ a constant variable that */
|
* as FT_BASE and FT_BASE_DEF work.
|
||||||
/* contains pointers to callback functions. */
|
*
|
||||||
/* */
|
* FT_CALLBACK_TABLE is used to _declare_ a constant variable that
|
||||||
/* FT_CALLBACK_TABLE_DEF is used to _define_ a constant variable */
|
* contains pointers to callback functions.
|
||||||
/* 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. */
|
*
|
||||||
/* */
|
* Some 16bit compilers have to redefine these macros to insert
|
||||||
|
* the infamous `_cdecl` or `__fastcall` declarations.
|
||||||
|
*/
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
#define FT_CALLBACK_DEF( x ) extern "C" x
|
#define FT_CALLBACK_DEF( x ) extern "C" x
|
||||||
#else
|
#else
|
||||||
#define FT_CALLBACK_DEF( x ) static x
|
#define FT_CALLBACK_DEF( x ) static x
|
||||||
#endif
|
#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( x ) FT_FUNCTION_DECLARATION( x )
|
||||||
#define FT_BASE_CALLBACK_DEF( x ) FT_FUNCTION_DEFINITION( x )
|
#define FT_BASE_CALLBACK_DEF( x ) FT_FUNCTION_DEFINITION( x )
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Arithmetic computations (specification).
|
* Arithmetic computations (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -278,6 +278,40 @@ FT_BEGIN_HEADER
|
|||||||
FT_Long c );
|
FT_Long c );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @function:
|
||||||
|
* FT_MulAddFix
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Compute `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`, where `s[n]` is
|
||||||
|
* usually a 16.16 scalar.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* s ::
|
||||||
|
* The array of scalars.
|
||||||
|
* f ::
|
||||||
|
* The array of factors.
|
||||||
|
* count ::
|
||||||
|
* The number of entries in the array.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* The result of `(s[0] * f[0] + s[1] * f[1] + ...) / 0x10000`.
|
||||||
|
*
|
||||||
|
* @note:
|
||||||
|
* This function is currently used for the scaled delta computation of
|
||||||
|
* variation stores. It internally uses 64-bit data types when
|
||||||
|
* available, otherwise it emulates 64-bit math by using 32-bit
|
||||||
|
* operations, which produce a correct result but most likely at a slower
|
||||||
|
* performance in comparison to the implementation base on `int64_t`.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
FT_BASE( FT_Int32 )
|
||||||
|
FT_MulAddFix( FT_Fixed* s,
|
||||||
|
FT_Int32* f,
|
||||||
|
FT_UInt count );
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A variant of FT_Matrix_Multiply which scales its result afterwards. The
|
* A variant of FT_Matrix_Multiply which scales its result afterwards. The
|
||||||
* idea is that both `a' and `b' are scaled by factors of 10 so that the
|
* idea is that both `a' and `b' are scaled by factors of 10 so that the
|
||||||
@ -298,9 +332,9 @@ FT_BEGIN_HEADER
|
|||||||
* Based on geometric considerations we use the following inequality to
|
* Based on geometric considerations we use the following inequality to
|
||||||
* identify a degenerate matrix.
|
* identify a degenerate matrix.
|
||||||
*
|
*
|
||||||
* 50 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
|
* 32 * abs(xx*yy - xy*yx) < xx^2 + xy^2 + yx^2 + yy^2
|
||||||
*
|
*
|
||||||
* Value 50 is heuristic.
|
* Value 32 is heuristic.
|
||||||
*/
|
*/
|
||||||
FT_BASE( FT_Bool )
|
FT_BASE( FT_Bool )
|
||||||
FT_Matrix_Check( const FT_Matrix* matrix );
|
FT_Matrix_Check( const FT_Matrix* matrix );
|
||||||
@ -359,8 +393,8 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
|
#ifndef FT_CONFIG_OPTION_NO_ASSEMBLER
|
||||||
|
|
||||||
#if defined( __GNUC__ ) && \
|
#if defined( __clang__ ) || ( defined( __GNUC__ ) && \
|
||||||
( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) )
|
( __GNUC__ > 3 || ( __GNUC__ == 3 && __GNUC_MINOR__ >= 4 ) ) )
|
||||||
|
|
||||||
#if FT_SIZEOF_INT == 4
|
#if FT_SIZEOF_INT == 4
|
||||||
|
|
||||||
@ -370,12 +404,25 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
#define FT_MSB( x ) ( 31 - __builtin_clzl( x ) )
|
#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 ) || defined( _M_ARM64EC )
|
||||||
|
|
||||||
|
#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>
|
#include <intrin.h>
|
||||||
#pragma intrinsic( _BitScanReverse )
|
#pragma intrinsic( _BitScanReverse )
|
||||||
@ -391,15 +438,46 @@ FT_BEGIN_HEADER
|
|||||||
return (FT_Int32)where;
|
return (FT_Int32)where;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define FT_MSB( x ) ( FT_MSB_i386( x ) )
|
#define FT_MSB( x ) FT_MSB_i386( x )
|
||||||
|
|
||||||
#endif
|
#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( __SunOS_5_11 )
|
||||||
|
|
||||||
|
#include <string.h>
|
||||||
|
|
||||||
|
#define FT_MSB( x ) ( fls( x ) - 1 )
|
||||||
|
|
||||||
|
#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 */
|
#endif /* !FT_CONFIG_OPTION_NO_ASSEMBLER */
|
||||||
|
|
||||||
|
|
||||||
#ifndef FT_MSB
|
#ifndef FT_MSB
|
||||||
|
|
||||||
FT_BASE( FT_Int )
|
FT_BASE( FT_Int )
|
||||||
@ -417,8 +495,6 @@ FT_BEGIN_HEADER
|
|||||||
FT_Fixed y );
|
FT_Fixed y );
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
@ -435,12 +511,11 @@ FT_BEGIN_HEADER
|
|||||||
* The result of 'sqrt(x)'.
|
* The result of 'sqrt(x)'.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* This function is not very fast.
|
* This function is slow and should be avoided. Consider @FT_Hypot or
|
||||||
|
* @FT_Vector_NormLen instead.
|
||||||
*/
|
*/
|
||||||
FT_BASE( FT_Int32 )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_SqrtFixed( FT_Int32 x );
|
FT_SqrtFixed( FT_UInt32 x );
|
||||||
|
|
||||||
#endif /* 0 */
|
|
||||||
|
|
||||||
|
|
||||||
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) * 64 ) /* << 6 */
|
#define INT_TO_F26DOT6( x ) ( (FT_Long)(x) * 64 ) /* << 6 */
|
||||||
@ -487,7 +562,7 @@ FT_BEGIN_HEADER
|
|||||||
#define NEG_INT32( a ) \
|
#define NEG_INT32( a ) \
|
||||||
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
|
(FT_Int32)( (FT_UInt32)0 - (FT_UInt32)(a) )
|
||||||
|
|
||||||
#ifdef FT_LONG64
|
#ifdef FT_INT64
|
||||||
|
|
||||||
#define ADD_INT64( a, b ) \
|
#define ADD_INT64( a, b ) \
|
||||||
(FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
|
(FT_Int64)( (FT_UInt64)(a) + (FT_UInt64)(b) )
|
||||||
@ -498,7 +573,7 @@ FT_BEGIN_HEADER
|
|||||||
#define NEG_INT64( a ) \
|
#define NEG_INT64( a ) \
|
||||||
(FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
|
(FT_Int64)( (FT_UInt64)0 - (FT_UInt64)(a) )
|
||||||
|
|
||||||
#endif /* FT_LONG64 */
|
#endif /* FT_INT64 */
|
||||||
|
|
||||||
|
|
||||||
FT_END_HEADER
|
FT_END_HEADER
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Debugging and logging component (specification).
|
* Debugging and logging component (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -31,9 +31,24 @@
|
|||||||
|
|
||||||
#include "compiler-macros.h"
|
#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
|
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 */
|
/* force the definition of FT_DEBUG_LEVEL_ERROR if FT_DEBUG_LEVEL_TRACE */
|
||||||
/* is already defined; this simplifies the following #ifdefs */
|
/* 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
|
* Each component must define the macro FT_COMPONENT to a valid FT_Trace
|
||||||
* value before using any TRACE macro.
|
* 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
|
#ifdef FT_DEBUG_LEVEL_TRACE
|
||||||
|
|
||||||
/* we need two macros here to make cpp expand `FT_COMPONENT' */
|
/* 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 ) FT_TRACE_COMP_( x )
|
||||||
#define FT_TRACE_COMP_( x ) trace_ ## x
|
#define FT_TRACE_COMP_( x ) trace_ ## x
|
||||||
|
|
||||||
#define FT_TRACE( level, varformat ) \
|
#define FT_TRACE( level, varformat ) FT_LOG( level, varformat )
|
||||||
do \
|
|
||||||
{ \
|
|
||||||
if ( ft_trace_levels[FT_TRACE_COMP( FT_COMPONENT )] >= level ) \
|
|
||||||
FT_Message varformat; \
|
|
||||||
} while ( 0 )
|
|
||||||
|
|
||||||
#else /* !FT_DEBUG_LEVEL_TRACE */
|
#else /* !FT_DEBUG_LEVEL_TRACE */
|
||||||
|
|
||||||
@ -204,7 +265,32 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
#ifdef FT_DEBUG_LEVEL_ERROR
|
#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 */
|
#else /* !FT_DEBUG_LEVEL_ERROR */
|
||||||
|
|
||||||
@ -277,6 +363,77 @@ FT_BEGIN_HEADER
|
|||||||
FT_BASE( void )
|
FT_BASE( void )
|
||||||
ft_debug_init( 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
|
FT_END_HEADER
|
||||||
|
|
||||||
#endif /* FTDEBUG_H_ */
|
#endif /* FTDEBUG_H_ */
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType internal font driver interface (specification).
|
* FreeType internal font driver interface (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -157,6 +157,7 @@ FT_BEGIN_HEADER
|
|||||||
* A handle to a function used to select a new fixed size. It is used
|
* A handle to a function used to select a new fixed size. It is used
|
||||||
* only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the
|
* only if @FT_FACE_FLAG_FIXED_SIZES is set. Can be set to 0 if the
|
||||||
* scaling done in the base layer suffices.
|
* scaling done in the base layer suffices.
|
||||||
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* Most function pointers, with the exception of `load_glyph`, can be set
|
* Most function pointers, with the exception of `load_glyph`, can be set
|
||||||
* to 0 to indicate a default behaviour.
|
* to 0 to indicate a default behaviour.
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType glyph loader (specification).
|
* The FreeType glyph loader (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002-2020 by
|
* Copyright (C) 2002-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg
|
* David Turner, Robert Wilhelm, and Werner Lemberg
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include <freetype/freetype.h>
|
#include <freetype/freetype.h>
|
||||||
|
|
||||||
|
#include "compiler-macros.h"
|
||||||
|
|
||||||
FT_BEGIN_HEADER
|
FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType memory management macros (specification).
|
* The FreeType memory management macros (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg
|
* David Turner, Robert Wilhelm, and Werner Lemberg
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -96,15 +96,15 @@ extern "C++"
|
|||||||
|
|
||||||
#ifdef FT_DEBUG_MEMORY
|
#ifdef FT_DEBUG_MEMORY
|
||||||
|
|
||||||
FT_BASE( const char* ) _ft_debug_file;
|
FT_BASE( const char* ) ft_debug_file_;
|
||||||
FT_BASE( long ) _ft_debug_lineno;
|
FT_BASE( long ) ft_debug_lineno_;
|
||||||
|
|
||||||
#define FT_DEBUG_INNER( exp ) ( _ft_debug_file = __FILE__, \
|
#define FT_DEBUG_INNER( exp ) ( ft_debug_file_ = __FILE__, \
|
||||||
_ft_debug_lineno = __LINE__, \
|
ft_debug_lineno_ = __LINE__, \
|
||||||
(exp) )
|
(exp) )
|
||||||
|
|
||||||
#define FT_ASSIGNP_INNER( p, exp ) ( _ft_debug_file = __FILE__, \
|
#define FT_ASSIGNP_INNER( p, exp ) ( ft_debug_file_ = __FILE__, \
|
||||||
_ft_debug_lineno = __LINE__, \
|
ft_debug_lineno_ = __LINE__, \
|
||||||
FT_ASSIGNP( p, exp ) )
|
FT_ASSIGNP( p, exp ) )
|
||||||
|
|
||||||
#else /* !FT_DEBUG_MEMORY */
|
#else /* !FT_DEBUG_MEMORY */
|
||||||
@ -344,14 +344,13 @@ extern "C++"
|
|||||||
#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
|
#define FT_RENEW_ARRAY( ptr, curcnt, newcnt ) \
|
||||||
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
||||||
|
|
||||||
#define FT_QNEW( ptr ) \
|
#define FT_QNEW( ptr ) FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
|
||||||
FT_MEM_SET_ERROR( FT_MEM_QNEW( ptr ) )
|
|
||||||
|
|
||||||
#define FT_QNEW_ARRAY( ptr, count ) \
|
#define FT_QNEW_ARRAY( ptr, count ) \
|
||||||
FT_MEM_SET_ERROR( FT_MEM_NEW_ARRAY( ptr, count ) )
|
FT_MEM_SET_ERROR( FT_MEM_QNEW_ARRAY( ptr, count ) )
|
||||||
|
|
||||||
#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
|
#define FT_QRENEW_ARRAY( ptr, curcnt, newcnt ) \
|
||||||
FT_MEM_SET_ERROR( FT_MEM_RENEW_ARRAY( ptr, curcnt, newcnt ) )
|
FT_MEM_SET_ERROR( FT_MEM_QRENEW_ARRAY( ptr, curcnt, newcnt ) )
|
||||||
|
|
||||||
|
|
||||||
FT_BASE( FT_Pointer )
|
FT_BASE( FT_Pointer )
|
||||||
@ -372,8 +371,11 @@ extern "C++"
|
|||||||
#define FT_STRDUP( dst, str ) \
|
#define FT_STRDUP( dst, str ) \
|
||||||
FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )
|
FT_MEM_SET_ERROR( FT_MEM_STRDUP( dst, str ) )
|
||||||
|
|
||||||
#define FT_MEM_DUP( dst, address, size ) \
|
#define FT_MEM_DUP( dst, address, size ) \
|
||||||
(dst) = ft_mem_dup( memory, (address), (FT_ULong)(size), &error )
|
FT_ASSIGNP_INNER( dst, ft_mem_dup( memory, \
|
||||||
|
(address), \
|
||||||
|
(FT_ULong)(size), \
|
||||||
|
&error ) )
|
||||||
|
|
||||||
#define FT_DUP( dst, address, size ) \
|
#define FT_DUP( dst, address, size ) \
|
||||||
FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
|
FT_MEM_SET_ERROR( FT_MEM_DUP( dst, address, size ) )
|
||||||
|
|||||||
@ -0,0 +1,91 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
*
|
||||||
|
* ftmmtypes.h
|
||||||
|
*
|
||||||
|
* OpenType Variations type definitions for internal use
|
||||||
|
* with the multi-masters service (specification).
|
||||||
|
*
|
||||||
|
* Copyright (C) 2022-2024 by
|
||||||
|
* David Turner, Robert Wilhelm, Werner Lemberg, George Williams, and
|
||||||
|
* Dominik Röttsches.
|
||||||
|
*
|
||||||
|
* 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 FTMMTYPES_H_
|
||||||
|
#define FTMMTYPES_H_
|
||||||
|
|
||||||
|
FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
|
typedef FT_Int32 FT_ItemVarDelta;
|
||||||
|
|
||||||
|
typedef struct GX_ItemVarDataRec_
|
||||||
|
{
|
||||||
|
FT_UInt itemCount; /* Number of delta sets per item. */
|
||||||
|
FT_UInt regionIdxCount; /* Number of region indices. */
|
||||||
|
FT_UInt* regionIndices; /* Array of `regionCount` indices; */
|
||||||
|
/* these index `varRegionList`. */
|
||||||
|
FT_Byte* deltaSet; /* Array of `itemCount` deltas; */
|
||||||
|
/* use `innerIndex` for this array. */
|
||||||
|
FT_UShort wordDeltaCount; /* Number of the first 32-bit ints */
|
||||||
|
/* or 16-bit ints of `deltaSet` */
|
||||||
|
/* depending on `longWords`. */
|
||||||
|
FT_Bool longWords; /* If true, `deltaSet` is a 32-bit */
|
||||||
|
/* array followed by a 16-bit */
|
||||||
|
/* array, otherwise a 16-bit array */
|
||||||
|
/* followed by an 8-bit array. */
|
||||||
|
} GX_ItemVarDataRec, *GX_ItemVarData;
|
||||||
|
|
||||||
|
|
||||||
|
/* contribution of one axis to a region */
|
||||||
|
typedef struct GX_AxisCoordsRec_
|
||||||
|
{
|
||||||
|
FT_Fixed startCoord;
|
||||||
|
FT_Fixed peakCoord; /* zero means no effect (factor = 1) */
|
||||||
|
FT_Fixed endCoord;
|
||||||
|
|
||||||
|
} GX_AxisCoordsRec, *GX_AxisCoords;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct GX_VarRegionRec_
|
||||||
|
{
|
||||||
|
GX_AxisCoords axisList; /* array of axisCount records */
|
||||||
|
|
||||||
|
} GX_VarRegionRec, *GX_VarRegion;
|
||||||
|
|
||||||
|
|
||||||
|
/* item variation store */
|
||||||
|
typedef struct GX_ItemVarStoreRec_
|
||||||
|
{
|
||||||
|
FT_UInt dataCount;
|
||||||
|
GX_ItemVarData varData; /* array of dataCount records; */
|
||||||
|
/* use `outerIndex' for this array */
|
||||||
|
FT_UShort axisCount;
|
||||||
|
FT_UInt regionCount; /* total number of regions defined */
|
||||||
|
GX_VarRegion varRegionList;
|
||||||
|
|
||||||
|
} GX_ItemVarStoreRec, *GX_ItemVarStore;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct GX_DeltaSetIdxMapRec_
|
||||||
|
{
|
||||||
|
FT_ULong mapCount;
|
||||||
|
FT_UInt* outerIndex; /* indices to item var data */
|
||||||
|
FT_UInt* innerIndex; /* indices to delta set */
|
||||||
|
|
||||||
|
} GX_DeltaSetIdxMapRec, *GX_DeltaSetIdxMap;
|
||||||
|
|
||||||
|
|
||||||
|
FT_END_HEADER
|
||||||
|
|
||||||
|
#endif /* FTMMTYPES_H_ */
|
||||||
|
|
||||||
|
|
||||||
|
/* END */
|
||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType private base classes (specification).
|
* The FreeType private base classes (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -418,7 +418,8 @@ FT_BEGIN_HEADER
|
|||||||
* initializing the glyph slot.
|
* 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_
|
typedef struct FT_Slot_InternalRec_
|
||||||
{
|
{
|
||||||
@ -603,12 +604,6 @@ FT_BEGIN_HEADER
|
|||||||
#define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
|
#define FT_FACE_MEMORY( x ) FT_FACE( x )->memory
|
||||||
#define FT_FACE_STREAM( x ) FT_FACE( x )->stream
|
#define FT_FACE_STREAM( x ) FT_FACE( x )->stream
|
||||||
|
|
||||||
#define FT_SIZE_FACE( x ) FT_SIZE( x )->face
|
|
||||||
#define FT_SLOT_FACE( x ) FT_SLOT( x )->face
|
|
||||||
|
|
||||||
#define FT_FACE_SLOT( x ) FT_FACE( x )->glyph
|
|
||||||
#define FT_FACE_SIZE( x ) FT_FACE( x )->size
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
@ -673,7 +668,7 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
|
|
||||||
/* Set the metrics according to a size request. */
|
/* Set the metrics according to a size request. */
|
||||||
FT_BASE( void )
|
FT_BASE( FT_Error )
|
||||||
FT_Request_Metrics( FT_Face face,
|
FT_Request_Metrics( FT_Face face,
|
||||||
FT_Size_Request req );
|
FT_Size_Request req );
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Get and set properties of PostScript drivers (specification).
|
* Get and set properties of PostScript drivers (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-2020 by
|
* Copyright (C) 2017-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Embedded resource forks accessor (specification).
|
* Embedded resource forks accessor (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004-2020 by
|
* Copyright (C) 2004-2024 by
|
||||||
* Masatake YAMATO and Redhat K.K.
|
* Masatake YAMATO and Redhat K.K.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType services (specification only).
|
* The FreeType services (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Stream handling (specification).
|
* Stream handling (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -196,9 +196,9 @@ FT_BEGIN_HEADER
|
|||||||
FT_BYTE_U32( p, 2, 8 ) | \
|
FT_BYTE_U32( p, 2, 8 ) | \
|
||||||
FT_BYTE_U32( p, 3, 0 ) )
|
FT_BYTE_U32( p, 3, 0 ) )
|
||||||
|
|
||||||
#define FT_PEEK_OFF3( p ) FT_INT32( FT_BYTE_U32( p, 0, 16 ) | \
|
#define FT_PEEK_OFF3( p ) ( FT_INT32( FT_BYTE_U32( p, 0, 24 ) | \
|
||||||
FT_BYTE_U32( p, 1, 8 ) | \
|
FT_BYTE_U32( p, 1, 16 ) | \
|
||||||
FT_BYTE_U32( p, 2, 0 ) )
|
FT_BYTE_U32( p, 2, 8 ) ) >> 8 )
|
||||||
|
|
||||||
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
|
#define FT_PEEK_UOFF3( p ) FT_UINT32( FT_BYTE_U32( p, 0, 16 ) | \
|
||||||
FT_BYTE_U32( p, 1, 8 ) | \
|
FT_BYTE_U32( p, 1, 8 ) | \
|
||||||
@ -220,9 +220,9 @@ FT_BEGIN_HEADER
|
|||||||
FT_BYTE_U32( p, 1, 8 ) | \
|
FT_BYTE_U32( p, 1, 8 ) | \
|
||||||
FT_BYTE_U32( p, 0, 0 ) )
|
FT_BYTE_U32( p, 0, 0 ) )
|
||||||
|
|
||||||
#define FT_PEEK_OFF3_LE( p ) FT_INT32( FT_BYTE_U32( p, 2, 16 ) | \
|
#define FT_PEEK_OFF3_LE( p ) ( FT_INT32( FT_BYTE_U32( p, 2, 24 ) | \
|
||||||
FT_BYTE_U32( p, 1, 8 ) | \
|
FT_BYTE_U32( p, 1, 16 ) | \
|
||||||
FT_BYTE_U32( p, 0, 0 ) )
|
FT_BYTE_U32( p, 0, 8 ) ) >> 8 )
|
||||||
|
|
||||||
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
|
#define FT_PEEK_UOFF3_LE( p ) FT_UINT32( FT_BYTE_U32( p, 2, 16 ) | \
|
||||||
FT_BYTE_U32( p, 1, 8 ) | \
|
FT_BYTE_U32( p, 1, 8 ) | \
|
||||||
@ -238,42 +238,42 @@ FT_BEGIN_HEADER
|
|||||||
#define FT_NEXT_BYTE( buffer ) \
|
#define FT_NEXT_BYTE( buffer ) \
|
||||||
( (unsigned char)*buffer++ )
|
( (unsigned char)*buffer++ )
|
||||||
|
|
||||||
#define FT_NEXT_SHORT( buffer ) \
|
#define FT_NEXT_SHORT( buffer ) \
|
||||||
( (short)( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) ) )
|
( buffer += 2, FT_PEEK_SHORT( buffer - 2 ) )
|
||||||
|
|
||||||
#define FT_NEXT_USHORT( buffer ) \
|
#define FT_NEXT_USHORT( buffer ) \
|
||||||
( (unsigned short)( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) ) )
|
( buffer += 2, FT_PEEK_USHORT( buffer - 2 ) )
|
||||||
|
|
||||||
#define FT_NEXT_OFF3( buffer ) \
|
#define FT_NEXT_OFF3( buffer ) \
|
||||||
( (long)( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) ) )
|
( buffer += 3, FT_PEEK_OFF3( buffer - 3 ) )
|
||||||
|
|
||||||
#define FT_NEXT_UOFF3( buffer ) \
|
#define FT_NEXT_UOFF3( buffer ) \
|
||||||
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) ) )
|
( buffer += 3, FT_PEEK_UOFF3( buffer - 3 ) )
|
||||||
|
|
||||||
#define FT_NEXT_LONG( buffer ) \
|
#define FT_NEXT_LONG( buffer ) \
|
||||||
( (long)( buffer += 4, FT_PEEK_LONG( buffer - 4 ) ) )
|
( buffer += 4, FT_PEEK_LONG( buffer - 4 ) )
|
||||||
|
|
||||||
#define FT_NEXT_ULONG( buffer ) \
|
#define FT_NEXT_ULONG( buffer ) \
|
||||||
( (unsigned long)( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) ) )
|
( buffer += 4, FT_PEEK_ULONG( buffer - 4 ) )
|
||||||
|
|
||||||
|
|
||||||
#define FT_NEXT_SHORT_LE( buffer ) \
|
#define FT_NEXT_SHORT_LE( buffer ) \
|
||||||
( (short)( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) ) )
|
( buffer += 2, FT_PEEK_SHORT_LE( buffer - 2 ) )
|
||||||
|
|
||||||
#define FT_NEXT_USHORT_LE( buffer ) \
|
#define FT_NEXT_USHORT_LE( buffer ) \
|
||||||
( (unsigned short)( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) ) )
|
( buffer += 2, FT_PEEK_USHORT_LE( buffer - 2 ) )
|
||||||
|
|
||||||
#define FT_NEXT_OFF3_LE( buffer ) \
|
#define FT_NEXT_OFF3_LE( buffer ) \
|
||||||
( (long)( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) ) )
|
( buffer += 3, FT_PEEK_OFF3_LE( buffer - 3 ) )
|
||||||
|
|
||||||
#define FT_NEXT_UOFF3_LE( buffer ) \
|
#define FT_NEXT_UOFF3_LE( buffer ) \
|
||||||
( (unsigned long)( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) ) )
|
( buffer += 3, FT_PEEK_UOFF3_LE( buffer - 3 ) )
|
||||||
|
|
||||||
#define FT_NEXT_LONG_LE( buffer ) \
|
#define FT_NEXT_LONG_LE( buffer ) \
|
||||||
( (long)( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) ) )
|
( buffer += 4, FT_PEEK_LONG_LE( buffer - 4 ) )
|
||||||
|
|
||||||
#define FT_NEXT_ULONG_LE( buffer ) \
|
#define FT_NEXT_ULONG_LE( buffer ) \
|
||||||
( (unsigned long)( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) ) )
|
( buffer += 4, FT_PEEK_ULONG_LE( buffer - 4 ) )
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
@ -305,20 +305,19 @@ FT_BEGIN_HEADER
|
|||||||
#else
|
#else
|
||||||
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
|
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
|
||||||
|
|
||||||
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
|
#define FT_GET_CHAR() FT_GET_MACRO( FT_Stream_GetByte, FT_Char )
|
||||||
#define FT_GET_BYTE() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
|
#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_SHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_Int16 )
|
||||||
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UShort )
|
#define FT_GET_USHORT() FT_GET_MACRO( FT_Stream_GetUShort, FT_UInt16 )
|
||||||
#define FT_GET_OFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_Long )
|
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_UInt32 )
|
||||||
#define FT_GET_UOFF3() FT_GET_MACRO( FT_Stream_GetUOffset, FT_ULong )
|
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Int32 )
|
||||||
#define FT_GET_LONG() FT_GET_MACRO( FT_Stream_GetULong, FT_Long )
|
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
|
||||||
#define FT_GET_ULONG() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_UInt32 )
|
||||||
#define FT_GET_TAG4() FT_GET_MACRO( FT_Stream_GetULong, FT_ULong )
|
|
||||||
|
|
||||||
#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Short )
|
#define FT_GET_SHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_Int16 )
|
||||||
#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UShort )
|
#define FT_GET_USHORT_LE() FT_GET_MACRO( FT_Stream_GetUShortLE, FT_UInt16 )
|
||||||
#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Long )
|
#define FT_GET_LONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_Int32 )
|
||||||
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_ULong )
|
#define FT_GET_ULONG_LE() FT_GET_MACRO( FT_Stream_GetULongLE, FT_UInt32 )
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
@ -333,19 +332,18 @@ FT_BEGIN_HEADER
|
|||||||
* `FT_STREAM_POS'. They use the full machinery to check whether a read is
|
* `FT_STREAM_POS'. They use the full machinery to check whether a read is
|
||||||
* valid.
|
* valid.
|
||||||
*/
|
*/
|
||||||
#define FT_READ_BYTE( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, 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_ReadChar, FT_Char, 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_SHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_Int16, var )
|
||||||
#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UShort, var )
|
#define FT_READ_USHORT( var ) FT_READ_MACRO( FT_Stream_ReadUShort, FT_UInt16, 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_UInt32, 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_Int32, 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_UInt32, var )
|
||||||
#define FT_READ_ULONG( var ) FT_READ_MACRO( FT_Stream_ReadULong, FT_ULong, var )
|
|
||||||
|
|
||||||
#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Short, var )
|
#define FT_READ_SHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_Int16, var )
|
||||||
#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UShort, var )
|
#define FT_READ_USHORT_LE( var ) FT_READ_MACRO( FT_Stream_ReadUShortLE, FT_UInt16, var )
|
||||||
#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Long, var )
|
#define FT_READ_LONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_Int32, var )
|
||||||
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_ULong, var )
|
#define FT_READ_ULONG_LE( var ) FT_READ_MACRO( FT_Stream_ReadULongLE, FT_UInt32, var )
|
||||||
|
|
||||||
|
|
||||||
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
|
||||||
@ -457,37 +455,37 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
|
|
||||||
/* read a byte from an entered frame */
|
/* read a byte from an entered frame */
|
||||||
FT_BASE( FT_Char )
|
FT_BASE( FT_Byte )
|
||||||
FT_Stream_GetChar( FT_Stream stream );
|
FT_Stream_GetByte( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 16-bit big-endian unsigned integer from an entered frame */
|
/* read a 16-bit big-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_UShort )
|
FT_BASE( FT_UInt16 )
|
||||||
FT_Stream_GetUShort( FT_Stream stream );
|
FT_Stream_GetUShort( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 24-bit big-endian unsigned integer from an entered frame */
|
/* read a 24-bit big-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_GetUOffset( FT_Stream stream );
|
FT_Stream_GetUOffset( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 32-bit big-endian unsigned integer from an entered frame */
|
/* read a 32-bit big-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_GetULong( FT_Stream stream );
|
FT_Stream_GetULong( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 16-bit little-endian unsigned integer from an entered frame */
|
/* read a 16-bit little-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_UShort )
|
FT_BASE( FT_UInt16 )
|
||||||
FT_Stream_GetUShortLE( FT_Stream stream );
|
FT_Stream_GetUShortLE( FT_Stream stream );
|
||||||
|
|
||||||
/* read a 32-bit little-endian unsigned integer from an entered frame */
|
/* read a 32-bit little-endian unsigned integer from an entered frame */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_GetULongLE( FT_Stream stream );
|
FT_Stream_GetULongLE( FT_Stream stream );
|
||||||
|
|
||||||
|
|
||||||
/* read a byte from a stream */
|
/* read a byte from a stream */
|
||||||
FT_BASE( FT_Char )
|
FT_BASE( FT_Byte )
|
||||||
FT_Stream_ReadChar( FT_Stream stream,
|
FT_Stream_ReadByte( FT_Stream stream,
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
/* read a 16-bit big-endian unsigned integer from a stream */
|
/* read a 16-bit big-endian unsigned integer from a stream */
|
||||||
FT_BASE( FT_UShort )
|
FT_BASE( FT_UInt16 )
|
||||||
FT_Stream_ReadUShort( FT_Stream stream,
|
FT_Stream_ReadUShort( FT_Stream stream,
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
@ -497,17 +495,17 @@ FT_BEGIN_HEADER
|
|||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
/* read a 32-bit big-endian integer from a stream */
|
/* read a 32-bit big-endian integer from a stream */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_ReadULong( FT_Stream stream,
|
FT_Stream_ReadULong( FT_Stream stream,
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
/* read a 16-bit little-endian unsigned integer from a stream */
|
/* read a 16-bit little-endian unsigned integer from a stream */
|
||||||
FT_BASE( FT_UShort )
|
FT_BASE( FT_UInt16 )
|
||||||
FT_Stream_ReadUShortLE( FT_Stream stream,
|
FT_Stream_ReadUShortLE( FT_Stream stream,
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
/* read a 32-bit little-endian unsigned integer from a stream */
|
/* read a 32-bit little-endian unsigned integer from a stream */
|
||||||
FT_BASE( FT_ULong )
|
FT_BASE( FT_UInt32 )
|
||||||
FT_Stream_ReadULongLE( FT_Stream stream,
|
FT_Stream_ReadULongLE( FT_Stream stream,
|
||||||
FT_Error* error );
|
FT_Error* error );
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Tracing handling (specification only).
|
* Tracing handling (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2002-2020 by
|
* Copyright (C) 2002-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -18,6 +18,11 @@
|
|||||||
|
|
||||||
/* definitions of trace levels for FreeType 2 */
|
/* 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' */
|
/* the first level must always be `trace_any' */
|
||||||
FT_TRACE_DEF( 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( mm ) /* MM interface (ftmm.c) */
|
||||||
FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
|
FT_TRACE_DEF( psprops ) /* PS driver properties (ftpsprop.c) */
|
||||||
FT_TRACE_DEF( raccess ) /* resource fork accessor (ftrfork.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) */
|
FT_TRACE_DEF( synth ) /* bold/slant synthesizer (ftsynth.c) */
|
||||||
|
|
||||||
/* Cache sub-system */
|
/* rasterizers */
|
||||||
FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
|
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 */
|
/* SFNT driver components */
|
||||||
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
|
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
|
||||||
@ -54,6 +64,8 @@ FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
|
|||||||
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
|
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
|
||||||
FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */
|
FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */
|
||||||
FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */
|
FT_TRACE_DEF( ttcpal ) /* color palette table (ttcpal.c) */
|
||||||
|
FT_TRACE_DEF( ttgpos ) /* GPOS handler (ttgpos.c) */
|
||||||
|
FT_TRACE_DEF( ttsvg ) /* OpenType SVG table (ttsvg.c) */
|
||||||
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
|
FT_TRACE_DEF( ttkern ) /* kerning handler (ttkern.c) */
|
||||||
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
|
FT_TRACE_DEF( ttload ) /* basic TrueType tables (ttload.c) */
|
||||||
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
|
FT_TRACE_DEF( ttmtx ) /* metrics-related tables (ttmtx.c) */
|
||||||
@ -77,6 +89,7 @@ FT_TRACE_DEF( t1objs )
|
|||||||
FT_TRACE_DEF( t1parse )
|
FT_TRACE_DEF( t1parse )
|
||||||
|
|
||||||
/* PostScript helper module `psaux' */
|
/* PostScript helper module `psaux' */
|
||||||
|
FT_TRACE_DEF( afmparse )
|
||||||
FT_TRACE_DEF( cffdecode )
|
FT_TRACE_DEF( cffdecode )
|
||||||
FT_TRACE_DEF( psconv )
|
FT_TRACE_DEF( psconv )
|
||||||
FT_TRACE_DEF( psobjs )
|
FT_TRACE_DEF( psobjs )
|
||||||
@ -151,8 +164,10 @@ FT_TRACE_DEF( afglobal )
|
|||||||
FT_TRACE_DEF( afhints )
|
FT_TRACE_DEF( afhints )
|
||||||
FT_TRACE_DEF( afmodule )
|
FT_TRACE_DEF( afmodule )
|
||||||
FT_TRACE_DEF( aflatin )
|
FT_TRACE_DEF( aflatin )
|
||||||
FT_TRACE_DEF( aflatin2 )
|
|
||||||
FT_TRACE_DEF( afshaper )
|
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 */
|
/* END */
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType validation support (specification).
|
* FreeType validation support (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004-2020 by
|
* Copyright (C) 2004-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Auxiliary functions and data structures related to PostScript fonts
|
* Auxiliary functions and data structures related to PostScript fonts
|
||||||
* (specification).
|
* (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -132,9 +132,6 @@ FT_BEGIN_HEADER
|
|||||||
* max_elems ::
|
* max_elems ::
|
||||||
* The maximum number of elements in table.
|
* The maximum number of elements in table.
|
||||||
*
|
*
|
||||||
* num_elems ::
|
|
||||||
* The current number of elements in table.
|
|
||||||
*
|
|
||||||
* elements ::
|
* elements ::
|
||||||
* A table of element addresses within the block.
|
* A table of element addresses within the block.
|
||||||
*
|
*
|
||||||
@ -155,7 +152,6 @@ FT_BEGIN_HEADER
|
|||||||
FT_ULong init;
|
FT_ULong init;
|
||||||
|
|
||||||
FT_Int max_elems;
|
FT_Int max_elems;
|
||||||
FT_Int num_elems;
|
|
||||||
FT_Byte** elements; /* addresses of table elements */
|
FT_Byte** elements; /* addresses of table elements */
|
||||||
FT_UInt* lengths; /* lengths of table elements */
|
FT_UInt* lengths; /* lengths of table elements */
|
||||||
|
|
||||||
@ -229,6 +225,7 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
typedef enum T1_FieldLocation_
|
typedef enum T1_FieldLocation_
|
||||||
{
|
{
|
||||||
|
T1_FIELD_LOCATION_NONE = 0,
|
||||||
T1_FIELD_LOCATION_CID_INFO,
|
T1_FIELD_LOCATION_CID_INFO,
|
||||||
T1_FIELD_LOCATION_FONT_DICT,
|
T1_FIELD_LOCATION_FONT_DICT,
|
||||||
T1_FIELD_LOCATION_FONT_EXTRA,
|
T1_FIELD_LOCATION_FONT_EXTRA,
|
||||||
@ -253,6 +250,7 @@ FT_BEGIN_HEADER
|
|||||||
/* structure type used to model object fields */
|
/* structure type used to model object fields */
|
||||||
typedef struct T1_FieldRec_
|
typedef struct T1_FieldRec_
|
||||||
{
|
{
|
||||||
|
FT_UInt len; /* field identifier length */
|
||||||
const char* ident; /* field identifier */
|
const char* ident; /* field identifier */
|
||||||
T1_FieldLocation location;
|
T1_FieldLocation location;
|
||||||
T1_FieldType type; /* type of field */
|
T1_FieldType type; /* type of field */
|
||||||
@ -277,8 +275,9 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \
|
#define T1_NEW_SIMPLE_FIELD( _ident, _type, _fname, _dict ) \
|
||||||
{ \
|
{ \
|
||||||
|
sizeof ( _ident ) - 1, \
|
||||||
_ident, T1CODE, _type, \
|
_ident, T1CODE, _type, \
|
||||||
0, \
|
NULL, \
|
||||||
FT_FIELD_OFFSET( _fname ), \
|
FT_FIELD_OFFSET( _fname ), \
|
||||||
FT_FIELD_SIZE( _fname ), \
|
FT_FIELD_SIZE( _fname ), \
|
||||||
0, 0, \
|
0, 0, \
|
||||||
@ -287,6 +286,7 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \
|
#define T1_NEW_CALLBACK_FIELD( _ident, _reader, _dict ) \
|
||||||
{ \
|
{ \
|
||||||
|
sizeof ( _ident ) - 1, \
|
||||||
_ident, T1CODE, T1_FIELD_TYPE_CALLBACK, \
|
_ident, T1CODE, T1_FIELD_TYPE_CALLBACK, \
|
||||||
(T1_Field_ParseFunc)_reader, \
|
(T1_Field_ParseFunc)_reader, \
|
||||||
0, 0, \
|
0, 0, \
|
||||||
@ -296,8 +296,9 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \
|
#define T1_NEW_TABLE_FIELD( _ident, _type, _fname, _max, _dict ) \
|
||||||
{ \
|
{ \
|
||||||
|
sizeof ( _ident ) - 1, \
|
||||||
_ident, T1CODE, _type, \
|
_ident, T1CODE, _type, \
|
||||||
0, \
|
NULL, \
|
||||||
FT_FIELD_OFFSET( _fname ), \
|
FT_FIELD_OFFSET( _fname ), \
|
||||||
FT_FIELD_SIZE_DELTA( _fname ), \
|
FT_FIELD_SIZE_DELTA( _fname ), \
|
||||||
_max, \
|
_max, \
|
||||||
@ -307,8 +308,9 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \
|
#define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max, _dict ) \
|
||||||
{ \
|
{ \
|
||||||
|
sizeof ( _ident ) - 1, \
|
||||||
_ident, T1CODE, _type, \
|
_ident, T1CODE, _type, \
|
||||||
0, \
|
NULL, \
|
||||||
FT_FIELD_OFFSET( _fname ), \
|
FT_FIELD_OFFSET( _fname ), \
|
||||||
FT_FIELD_SIZE_DELTA( _fname ), \
|
FT_FIELD_SIZE_DELTA( _fname ), \
|
||||||
_max, 0, \
|
_max, 0, \
|
||||||
@ -358,6 +360,13 @@ FT_BEGIN_HEADER
|
|||||||
#define T1_FIELD_CALLBACK( _ident, _name, _dict ) \
|
#define T1_FIELD_CALLBACK( _ident, _name, _dict ) \
|
||||||
T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )
|
T1_NEW_CALLBACK_FIELD( _ident, _name, _dict )
|
||||||
|
|
||||||
|
#define T1_FIELD_ZERO \
|
||||||
|
{ \
|
||||||
|
0, \
|
||||||
|
NULL, T1_FIELD_LOCATION_NONE, T1_FIELD_TYPE_NONE, \
|
||||||
|
NULL, 0, 0, 0, 0, 0 \
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
|
|||||||
@ -6,7 +6,7 @@
|
|||||||
* recorders (specification only). These are used to support native
|
* recorders (specification only). These are used to support native
|
||||||
* T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
|
* T1/T2 hints in the 'type1', 'cid', and 'cff' font drivers.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2001-2020 by
|
* Copyright (C) 2001-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -294,7 +294,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* On input, all points within the outline are in font coordinates. On
|
* On input, all points within the outline are in font coordinates. On
|
||||||
* output, they are in 1/64th of pixels.
|
* output, they are in 1/64 of pixels.
|
||||||
*
|
*
|
||||||
* The scaling transformation is taken from the 'globals' object which
|
* The scaling transformation is taken from the 'globals' object which
|
||||||
* must correspond to the same font as the glyph.
|
* must correspond to the same font as the glyph.
|
||||||
@ -607,7 +607,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* On input, all points within the outline are in font coordinates. On
|
* On input, all points within the outline are in font coordinates. On
|
||||||
* output, they are in 1/64th of pixels.
|
* output, they are in 1/64 of pixels.
|
||||||
*
|
*
|
||||||
* The scaling transformation is taken from the 'globals' object which
|
* The scaling transformation is taken from the 'globals' object which
|
||||||
* must correspond to the same font than the glyph.
|
* must correspond to the same font than the glyph.
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType BDF services (specification).
|
* The FreeType BDF services (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType CFF tables loader service (specification).
|
* The FreeType CFF tables loader service (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2017-2020 by
|
* Copyright (C) 2017-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType CID font services (specification).
|
* The FreeType CID font services (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2020 by
|
* Copyright (C) 2007-2024 by
|
||||||
* Derek Clegg and Michael Toftdal.
|
* Derek Clegg and Michael Toftdal.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType font format service (specification only).
|
* The FreeType font format service (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType glyph dictionary services (specification).
|
* The FreeType glyph dictionary services (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType API for validating TrueTypeGX/AAT tables (specification).
|
* FreeType API for validating TrueTypeGX/AAT tables (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004-2020 by
|
* Copyright (C) 2004-2024 by
|
||||||
* Masatake YAMATO, Red Hat K.K.,
|
* Masatake YAMATO, Red Hat K.K.,
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType Kerning service (specification).
|
* The FreeType Kerning service (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 by
|
* Copyright (C) 2006-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType services for metrics variations (specification).
|
* The FreeType services for metrics variations (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2016-2020 by
|
* Copyright (C) 2016-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -77,6 +77,9 @@ FT_BEGIN_HEADER
|
|||||||
typedef void
|
typedef void
|
||||||
(*FT_Metrics_Adjust_Func)( FT_Face face );
|
(*FT_Metrics_Adjust_Func)( FT_Face face );
|
||||||
|
|
||||||
|
typedef FT_Error
|
||||||
|
(*FT_Size_Reset_Func)( FT_Size size );
|
||||||
|
|
||||||
|
|
||||||
FT_DEFINE_SERVICE( MetricsVariations )
|
FT_DEFINE_SERVICE( MetricsVariations )
|
||||||
{
|
{
|
||||||
@ -90,6 +93,7 @@ FT_BEGIN_HEADER
|
|||||||
FT_VOrg_Adjust_Func vorg_adjust;
|
FT_VOrg_Adjust_Func vorg_adjust;
|
||||||
|
|
||||||
FT_Metrics_Adjust_Func metrics_adjust;
|
FT_Metrics_Adjust_Func metrics_adjust;
|
||||||
|
FT_Size_Reset_Func size_reset;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@ -101,7 +105,8 @@ FT_BEGIN_HEADER
|
|||||||
tsb_adjust_, \
|
tsb_adjust_, \
|
||||||
bsb_adjust_, \
|
bsb_adjust_, \
|
||||||
vorg_adjust_, \
|
vorg_adjust_, \
|
||||||
metrics_adjust_ ) \
|
metrics_adjust_, \
|
||||||
|
size_reset_ ) \
|
||||||
static const FT_Service_MetricsVariationsRec class_ = \
|
static const FT_Service_MetricsVariationsRec class_ = \
|
||||||
{ \
|
{ \
|
||||||
hadvance_adjust_, \
|
hadvance_adjust_, \
|
||||||
@ -111,7 +116,8 @@ FT_BEGIN_HEADER
|
|||||||
tsb_adjust_, \
|
tsb_adjust_, \
|
||||||
bsb_adjust_, \
|
bsb_adjust_, \
|
||||||
vorg_adjust_, \
|
vorg_adjust_, \
|
||||||
metrics_adjust_ \
|
metrics_adjust_, \
|
||||||
|
size_reset_ \
|
||||||
};
|
};
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
@ -4,8 +4,8 @@
|
|||||||
*
|
*
|
||||||
* The FreeType Multiple Masters and GX var services (specification).
|
* The FreeType Multiple Masters and GX var services (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, Werner Lemberg, and Dominik Röttsches.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
* modified, and distributed under the terms of the FreeType project
|
* modified, and distributed under the terms of the FreeType project
|
||||||
@ -19,7 +19,9 @@
|
|||||||
#ifndef SVMM_H_
|
#ifndef SVMM_H_
|
||||||
#define SVMM_H_
|
#define SVMM_H_
|
||||||
|
|
||||||
|
#include <freetype/ftmm.h>
|
||||||
#include <freetype/internal/ftserv.h>
|
#include <freetype/internal/ftserv.h>
|
||||||
|
#include <freetype/internal/ftmmtypes.h>
|
||||||
|
|
||||||
|
|
||||||
FT_BEGIN_HEADER
|
FT_BEGIN_HEADER
|
||||||
@ -58,9 +60,9 @@ FT_BEGIN_HEADER
|
|||||||
/* use return value -1 to indicate that the new coordinates */
|
/* use return value -1 to indicate that the new coordinates */
|
||||||
/* are equal to the current ones; no changes are thus needed */
|
/* are equal to the current ones; no changes are thus needed */
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Set_MM_Blend_Func)( FT_Face face,
|
(*FT_Set_MM_Blend_Func)( FT_Face face,
|
||||||
FT_UInt num_coords,
|
FT_UInt num_coords,
|
||||||
FT_Long* coords );
|
FT_Fixed* coords );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Get_Var_Design_Func)( FT_Face face,
|
(*FT_Get_Var_Design_Func)( FT_Face face,
|
||||||
@ -68,13 +70,17 @@ FT_BEGIN_HEADER
|
|||||||
FT_Fixed* coords );
|
FT_Fixed* coords );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Set_Instance_Func)( FT_Face face,
|
(*FT_Set_Named_Instance_Func)( FT_Face face,
|
||||||
FT_UInt instance_index );
|
FT_UInt instance_index );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Get_MM_Blend_Func)( FT_Face face,
|
(*FT_Get_Default_Named_Instance_Func)( FT_Face face,
|
||||||
FT_UInt num_coords,
|
FT_UInt *instance_index );
|
||||||
FT_Long* coords );
|
|
||||||
|
typedef FT_Error
|
||||||
|
(*FT_Get_MM_Blend_Func)( FT_Face face,
|
||||||
|
FT_UInt num_coords,
|
||||||
|
FT_Fixed* coords );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Get_Var_Blend_Func)( FT_Face face,
|
(*FT_Get_Var_Blend_Func)( FT_Face face,
|
||||||
@ -84,7 +90,7 @@ FT_BEGIN_HEADER
|
|||||||
FT_MM_Var* *mm_var );
|
FT_MM_Var* *mm_var );
|
||||||
|
|
||||||
typedef void
|
typedef void
|
||||||
(*FT_Done_Blend_Func)( FT_Face );
|
(*FT_Done_Blend_Func)( FT_Face face );
|
||||||
|
|
||||||
typedef FT_Error
|
typedef FT_Error
|
||||||
(*FT_Set_MM_WeightVector_Func)( FT_Face face,
|
(*FT_Set_MM_WeightVector_Func)( FT_Face face,
|
||||||
@ -96,53 +102,105 @@ FT_BEGIN_HEADER
|
|||||||
FT_UInt* len,
|
FT_UInt* len,
|
||||||
FT_Fixed* weight_vector );
|
FT_Fixed* weight_vector );
|
||||||
|
|
||||||
|
typedef void
|
||||||
|
(*FT_Construct_PS_Name_Func)( FT_Face face );
|
||||||
|
|
||||||
|
typedef FT_Error
|
||||||
|
(*FT_Var_Load_Delta_Set_Idx_Map_Func)( FT_Face face,
|
||||||
|
FT_ULong offset,
|
||||||
|
GX_DeltaSetIdxMap map,
|
||||||
|
GX_ItemVarStore itemStore,
|
||||||
|
FT_ULong table_len );
|
||||||
|
|
||||||
|
typedef FT_Error
|
||||||
|
(*FT_Var_Load_Item_Var_Store_Func)( FT_Face face,
|
||||||
|
FT_ULong offset,
|
||||||
|
GX_ItemVarStore itemStore );
|
||||||
|
|
||||||
|
typedef FT_ItemVarDelta
|
||||||
|
(*FT_Var_Get_Item_Delta_Func)( FT_Face face,
|
||||||
|
GX_ItemVarStore itemStore,
|
||||||
|
FT_UInt outerIndex,
|
||||||
|
FT_UInt innerIndex );
|
||||||
|
|
||||||
|
typedef void
|
||||||
|
(*FT_Var_Done_Item_Var_Store_Func)( FT_Face face,
|
||||||
|
GX_ItemVarStore itemStore );
|
||||||
|
|
||||||
|
typedef void
|
||||||
|
(*FT_Var_Done_Delta_Set_Idx_Map_Func)( FT_Face face,
|
||||||
|
GX_DeltaSetIdxMap deltaSetIdxMap );
|
||||||
|
|
||||||
|
|
||||||
FT_DEFINE_SERVICE( MultiMasters )
|
FT_DEFINE_SERVICE( MultiMasters )
|
||||||
{
|
{
|
||||||
FT_Get_MM_Func get_mm;
|
FT_Get_MM_Func get_mm;
|
||||||
FT_Set_MM_Design_Func set_mm_design;
|
FT_Set_MM_Design_Func set_mm_design;
|
||||||
FT_Set_MM_Blend_Func set_mm_blend;
|
FT_Set_MM_Blend_Func set_mm_blend;
|
||||||
FT_Get_MM_Blend_Func get_mm_blend;
|
FT_Get_MM_Blend_Func get_mm_blend;
|
||||||
FT_Get_MM_Var_Func get_mm_var;
|
FT_Get_MM_Var_Func get_mm_var;
|
||||||
FT_Set_Var_Design_Func set_var_design;
|
FT_Set_Var_Design_Func set_var_design;
|
||||||
FT_Get_Var_Design_Func get_var_design;
|
FT_Get_Var_Design_Func get_var_design;
|
||||||
FT_Set_Instance_Func set_instance;
|
FT_Set_Named_Instance_Func set_named_instance;
|
||||||
FT_Set_MM_WeightVector_Func set_mm_weightvector;
|
FT_Get_Default_Named_Instance_Func get_default_named_instance;
|
||||||
FT_Get_MM_WeightVector_Func get_mm_weightvector;
|
FT_Set_MM_WeightVector_Func set_mm_weightvector;
|
||||||
|
FT_Get_MM_WeightVector_Func get_mm_weightvector;
|
||||||
|
|
||||||
/* for internal use; only needed for code sharing between modules */
|
/* for internal use; only needed for code sharing between modules */
|
||||||
FT_Get_Var_Blend_Func get_var_blend;
|
FT_Construct_PS_Name_Func construct_ps_name;
|
||||||
FT_Done_Blend_Func done_blend;
|
FT_Var_Load_Delta_Set_Idx_Map_Func load_delta_set_idx_map;
|
||||||
|
FT_Var_Load_Item_Var_Store_Func load_item_var_store;
|
||||||
|
FT_Var_Get_Item_Delta_Func get_item_delta;
|
||||||
|
FT_Var_Done_Item_Var_Store_Func done_item_var_store;
|
||||||
|
FT_Var_Done_Delta_Set_Idx_Map_Func done_delta_set_idx_map;
|
||||||
|
FT_Get_Var_Blend_Func get_var_blend;
|
||||||
|
FT_Done_Blend_Func done_blend;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
|
#define FT_DEFINE_SERVICE_MULTIMASTERSREC( class_, \
|
||||||
get_mm_, \
|
get_mm_, \
|
||||||
set_mm_design_, \
|
set_mm_design_, \
|
||||||
set_mm_blend_, \
|
set_mm_blend_, \
|
||||||
get_mm_blend_, \
|
get_mm_blend_, \
|
||||||
get_mm_var_, \
|
get_mm_var_, \
|
||||||
set_var_design_, \
|
set_var_design_, \
|
||||||
get_var_design_, \
|
get_var_design_, \
|
||||||
set_instance_, \
|
set_named_instance_, \
|
||||||
set_weightvector_, \
|
get_default_named_instance_, \
|
||||||
get_weightvector_, \
|
set_mm_weightvector_, \
|
||||||
get_var_blend_, \
|
get_mm_weightvector_, \
|
||||||
done_blend_ ) \
|
\
|
||||||
static const FT_Service_MultiMastersRec class_ = \
|
construct_ps_name_, \
|
||||||
{ \
|
load_delta_set_idx_map_, \
|
||||||
get_mm_, \
|
load_item_var_store_, \
|
||||||
set_mm_design_, \
|
get_item_delta_, \
|
||||||
set_mm_blend_, \
|
done_item_var_store_, \
|
||||||
get_mm_blend_, \
|
done_delta_set_idx_map_, \
|
||||||
get_mm_var_, \
|
get_var_blend_, \
|
||||||
set_var_design_, \
|
done_blend_ ) \
|
||||||
get_var_design_, \
|
static const FT_Service_MultiMastersRec class_ = \
|
||||||
set_instance_, \
|
{ \
|
||||||
set_weightvector_, \
|
get_mm_, \
|
||||||
get_weightvector_, \
|
set_mm_design_, \
|
||||||
get_var_blend_, \
|
set_mm_blend_, \
|
||||||
done_blend_ \
|
get_mm_blend_, \
|
||||||
|
get_mm_var_, \
|
||||||
|
set_var_design_, \
|
||||||
|
get_var_design_, \
|
||||||
|
set_named_instance_, \
|
||||||
|
get_default_named_instance_, \
|
||||||
|
set_mm_weightvector_, \
|
||||||
|
get_mm_weightvector_, \
|
||||||
|
\
|
||||||
|
construct_ps_name_, \
|
||||||
|
load_delta_set_idx_map_, \
|
||||||
|
load_item_var_store_, \
|
||||||
|
get_item_delta_, \
|
||||||
|
done_item_var_store_, \
|
||||||
|
done_delta_set_idx_map_, \
|
||||||
|
get_var_blend_, \
|
||||||
|
done_blend_ \
|
||||||
};
|
};
|
||||||
|
|
||||||
/* */
|
/* */
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType OpenType validation service (specification).
|
* The FreeType OpenType validation service (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2004-2020 by
|
* Copyright (C) 2004-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Internal PFR service functions (specification).
|
* Internal PFR service functions (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType PostScript name services (specification).
|
* The FreeType PostScript name services (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType property service (specification).
|
* The FreeType property service (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012-2020 by
|
* Copyright (C) 2012-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType PostScript charmap service (specification).
|
* The FreeType PostScript charmap service (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -97,7 +97,7 @@ FT_BEGIN_HEADER
|
|||||||
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
|
(*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes,
|
||||||
FT_UInt32 unicode );
|
FT_UInt32 unicode );
|
||||||
|
|
||||||
typedef FT_UInt32
|
typedef FT_UInt
|
||||||
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
|
(*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes,
|
||||||
FT_UInt32 *unicode );
|
FT_UInt32 *unicode );
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType PostScript info service (specification).
|
* The FreeType PostScript info service (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType SFNT table loading service (specification).
|
* The FreeType SFNT table loading service (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType TrueType/sfnt cmap extra information service.
|
* The FreeType TrueType/sfnt cmap extra information service.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* Masatake YAMATO, Redhat K.K.,
|
* Masatake YAMATO, Redhat K.K.,
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType TrueType engine query service (specification).
|
* The FreeType TrueType engine query service (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 by
|
* Copyright (C) 2006-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType TrueType glyph service.
|
* The FreeType TrueType glyph service.
|
||||||
*
|
*
|
||||||
* Copyright (C) 2007-2020 by
|
* Copyright (C) 2007-2024 by
|
||||||
* David Turner.
|
* David Turner.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* The FreeType Windows FNT/FONT service (specification).
|
* The FreeType Windows FNT/FONT service (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2003-2020 by
|
* Copyright (C) 2003-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* High-level 'sfnt' driver interface (specification).
|
* High-level 'sfnt' driver interface (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -311,6 +311,33 @@ FT_BEGIN_HEADER
|
|||||||
TT_SBit_MetricsRec *ametrics );
|
TT_SBit_MetricsRec *ametrics );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* TT_Load_Svg_Doc_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Scan the SVG document list to find the document containing the glyph
|
||||||
|
* that has the ID 'glyph*XXX*', where *XXX* is the value of
|
||||||
|
* `glyph_index` as a decimal integer.
|
||||||
|
*
|
||||||
|
* @inout:
|
||||||
|
* glyph ::
|
||||||
|
* The glyph slot from which pointers to the SVG document list is to be
|
||||||
|
* grabbed. The results are stored back in the slot.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* glyph_index ::
|
||||||
|
* The index of the glyph that is to be looked up.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* FreeType error code. 0 means success.
|
||||||
|
*/
|
||||||
|
typedef FT_Error
|
||||||
|
(*TT_Load_Svg_Doc_Func)( FT_GlyphSlot glyph,
|
||||||
|
FT_UInt glyph_index );
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @functype:
|
* @functype:
|
||||||
@ -524,6 +551,170 @@ FT_BEGIN_HEADER
|
|||||||
FT_LayerIterator* iterator );
|
FT_LayerIterator* iterator );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* TT_Get_Color_Glyph_Paint_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Find the root @FT_OpaquePaint object for a given glyph ID.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* face ::
|
||||||
|
* The target face object.
|
||||||
|
*
|
||||||
|
* base_glyph ::
|
||||||
|
* The glyph index the colored glyph layers are associated with.
|
||||||
|
*
|
||||||
|
* @output:
|
||||||
|
* paint ::
|
||||||
|
* The root @FT_OpaquePaint object.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* Value~1 if everything is OK. If no color glyph is found, or the root
|
||||||
|
* paint could not be retrieved, value~0 gets returned. In case of an
|
||||||
|
* error, value~0 is returned also.
|
||||||
|
*/
|
||||||
|
typedef FT_Bool
|
||||||
|
( *TT_Get_Color_Glyph_Paint_Func )( TT_Face face,
|
||||||
|
FT_UInt base_glyph,
|
||||||
|
FT_Color_Root_Transform root_transform,
|
||||||
|
FT_OpaquePaint *paint );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* TT_Get_Color_Glyph_ClipBox_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Search for a 'COLR' v1 clip box for the specified `base_glyph` and
|
||||||
|
* fill the `clip_box` parameter with the 'COLR' v1 'ClipBox' information
|
||||||
|
* if one is found.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* face ::
|
||||||
|
* A handle to the parent face object.
|
||||||
|
*
|
||||||
|
* base_glyph ::
|
||||||
|
* The glyph index for which to retrieve the clip box.
|
||||||
|
*
|
||||||
|
* @output:
|
||||||
|
* clip_box ::
|
||||||
|
* The clip box for the requested `base_glyph` if one is found. The
|
||||||
|
* clip box is computed taking scale and transformations configured on
|
||||||
|
* the @FT_Face into account. @FT_ClipBox contains @FT_Vector values
|
||||||
|
* in 26.6 format.
|
||||||
|
*
|
||||||
|
* @note:
|
||||||
|
* To retrieve the clip box in font units, reset scale to units-per-em
|
||||||
|
* and remove transforms configured using @FT_Set_Transform.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* Value~1 if a ClipBox is found. If no clip box is found or an
|
||||||
|
* error occured, value~0 is returned.
|
||||||
|
*/
|
||||||
|
typedef FT_Bool
|
||||||
|
( *TT_Get_Color_Glyph_ClipBox_Func )( TT_Face face,
|
||||||
|
FT_UInt base_glyph,
|
||||||
|
FT_ClipBox* clip_box );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* TT_Get_Paint_Layers_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Access the layers of a `PaintColrLayers` table.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* face ::
|
||||||
|
* The target face object.
|
||||||
|
*
|
||||||
|
* @inout:
|
||||||
|
* iterator ::
|
||||||
|
* The @FT_LayerIterator from an @FT_PaintColrLayers object, for which
|
||||||
|
* the layers are to be retrieved. The internal state of the iterator
|
||||||
|
* is incremented after one call to this function for retrieving one
|
||||||
|
* layer.
|
||||||
|
*
|
||||||
|
* @output:
|
||||||
|
* paint ::
|
||||||
|
* The root @FT_OpaquePaint object referencing the actual paint table.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* Value~1 if everything is OK. Value~0 gets returned when the paint
|
||||||
|
* object can not be retrieved or any other error occurs.
|
||||||
|
*/
|
||||||
|
typedef FT_Bool
|
||||||
|
( *TT_Get_Paint_Layers_Func )( TT_Face face,
|
||||||
|
FT_LayerIterator* iterator,
|
||||||
|
FT_OpaquePaint *paint );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* TT_Get_Colorline_Stops_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Get the gradient and solid fill information for a given glyph.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* face ::
|
||||||
|
* The target face object.
|
||||||
|
*
|
||||||
|
* @inout:
|
||||||
|
* iterator ::
|
||||||
|
* An @FT_ColorStopIterator object. For the first call you should set
|
||||||
|
* `iterator->p` to `NULL`. For all following calls, simply use the
|
||||||
|
* same object again.
|
||||||
|
*
|
||||||
|
* @output:
|
||||||
|
* color_stop ::
|
||||||
|
* Color index and alpha value for the retrieved color stop.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* Value~1 if everything is OK. If there are no more color stops,
|
||||||
|
* value~0 gets returned. In case of an error, value~0 is returned
|
||||||
|
* also.
|
||||||
|
*/
|
||||||
|
typedef FT_Bool
|
||||||
|
( *TT_Get_Colorline_Stops_Func )( TT_Face face,
|
||||||
|
FT_ColorStop *color_stop,
|
||||||
|
FT_ColorStopIterator* iterator );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* TT_Get_Paint_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* Get the paint details for a given @FT_OpaquePaint object.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* face ::
|
||||||
|
* The target face object.
|
||||||
|
*
|
||||||
|
* opaque_paint ::
|
||||||
|
* The @FT_OpaquePaint object.
|
||||||
|
*
|
||||||
|
* @output:
|
||||||
|
* paint ::
|
||||||
|
* An @FT_COLR_Paint object holding the details on `opaque_paint`.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* Value~1 if everything is OK. Value~0 if no details can be found for
|
||||||
|
* this paint or any other error occured.
|
||||||
|
*/
|
||||||
|
typedef FT_Bool
|
||||||
|
( *TT_Get_Paint_Func )( TT_Face face,
|
||||||
|
FT_OpaquePaint opaque_paint,
|
||||||
|
FT_COLR_Paint *paint );
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @functype:
|
* @functype:
|
||||||
@ -709,73 +900,86 @@ FT_BEGIN_HEADER
|
|||||||
*/
|
*/
|
||||||
typedef struct SFNT_Interface_
|
typedef struct SFNT_Interface_
|
||||||
{
|
{
|
||||||
TT_Loader_GotoTableFunc goto_table;
|
TT_Loader_GotoTableFunc goto_table;
|
||||||
|
|
||||||
TT_Init_Face_Func init_face;
|
TT_Init_Face_Func init_face;
|
||||||
TT_Load_Face_Func load_face;
|
TT_Load_Face_Func load_face;
|
||||||
TT_Done_Face_Func done_face;
|
TT_Done_Face_Func done_face;
|
||||||
FT_Module_Requester get_interface;
|
FT_Module_Requester get_interface;
|
||||||
|
|
||||||
TT_Load_Any_Func load_any;
|
TT_Load_Any_Func load_any;
|
||||||
|
|
||||||
/* these functions are called by `load_face' but they can also */
|
/* these functions are called by `load_face' but they can also */
|
||||||
/* be called from external modules, if there is a need to do so */
|
/* be called from external modules, if there is a need to do so */
|
||||||
TT_Load_Table_Func load_head;
|
TT_Load_Table_Func load_head;
|
||||||
TT_Load_Metrics_Func load_hhea;
|
TT_Load_Metrics_Func load_hhea;
|
||||||
TT_Load_Table_Func load_cmap;
|
TT_Load_Table_Func load_cmap;
|
||||||
TT_Load_Table_Func load_maxp;
|
TT_Load_Table_Func load_maxp;
|
||||||
TT_Load_Table_Func load_os2;
|
TT_Load_Table_Func load_os2;
|
||||||
TT_Load_Table_Func load_post;
|
TT_Load_Table_Func load_post;
|
||||||
|
|
||||||
TT_Load_Table_Func load_name;
|
TT_Load_Table_Func load_name;
|
||||||
TT_Free_Table_Func free_name;
|
TT_Free_Table_Func free_name;
|
||||||
|
|
||||||
/* this field was called `load_kerning' up to version 2.1.10 */
|
/* this field was called `load_kerning' up to version 2.1.10 */
|
||||||
TT_Load_Table_Func load_kern;
|
TT_Load_Table_Func load_kern;
|
||||||
|
|
||||||
TT_Load_Table_Func load_gasp;
|
TT_Load_Table_Func load_gpos;
|
||||||
TT_Load_Table_Func load_pclt;
|
TT_Load_Table_Func load_gasp;
|
||||||
|
TT_Load_Table_Func load_pclt;
|
||||||
|
|
||||||
/* see `ttload.h'; this field was called `load_bitmap_header' up to */
|
/* see `ttload.h'; this field was called `load_bitmap_header' up to */
|
||||||
/* version 2.1.10 */
|
/* version 2.1.10 */
|
||||||
TT_Load_Table_Func load_bhed;
|
TT_Load_Table_Func load_bhed;
|
||||||
|
|
||||||
TT_Load_SBit_Image_Func load_sbit_image;
|
TT_Load_SBit_Image_Func load_sbit_image;
|
||||||
|
|
||||||
/* see `ttpost.h' */
|
/* see `ttpost.h' */
|
||||||
TT_Get_PS_Name_Func get_psname;
|
TT_Get_PS_Name_Func get_psname;
|
||||||
TT_Free_Table_Func free_psnames;
|
TT_Free_Table_Func free_psnames;
|
||||||
|
|
||||||
/* starting here, the structure differs from version 2.1.7 */
|
/* starting here, the structure differs from version 2.1.7 */
|
||||||
|
|
||||||
/* this field was introduced in version 2.1.8, named `get_psname' */
|
/* this field was introduced in version 2.1.8, named `get_psname' */
|
||||||
TT_Face_GetKerningFunc get_kerning;
|
TT_Face_GetKerningFunc get_kerning;
|
||||||
|
|
||||||
/* new elements introduced after version 2.1.10 */
|
/* new elements introduced after version 2.1.10 */
|
||||||
|
|
||||||
|
TT_Face_GetKerningFunc get_gpos_kerning;
|
||||||
|
|
||||||
/* load the font directory, i.e., the offset table and */
|
/* load the font directory, i.e., the offset table and */
|
||||||
/* the table directory */
|
/* the table directory */
|
||||||
TT_Load_Table_Func load_font_dir;
|
TT_Load_Table_Func load_font_dir;
|
||||||
TT_Load_Metrics_Func load_hmtx;
|
TT_Load_Metrics_Func load_hmtx;
|
||||||
|
|
||||||
TT_Load_Table_Func load_eblc;
|
TT_Load_Table_Func load_eblc;
|
||||||
TT_Free_Table_Func free_eblc;
|
TT_Free_Table_Func free_eblc;
|
||||||
|
|
||||||
TT_Set_SBit_Strike_Func set_sbit_strike;
|
TT_Set_SBit_Strike_Func set_sbit_strike;
|
||||||
TT_Load_Strike_Metrics_Func load_strike_metrics;
|
TT_Load_Strike_Metrics_Func load_strike_metrics;
|
||||||
|
|
||||||
TT_Load_Table_Func load_cpal;
|
TT_Load_Table_Func load_cpal;
|
||||||
TT_Load_Table_Func load_colr;
|
TT_Load_Table_Func load_colr;
|
||||||
TT_Free_Table_Func free_cpal;
|
TT_Free_Table_Func free_cpal;
|
||||||
TT_Free_Table_Func free_colr;
|
TT_Free_Table_Func free_colr;
|
||||||
TT_Set_Palette_Func set_palette;
|
TT_Set_Palette_Func set_palette;
|
||||||
TT_Get_Colr_Layer_Func get_colr_layer;
|
TT_Get_Colr_Layer_Func get_colr_layer;
|
||||||
TT_Blend_Colr_Func colr_blend;
|
TT_Get_Color_Glyph_Paint_Func get_colr_glyph_paint;
|
||||||
|
TT_Get_Color_Glyph_ClipBox_Func get_color_glyph_clipbox;
|
||||||
|
TT_Get_Paint_Layers_Func get_paint_layers;
|
||||||
|
TT_Get_Colorline_Stops_Func get_colorline_stops;
|
||||||
|
TT_Get_Paint_Func get_paint;
|
||||||
|
TT_Blend_Colr_Func colr_blend;
|
||||||
|
|
||||||
TT_Get_Metrics_Func get_metrics;
|
TT_Get_Metrics_Func get_metrics;
|
||||||
|
|
||||||
TT_Get_Name_Func get_name;
|
TT_Get_Name_Func get_name;
|
||||||
TT_Get_Name_ID_Func get_name_id;
|
TT_Get_Name_ID_Func get_name_id;
|
||||||
|
|
||||||
|
/* OpenType SVG Support */
|
||||||
|
TT_Load_Table_Func load_svg;
|
||||||
|
TT_Free_Table_Func free_svg;
|
||||||
|
TT_Load_Svg_Doc_Func load_svg_doc;
|
||||||
|
|
||||||
} SFNT_Interface;
|
} SFNT_Interface;
|
||||||
|
|
||||||
@ -801,6 +1005,7 @@ FT_BEGIN_HEADER
|
|||||||
load_name_, \
|
load_name_, \
|
||||||
free_name_, \
|
free_name_, \
|
||||||
load_kern_, \
|
load_kern_, \
|
||||||
|
load_gpos_, \
|
||||||
load_gasp_, \
|
load_gasp_, \
|
||||||
load_pclt_, \
|
load_pclt_, \
|
||||||
load_bhed_, \
|
load_bhed_, \
|
||||||
@ -808,6 +1013,7 @@ FT_BEGIN_HEADER
|
|||||||
get_psname_, \
|
get_psname_, \
|
||||||
free_psnames_, \
|
free_psnames_, \
|
||||||
get_kerning_, \
|
get_kerning_, \
|
||||||
|
get_gpos_kerning_, \
|
||||||
load_font_dir_, \
|
load_font_dir_, \
|
||||||
load_hmtx_, \
|
load_hmtx_, \
|
||||||
load_eblc_, \
|
load_eblc_, \
|
||||||
@ -820,10 +1026,18 @@ FT_BEGIN_HEADER
|
|||||||
free_colr_, \
|
free_colr_, \
|
||||||
set_palette_, \
|
set_palette_, \
|
||||||
get_colr_layer_, \
|
get_colr_layer_, \
|
||||||
|
get_colr_glyph_paint_, \
|
||||||
|
get_color_glyph_clipbox, \
|
||||||
|
get_paint_layers_, \
|
||||||
|
get_colorline_stops_, \
|
||||||
|
get_paint_, \
|
||||||
colr_blend_, \
|
colr_blend_, \
|
||||||
get_metrics_, \
|
get_metrics_, \
|
||||||
get_name_, \
|
get_name_, \
|
||||||
get_name_id_ ) \
|
get_name_id_, \
|
||||||
|
load_svg_, \
|
||||||
|
free_svg_, \
|
||||||
|
load_svg_doc_ ) \
|
||||||
static const SFNT_Interface class_ = \
|
static const SFNT_Interface class_ = \
|
||||||
{ \
|
{ \
|
||||||
goto_table_, \
|
goto_table_, \
|
||||||
@ -841,6 +1055,7 @@ FT_BEGIN_HEADER
|
|||||||
load_name_, \
|
load_name_, \
|
||||||
free_name_, \
|
free_name_, \
|
||||||
load_kern_, \
|
load_kern_, \
|
||||||
|
load_gpos_, \
|
||||||
load_gasp_, \
|
load_gasp_, \
|
||||||
load_pclt_, \
|
load_pclt_, \
|
||||||
load_bhed_, \
|
load_bhed_, \
|
||||||
@ -848,6 +1063,7 @@ FT_BEGIN_HEADER
|
|||||||
get_psname_, \
|
get_psname_, \
|
||||||
free_psnames_, \
|
free_psnames_, \
|
||||||
get_kerning_, \
|
get_kerning_, \
|
||||||
|
get_gpos_kerning_, \
|
||||||
load_font_dir_, \
|
load_font_dir_, \
|
||||||
load_hmtx_, \
|
load_hmtx_, \
|
||||||
load_eblc_, \
|
load_eblc_, \
|
||||||
@ -860,10 +1076,18 @@ FT_BEGIN_HEADER
|
|||||||
free_colr_, \
|
free_colr_, \
|
||||||
set_palette_, \
|
set_palette_, \
|
||||||
get_colr_layer_, \
|
get_colr_layer_, \
|
||||||
|
get_colr_glyph_paint_, \
|
||||||
|
get_color_glyph_clipbox, \
|
||||||
|
get_paint_layers_, \
|
||||||
|
get_colorline_stops_, \
|
||||||
|
get_paint_, \
|
||||||
colr_blend_, \
|
colr_blend_, \
|
||||||
get_metrics_, \
|
get_metrics_, \
|
||||||
get_name_, \
|
get_name_, \
|
||||||
get_name_id_ \
|
get_name_id_, \
|
||||||
|
load_svg_, \
|
||||||
|
free_svg_, \
|
||||||
|
load_svg_doc_ \
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,46 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
*
|
||||||
|
* svginterface.h
|
||||||
|
*
|
||||||
|
* Interface of ot-svg module (specification only).
|
||||||
|
*
|
||||||
|
* Copyright (C) 2022-2024 by
|
||||||
|
* David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
|
||||||
|
*
|
||||||
|
* 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 SVGINTERFACE_H_
|
||||||
|
#define SVGINTERFACE_H_
|
||||||
|
|
||||||
|
#include <ft2build.h>
|
||||||
|
#include <freetype/otsvg.h>
|
||||||
|
|
||||||
|
|
||||||
|
FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
typedef FT_Error
|
||||||
|
(*Preset_Bitmap_Func)( FT_Module module,
|
||||||
|
FT_GlyphSlot slot,
|
||||||
|
FT_Bool cache );
|
||||||
|
|
||||||
|
typedef struct SVG_Interface_
|
||||||
|
{
|
||||||
|
Preset_Bitmap_Func preset_slot;
|
||||||
|
|
||||||
|
} SVG_Interface;
|
||||||
|
|
||||||
|
typedef SVG_Interface* SVG_Service;
|
||||||
|
|
||||||
|
FT_END_HEADER
|
||||||
|
|
||||||
|
#endif /* SVGINTERFACE_H_ */
|
||||||
|
|
||||||
|
|
||||||
|
/* END */
|
||||||
@ -5,7 +5,7 @@
|
|||||||
* Basic Type1/Type2 type definitions and interface (specification
|
* Basic Type1/Type2 type definitions and interface (specification
|
||||||
* only).
|
* only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -21,7 +21,7 @@
|
|||||||
#define T1TYPES_H_
|
#define T1TYPES_H_
|
||||||
|
|
||||||
|
|
||||||
#include <freetype/t1tables.h>
|
#include <freetype/ftmm.h>
|
||||||
#include <freetype/internal/pshints.h>
|
#include <freetype/internal/pshints.h>
|
||||||
#include <freetype/internal/ftserv.h>
|
#include <freetype/internal/ftserv.h>
|
||||||
#include <freetype/internal/fthash.h>
|
#include <freetype/internal/fthash.h>
|
||||||
@ -137,6 +137,54 @@ FT_BEGIN_HEADER
|
|||||||
} CID_SubrsRec, *CID_Subrs;
|
} CID_SubrsRec, *CID_Subrs;
|
||||||
|
|
||||||
|
|
||||||
|
/* this structure is used to store the BlendDesignMap entry for an axis */
|
||||||
|
typedef struct PS_DesignMap_
|
||||||
|
{
|
||||||
|
FT_Byte num_points;
|
||||||
|
FT_Long* design_points;
|
||||||
|
FT_Fixed* blend_points;
|
||||||
|
|
||||||
|
} PS_DesignMapRec, *PS_DesignMap;
|
||||||
|
|
||||||
|
/* backward compatible definition */
|
||||||
|
typedef PS_DesignMapRec T1_DesignMap;
|
||||||
|
|
||||||
|
|
||||||
|
typedef struct PS_BlendRec_
|
||||||
|
{
|
||||||
|
FT_UInt num_designs;
|
||||||
|
FT_UInt num_axis;
|
||||||
|
|
||||||
|
FT_String* axis_names[T1_MAX_MM_AXIS];
|
||||||
|
FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
|
||||||
|
PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
|
||||||
|
|
||||||
|
FT_Fixed* weight_vector;
|
||||||
|
FT_Fixed* default_weight_vector;
|
||||||
|
|
||||||
|
PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
|
||||||
|
PS_Private privates [T1_MAX_MM_DESIGNS + 1];
|
||||||
|
|
||||||
|
FT_ULong blend_bitflags;
|
||||||
|
|
||||||
|
FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
|
||||||
|
|
||||||
|
/* since 2.3.0 */
|
||||||
|
|
||||||
|
/* undocumented, optional: the default design instance; */
|
||||||
|
/* corresponds to default_weight_vector -- */
|
||||||
|
/* num_default_design_vector == 0 means it is not present */
|
||||||
|
/* in the font and associated metrics files */
|
||||||
|
FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
|
||||||
|
FT_UInt num_default_design_vector;
|
||||||
|
|
||||||
|
} PS_BlendRec, *PS_Blend;
|
||||||
|
|
||||||
|
|
||||||
|
/* backward compatible definition */
|
||||||
|
typedef PS_BlendRec T1_Blend;
|
||||||
|
|
||||||
|
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
/*************************************************************************/
|
/*************************************************************************/
|
||||||
@ -172,8 +220,8 @@ FT_BEGIN_HEADER
|
|||||||
{
|
{
|
||||||
FT_Bool IsCIDFont;
|
FT_Bool IsCIDFont;
|
||||||
FT_BBox FontBBox;
|
FT_BBox FontBBox;
|
||||||
FT_Fixed Ascender;
|
FT_Fixed Ascender; /* optional, mind the zero */
|
||||||
FT_Fixed Descender;
|
FT_Fixed Descender; /* optional, mind the zero */
|
||||||
AFM_TrackKern TrackKerns; /* free if non-NULL */
|
AFM_TrackKern TrackKerns; /* free if non-NULL */
|
||||||
FT_UInt NumTrackKern;
|
FT_UInt NumTrackKern;
|
||||||
AFM_KernPair KernPairs; /* free if non-NULL */
|
AFM_KernPair KernPairs; /* free if non-NULL */
|
||||||
@ -201,30 +249,30 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
typedef struct T1_FaceRec_
|
typedef struct T1_FaceRec_
|
||||||
{
|
{
|
||||||
FT_FaceRec root;
|
FT_FaceRec root;
|
||||||
T1_FontRec type1;
|
T1_FontRec type1;
|
||||||
const void* psnames;
|
const void* psnames;
|
||||||
const void* psaux;
|
const void* psaux;
|
||||||
const void* afm_data;
|
const void* afm_data;
|
||||||
FT_CharMapRec charmaprecs[2];
|
FT_CharMapRec charmaprecs[2];
|
||||||
FT_CharMap charmaps[2];
|
FT_CharMap charmaps[2];
|
||||||
|
|
||||||
/* support for Multiple Masters fonts */
|
/* support for Multiple Masters fonts */
|
||||||
PS_Blend blend;
|
PS_Blend blend;
|
||||||
|
|
||||||
/* undocumented, optional: indices of subroutines that express */
|
/* undocumented, optional: indices of subroutines that express */
|
||||||
/* the NormalizeDesignVector and the ConvertDesignVector procedure, */
|
/* the NormalizeDesignVector and the ConvertDesignVector procedure, */
|
||||||
/* respectively, as Type 2 charstrings; -1 if keywords not present */
|
/* respectively, as Type 2 charstrings; -1 if keywords not present */
|
||||||
FT_Int ndv_idx;
|
FT_Int ndv_idx;
|
||||||
FT_Int cdv_idx;
|
FT_Int cdv_idx;
|
||||||
|
|
||||||
/* undocumented, optional: has the same meaning as len_buildchar */
|
/* undocumented, optional: has the same meaning as len_buildchar */
|
||||||
/* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */
|
/* for Type 2 fonts; manipulated by othersubrs 19, 24, and 25 */
|
||||||
FT_UInt len_buildchar;
|
FT_UInt len_buildchar;
|
||||||
FT_Long* buildchar;
|
FT_Long* buildchar;
|
||||||
|
|
||||||
/* since version 2.1 - interface to PostScript hinter */
|
/* since version 2.1 - interface to PostScript hinter */
|
||||||
const void* pshinter;
|
const void* pshinter;
|
||||||
|
|
||||||
} T1_FaceRec;
|
} T1_FaceRec;
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Basic SFNT/TrueType type definitions and interface (specification
|
* Basic SFNT/TrueType type definitions and interface (specification
|
||||||
* only).
|
* only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -24,6 +24,7 @@
|
|||||||
#include <freetype/tttables.h>
|
#include <freetype/tttables.h>
|
||||||
#include <freetype/internal/ftobjs.h>
|
#include <freetype/internal/ftobjs.h>
|
||||||
#include <freetype/ftcolor.h>
|
#include <freetype/ftcolor.h>
|
||||||
|
#include "freetype/fttypes.h"
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
#ifdef TT_CONFIG_OPTION_GX_VAR_SUPPORT
|
||||||
#include <freetype/ftmm.h>
|
#include <freetype/ftmm.h>
|
||||||
@ -779,13 +780,15 @@ FT_BEGIN_HEADER
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
* TT_Post_20Rec
|
* TT_Post_NamesRec
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Postscript names sub-table, format 2.0. Stores the PS name of each
|
* Postscript names table, either format 2.0 or 2.5.
|
||||||
* glyph in the font face.
|
|
||||||
*
|
*
|
||||||
* @fields:
|
* @fields:
|
||||||
|
* loaded ::
|
||||||
|
* A flag to indicate whether the PS names are loaded.
|
||||||
|
*
|
||||||
* num_glyphs ::
|
* num_glyphs ::
|
||||||
* The number of named glyphs in the table.
|
* The number of named glyphs in the table.
|
||||||
*
|
*
|
||||||
@ -798,68 +801,13 @@ FT_BEGIN_HEADER
|
|||||||
* glyph_names ::
|
* glyph_names ::
|
||||||
* The PS names not in Mac Encoding.
|
* The PS names not in Mac Encoding.
|
||||||
*/
|
*/
|
||||||
typedef struct TT_Post_20Rec_
|
typedef struct TT_Post_NamesRec_
|
||||||
{
|
{
|
||||||
|
FT_Bool loaded;
|
||||||
FT_UShort num_glyphs;
|
FT_UShort num_glyphs;
|
||||||
FT_UShort num_names;
|
FT_UShort num_names;
|
||||||
FT_UShort* glyph_indices;
|
FT_UShort* glyph_indices;
|
||||||
FT_Char** glyph_names;
|
FT_Byte** glyph_names;
|
||||||
|
|
||||||
} TT_Post_20Rec, *TT_Post_20;
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* @struct:
|
|
||||||
* TT_Post_25Rec
|
|
||||||
*
|
|
||||||
* @description:
|
|
||||||
* Postscript names sub-table, format 2.5. Stores the PS name of each
|
|
||||||
* glyph in the font face.
|
|
||||||
*
|
|
||||||
* @fields:
|
|
||||||
* num_glyphs ::
|
|
||||||
* The number of glyphs in the table.
|
|
||||||
*
|
|
||||||
* offsets ::
|
|
||||||
* An array of signed offsets in a normal Mac Postscript name encoding.
|
|
||||||
*/
|
|
||||||
typedef struct TT_Post_25_
|
|
||||||
{
|
|
||||||
FT_UShort num_glyphs;
|
|
||||||
FT_Char* offsets;
|
|
||||||
|
|
||||||
} TT_Post_25Rec, *TT_Post_25;
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
|
||||||
*
|
|
||||||
* @struct:
|
|
||||||
* TT_Post_NamesRec
|
|
||||||
*
|
|
||||||
* @description:
|
|
||||||
* Postscript names table, either format 2.0 or 2.5.
|
|
||||||
*
|
|
||||||
* @fields:
|
|
||||||
* loaded ::
|
|
||||||
* A flag to indicate whether the PS names are loaded.
|
|
||||||
*
|
|
||||||
* format_20 ::
|
|
||||||
* The sub-table used for format 2.0.
|
|
||||||
*
|
|
||||||
* format_25 ::
|
|
||||||
* The sub-table used for format 2.5.
|
|
||||||
*/
|
|
||||||
typedef struct TT_Post_NamesRec_
|
|
||||||
{
|
|
||||||
FT_Bool loaded;
|
|
||||||
|
|
||||||
union
|
|
||||||
{
|
|
||||||
TT_Post_20Rec format_20;
|
|
||||||
TT_Post_25Rec format_25;
|
|
||||||
|
|
||||||
} names;
|
|
||||||
|
|
||||||
} TT_Post_NamesRec, *TT_Post_Names;
|
} TT_Post_NamesRec, *TT_Post_Names;
|
||||||
|
|
||||||
@ -1253,12 +1201,16 @@ FT_BEGIN_HEADER
|
|||||||
* mm ::
|
* mm ::
|
||||||
* A pointer to the Multiple Masters service.
|
* A pointer to the Multiple Masters service.
|
||||||
*
|
*
|
||||||
* var ::
|
* tt_var ::
|
||||||
* A pointer to the Metrics Variations service.
|
* A pointer to the Metrics Variations service for the "truetype"
|
||||||
|
* driver.
|
||||||
*
|
*
|
||||||
* hdmx ::
|
* face_var ::
|
||||||
* The face's horizontal device metrics ('hdmx' table). This table is
|
* A pointer to the Metrics Variations service for this `TT_Face`'s
|
||||||
* optional in TrueType/OpenType fonts.
|
* driver.
|
||||||
|
*
|
||||||
|
* psaux ::
|
||||||
|
* A pointer to the PostScript Auxiliary service.
|
||||||
*
|
*
|
||||||
* gasp ::
|
* gasp ::
|
||||||
* The grid-fitting and scaling properties table ('gasp'). This table
|
* The grid-fitting and scaling properties table ('gasp'). This table
|
||||||
@ -1364,6 +1316,12 @@ FT_BEGIN_HEADER
|
|||||||
* var_postscript_prefix_len ::
|
* var_postscript_prefix_len ::
|
||||||
* The length of the `var_postscript_prefix` string.
|
* The length of the `var_postscript_prefix` string.
|
||||||
*
|
*
|
||||||
|
* var_default_named_instance ::
|
||||||
|
* The index of the default named instance.
|
||||||
|
*
|
||||||
|
* non_var_style_name ::
|
||||||
|
* The non-variation style name, used as a backup.
|
||||||
|
*
|
||||||
* horz_metrics_size ::
|
* horz_metrics_size ::
|
||||||
* The size of the 'hmtx' table.
|
* The size of the 'hmtx' table.
|
||||||
*
|
*
|
||||||
@ -1372,7 +1330,7 @@ FT_BEGIN_HEADER
|
|||||||
*
|
*
|
||||||
* num_locations ::
|
* num_locations ::
|
||||||
* The number of glyph locations in this TrueType file. This should be
|
* The number of glyph locations in this TrueType file. This should be
|
||||||
* identical to the number of glyphs. Ignored for Type 2 fonts.
|
* one more than the number of glyphs. Ignored for Type 2 fonts.
|
||||||
*
|
*
|
||||||
* glyph_locations ::
|
* glyph_locations ::
|
||||||
* An array of longs. These are offsets to glyph data within the
|
* An array of longs. These are offsets to glyph data within the
|
||||||
@ -1390,8 +1348,8 @@ FT_BEGIN_HEADER
|
|||||||
* hdmx_record_size ::
|
* hdmx_record_size ::
|
||||||
* The size of a single hdmx record.
|
* The size of a single hdmx record.
|
||||||
*
|
*
|
||||||
* hdmx_record_sizes ::
|
* hdmx_records ::
|
||||||
* An array holding the ppem sizes available in the 'hdmx' table.
|
* A array of pointers to the 'hdmx' table records sorted by ppem.
|
||||||
*
|
*
|
||||||
* sbit_table ::
|
* sbit_table ::
|
||||||
* A pointer to the font's embedded bitmap location table.
|
* A pointer to the font's embedded bitmap location table.
|
||||||
@ -1410,14 +1368,6 @@ FT_BEGIN_HEADER
|
|||||||
* A mapping between the strike indices exposed by the API and the
|
* A mapping between the strike indices exposed by the API and the
|
||||||
* indices used in the font's sbit table.
|
* indices used in the font's sbit table.
|
||||||
*
|
*
|
||||||
* cpal ::
|
|
||||||
* A pointer to data related to the 'CPAL' table. `NULL` if the table
|
|
||||||
* is not available.
|
|
||||||
*
|
|
||||||
* colr ::
|
|
||||||
* A pointer to data related to the 'COLR' table. `NULL` if the table
|
|
||||||
* is not available.
|
|
||||||
*
|
|
||||||
* kern_table ::
|
* kern_table ::
|
||||||
* A pointer to the 'kern' table.
|
* A pointer to the 'kern' table.
|
||||||
*
|
*
|
||||||
@ -1445,19 +1395,23 @@ FT_BEGIN_HEADER
|
|||||||
* vert_metrics_offset ::
|
* vert_metrics_offset ::
|
||||||
* The file offset of the 'vmtx' table.
|
* The file offset of the 'vmtx' table.
|
||||||
*
|
*
|
||||||
* sph_found_func_flags ::
|
|
||||||
* Flags identifying special bytecode functions (used by the v38
|
|
||||||
* implementation of the bytecode interpreter).
|
|
||||||
*
|
|
||||||
* sph_compatibility_mode ::
|
|
||||||
* This flag is set if we are in ClearType backward compatibility mode
|
|
||||||
* (used by the v38 implementation of the bytecode interpreter).
|
|
||||||
*
|
|
||||||
* ebdt_start ::
|
* ebdt_start ::
|
||||||
* The file offset of the sbit data table (CBDT, bdat, etc.).
|
* The file offset of the sbit data table (CBDT, bdat, etc.).
|
||||||
*
|
*
|
||||||
* ebdt_size ::
|
* ebdt_size ::
|
||||||
* The size of the sbit data table.
|
* The size of the sbit data table.
|
||||||
|
*
|
||||||
|
* cpal ::
|
||||||
|
* A pointer to data related to the 'CPAL' table. `NULL` if the table
|
||||||
|
* is not available.
|
||||||
|
*
|
||||||
|
* colr ::
|
||||||
|
* A pointer to data related to the 'COLR' table. `NULL` if the table
|
||||||
|
* is not available.
|
||||||
|
*
|
||||||
|
* svg ::
|
||||||
|
* A pointer to data related to the 'SVG' table. `NULL` if the table
|
||||||
|
* is not available.
|
||||||
*/
|
*/
|
||||||
typedef struct TT_FaceRec_
|
typedef struct TT_FaceRec_
|
||||||
{
|
{
|
||||||
@ -1508,8 +1462,14 @@ FT_BEGIN_HEADER
|
|||||||
void* mm;
|
void* mm;
|
||||||
|
|
||||||
/* a typeless pointer to the FT_Service_MetricsVariationsRec table */
|
/* a typeless pointer to the FT_Service_MetricsVariationsRec table */
|
||||||
/* used to handle the HVAR, VVAR, and MVAR OpenType tables */
|
/* used to handle the HVAR, VVAR, and MVAR OpenType tables by the */
|
||||||
void* var;
|
/* "truetype" driver */
|
||||||
|
void* tt_var;
|
||||||
|
|
||||||
|
/* a typeless pointer to the FT_Service_MetricsVariationsRec table */
|
||||||
|
/* used to handle the HVAR, VVAR, and MVAR OpenType tables by this */
|
||||||
|
/* TT_Face's driver */
|
||||||
|
void* face_var; /* since 2.13.1 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* a typeless pointer to the PostScript Aux service */
|
/* a typeless pointer to the PostScript Aux service */
|
||||||
@ -1591,6 +1551,9 @@ FT_BEGIN_HEADER
|
|||||||
const char* var_postscript_prefix; /* since 2.7.2 */
|
const char* var_postscript_prefix; /* since 2.7.2 */
|
||||||
FT_UInt var_postscript_prefix_len; /* since 2.7.2 */
|
FT_UInt var_postscript_prefix_len; /* since 2.7.2 */
|
||||||
|
|
||||||
|
FT_UInt var_default_named_instance; /* since 2.13.1 */
|
||||||
|
|
||||||
|
const char* non_var_style_name; /* since 2.13.1 */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* since version 2.2 */
|
/* since version 2.2 */
|
||||||
@ -1598,14 +1561,14 @@ FT_BEGIN_HEADER
|
|||||||
FT_ULong horz_metrics_size;
|
FT_ULong horz_metrics_size;
|
||||||
FT_ULong vert_metrics_size;
|
FT_ULong vert_metrics_size;
|
||||||
|
|
||||||
FT_ULong num_locations; /* in broken TTF, gid > 0xFFFF */
|
FT_ULong num_locations; /* up to 0xFFFF + 1 */
|
||||||
FT_Byte* glyph_locations;
|
FT_Byte* glyph_locations;
|
||||||
|
|
||||||
FT_Byte* hdmx_table;
|
FT_Byte* hdmx_table;
|
||||||
FT_ULong hdmx_table_size;
|
FT_ULong hdmx_table_size;
|
||||||
FT_UInt hdmx_record_count;
|
FT_UInt hdmx_record_count;
|
||||||
FT_ULong hdmx_record_size;
|
FT_ULong hdmx_record_size;
|
||||||
FT_Byte* hdmx_record_sizes;
|
FT_Byte** hdmx_records;
|
||||||
|
|
||||||
FT_Byte* sbit_table;
|
FT_Byte* sbit_table;
|
||||||
FT_ULong sbit_table_size;
|
FT_ULong sbit_table_size;
|
||||||
@ -1619,6 +1582,11 @@ FT_BEGIN_HEADER
|
|||||||
FT_UInt32 kern_avail_bits;
|
FT_UInt32 kern_avail_bits;
|
||||||
FT_UInt32 kern_order_bits;
|
FT_UInt32 kern_order_bits;
|
||||||
|
|
||||||
|
#ifdef TT_CONFIG_OPTION_GPOS_KERNING
|
||||||
|
FT_Byte* gpos_table;
|
||||||
|
FT_Bool gpos_kerning_available;
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_BDF
|
#ifdef TT_CONFIG_OPTION_BDF
|
||||||
TT_BDFRec bdf;
|
TT_BDFRec bdf;
|
||||||
#endif /* TT_CONFIG_OPTION_BDF */
|
#endif /* TT_CONFIG_OPTION_BDF */
|
||||||
@ -1627,13 +1595,6 @@ FT_BEGIN_HEADER
|
|||||||
FT_ULong horz_metrics_offset;
|
FT_ULong horz_metrics_offset;
|
||||||
FT_ULong vert_metrics_offset;
|
FT_ULong vert_metrics_offset;
|
||||||
|
|
||||||
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY
|
|
||||||
/* since 2.4.12 */
|
|
||||||
FT_ULong sph_found_func_flags; /* special functions found */
|
|
||||||
/* for this face */
|
|
||||||
FT_Bool sph_compatibility_mode;
|
|
||||||
#endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */
|
|
||||||
|
|
||||||
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
#ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS
|
||||||
/* since 2.7 */
|
/* since 2.7 */
|
||||||
FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */
|
FT_ULong ebdt_start; /* either `CBDT', `EBDT', or `bdat' */
|
||||||
@ -1644,6 +1605,9 @@ FT_BEGIN_HEADER
|
|||||||
void* cpal;
|
void* cpal;
|
||||||
void* colr;
|
void* colr;
|
||||||
|
|
||||||
|
/* since 2.12 */
|
||||||
|
void* svg;
|
||||||
|
|
||||||
} TT_FaceRec;
|
} TT_FaceRec;
|
||||||
|
|
||||||
|
|
||||||
@ -1691,9 +1655,9 @@ FT_BEGIN_HEADER
|
|||||||
{
|
{
|
||||||
FT_Memory memory;
|
FT_Memory memory;
|
||||||
FT_UShort max_points;
|
FT_UShort max_points;
|
||||||
FT_Short max_contours;
|
FT_UShort max_contours;
|
||||||
FT_UShort n_points; /* number of points in zone */
|
FT_UShort n_points; /* number of points in zone */
|
||||||
FT_Short n_contours; /* number of contours */
|
FT_UShort n_contours; /* number of contours */
|
||||||
|
|
||||||
FT_Vector* org; /* original point coordinates */
|
FT_Vector* org; /* original point coordinates */
|
||||||
FT_Vector* cur; /* current point coordinates */
|
FT_Vector* cur; /* current point coordinates */
|
||||||
@ -1734,7 +1698,7 @@ FT_BEGIN_HEADER
|
|||||||
FT_UInt glyph_index;
|
FT_UInt glyph_index;
|
||||||
|
|
||||||
FT_Stream stream;
|
FT_Stream stream;
|
||||||
FT_Int byte_len;
|
FT_UInt byte_len;
|
||||||
|
|
||||||
FT_Short n_contours;
|
FT_Short n_contours;
|
||||||
FT_BBox bbox;
|
FT_BBox bbox;
|
||||||
@ -1769,6 +1733,9 @@ FT_BEGIN_HEADER
|
|||||||
/* since version 2.6.2 */
|
/* since version 2.6.2 */
|
||||||
FT_ListRec composites;
|
FT_ListRec composites;
|
||||||
|
|
||||||
|
/* since version 2.11.2 */
|
||||||
|
FT_Byte* widthp;
|
||||||
|
|
||||||
} TT_LoaderRec;
|
} TT_LoaderRec;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Basic WOFF/WOFF2 type definitions and interface (specification
|
* Basic WOFF/WOFF2 type definitions and interface (specification
|
||||||
* only).
|
* only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -92,7 +92,7 @@ FT_BEGIN_HEADER
|
|||||||
*/
|
*/
|
||||||
typedef struct WOFF_TableRec_
|
typedef struct WOFF_TableRec_
|
||||||
{
|
{
|
||||||
FT_ULong Tag; /* table ID */
|
FT_Tag Tag; /* table ID */
|
||||||
FT_ULong Offset; /* table file offset */
|
FT_ULong Offset; /* table file offset */
|
||||||
FT_ULong CompLength; /* compressed table length */
|
FT_ULong CompLength; /* compressed table length */
|
||||||
FT_ULong OrigLength; /* uncompressed table length */
|
FT_ULong OrigLength; /* uncompressed table length */
|
||||||
@ -191,7 +191,7 @@ FT_BEGIN_HEADER
|
|||||||
typedef struct WOFF2_TableRec_
|
typedef struct WOFF2_TableRec_
|
||||||
{
|
{
|
||||||
FT_Byte FlagByte; /* table type and flags */
|
FT_Byte FlagByte; /* table type and flags */
|
||||||
FT_ULong Tag; /* table file offset */
|
FT_Tag Tag; /* table file offset */
|
||||||
FT_ULong dst_length; /* uncompressed table length */
|
FT_ULong dst_length; /* uncompressed table length */
|
||||||
FT_ULong TransformLength; /* transformed length */
|
FT_ULong TransformLength; /* transformed length */
|
||||||
|
|
||||||
|
|||||||
@ -0,0 +1,336 @@
|
|||||||
|
/****************************************************************************
|
||||||
|
*
|
||||||
|
* otsvg.h
|
||||||
|
*
|
||||||
|
* Interface for OT-SVG support related things (specification).
|
||||||
|
*
|
||||||
|
* Copyright (C) 2022-2024 by
|
||||||
|
* David Turner, Robert Wilhelm, Werner Lemberg, and Moazin Khatti.
|
||||||
|
*
|
||||||
|
* 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 OTSVG_H_
|
||||||
|
#define OTSVG_H_
|
||||||
|
|
||||||
|
#include <freetype/freetype.h>
|
||||||
|
|
||||||
|
#ifdef FREETYPE_H
|
||||||
|
#error "freetype.h of FreeType 1 has been loaded!"
|
||||||
|
#error "Please fix the directory search order for header files"
|
||||||
|
#error "so that freetype.h of FreeType 2 is found first."
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
FT_BEGIN_HEADER
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @section:
|
||||||
|
* svg_fonts
|
||||||
|
*
|
||||||
|
* @title:
|
||||||
|
* OpenType SVG Fonts
|
||||||
|
*
|
||||||
|
* @abstract:
|
||||||
|
* OT-SVG API between FreeType and an external SVG rendering library.
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* This section describes the four hooks necessary to render SVG
|
||||||
|
* 'documents' that are contained in an OpenType font's 'SVG~' table.
|
||||||
|
*
|
||||||
|
* For more information on the implementation, see our standard hooks
|
||||||
|
* based on 'librsvg' in the [FreeType Demo
|
||||||
|
* Programs](https://gitlab.freedesktop.org/freetype/freetype-demos)
|
||||||
|
* repository.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* SVG_Lib_Init_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* A callback that is called when the first OT-SVG glyph is rendered in
|
||||||
|
* the lifetime of an @FT_Library object. In a typical implementation,
|
||||||
|
* one would want to allocate a structure and point the `data_pointer`
|
||||||
|
* to it and perform any library initializations that might be needed.
|
||||||
|
*
|
||||||
|
* @inout:
|
||||||
|
* data_pointer ::
|
||||||
|
* The SVG rendering module stores a pointer variable that can be used
|
||||||
|
* by clients to store any data that needs to be shared across
|
||||||
|
* different hooks. `data_pointer` is essentially a pointer to that
|
||||||
|
* pointer such that it can be written to as well as read from.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* FreeType error code. 0 means success.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.12
|
||||||
|
*/
|
||||||
|
typedef FT_Error
|
||||||
|
(*SVG_Lib_Init_Func)( FT_Pointer *data_pointer );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* SVG_Lib_Free_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* A callback that is called when the `ot-svg` module is being freed.
|
||||||
|
* It is only called if the init hook was called earlier. This means
|
||||||
|
* that neither the init nor the free hook is called if no OT-SVG glyph
|
||||||
|
* is rendered.
|
||||||
|
*
|
||||||
|
* In a typical implementation, one would want to free any state
|
||||||
|
* structure that was allocated in the init hook and perform any
|
||||||
|
* library-related closure that might be needed.
|
||||||
|
*
|
||||||
|
* @inout:
|
||||||
|
* data_pointer ::
|
||||||
|
* The SVG rendering module stores a pointer variable that can be used
|
||||||
|
* by clients to store any data that needs to be shared across
|
||||||
|
* different hooks. `data_pointer` is essentially a pointer to that
|
||||||
|
* pointer such that it can be written to as well as read from.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.12
|
||||||
|
*/
|
||||||
|
typedef void
|
||||||
|
(*SVG_Lib_Free_Func)( FT_Pointer *data_pointer );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* SVG_Lib_Render_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* A callback that is called to render an OT-SVG glyph. This callback
|
||||||
|
* hook is called right after the preset hook @SVG_Lib_Preset_Slot_Func
|
||||||
|
* has been called with `cache` set to `TRUE`. The data necessary to
|
||||||
|
* render is available through the handle @FT_SVG_Document, which is set
|
||||||
|
* in the `other` field of @FT_GlyphSlotRec.
|
||||||
|
*
|
||||||
|
* The render hook is expected to render the SVG glyph to the bitmap
|
||||||
|
* buffer that is allocated already at `slot->bitmap.buffer`. It also
|
||||||
|
* sets the `num_grays` value as well as `slot->format`.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* slot ::
|
||||||
|
* The slot to render.
|
||||||
|
*
|
||||||
|
* @inout:
|
||||||
|
* data_pointer ::
|
||||||
|
* The SVG rendering module stores a pointer variable that can be used
|
||||||
|
* by clients to store any data that needs to be shared across
|
||||||
|
* different hooks. `data_pointer` is essentially a pointer to that
|
||||||
|
* pointer such that it can be written to as well as read from.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* FreeType error code. 0 means success.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.12
|
||||||
|
*/
|
||||||
|
typedef FT_Error
|
||||||
|
(*SVG_Lib_Render_Func)( FT_GlyphSlot slot,
|
||||||
|
FT_Pointer *data_pointer );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @functype:
|
||||||
|
* SVG_Lib_Preset_Slot_Func
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* A callback that is called to preset the glyph slot. It is called from
|
||||||
|
* two places.
|
||||||
|
*
|
||||||
|
* 1. When `FT_Load_Glyph` needs to preset the glyph slot.
|
||||||
|
*
|
||||||
|
* 2. Right before the `svg` module calls the render callback hook.
|
||||||
|
*
|
||||||
|
* When it is the former, the argument `cache` is set to `FALSE`. When
|
||||||
|
* it is the latter, the argument `cache` is set to `TRUE`. This
|
||||||
|
* distinction has been made because many calculations that are necessary
|
||||||
|
* for presetting a glyph slot are the same needed later for the render
|
||||||
|
* callback hook. Thus, if `cache` is `TRUE`, the hook can _cache_ those
|
||||||
|
* calculations in a memory block referenced by the state pointer.
|
||||||
|
*
|
||||||
|
* This hook is expected to preset the slot by setting parameters such as
|
||||||
|
* `bitmap_left`, `bitmap_top`, `width`, `rows`, `pitch`, and
|
||||||
|
* `pixel_mode`. It is also expected to set all the metrics for the slot
|
||||||
|
* including the vertical advance if it is not already set. Typically,
|
||||||
|
* fonts have horizontal advances but not vertical ones. If those are
|
||||||
|
* available, they had already been set, otherwise they have to be
|
||||||
|
* estimated and set manually. The hook must take into account the
|
||||||
|
* transformations that have been set, and translate the transformation
|
||||||
|
* matrices into the SVG coordinate system, as the original matrix is
|
||||||
|
* intended for the TTF/CFF coordinate system.
|
||||||
|
*
|
||||||
|
* @input:
|
||||||
|
* slot ::
|
||||||
|
* The glyph slot that has the SVG document loaded.
|
||||||
|
*
|
||||||
|
* cache ::
|
||||||
|
* See description.
|
||||||
|
*
|
||||||
|
* @inout:
|
||||||
|
* data_pointer ::
|
||||||
|
* The SVG rendering module stores a pointer variable that can be used
|
||||||
|
* by clients to store any data that needs to be shared across
|
||||||
|
* different hooks. `data_pointer` is essentially a pointer to that
|
||||||
|
* pointer such that it can be written to as well as read from.
|
||||||
|
*
|
||||||
|
* @return:
|
||||||
|
* FreeType error code. 0 means success.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.12
|
||||||
|
*/
|
||||||
|
typedef FT_Error
|
||||||
|
(*SVG_Lib_Preset_Slot_Func)( FT_GlyphSlot slot,
|
||||||
|
FT_Bool cache,
|
||||||
|
FT_Pointer *state );
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @struct:
|
||||||
|
* SVG_RendererHooks
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* A structure that stores the four hooks needed to render OT-SVG glyphs
|
||||||
|
* properly. The structure is publicly used to set the hooks via the
|
||||||
|
* @svg-hooks driver property.
|
||||||
|
*
|
||||||
|
* The behavior of each hook is described in its documentation. One
|
||||||
|
* thing to note is that the preset hook and the render hook often need
|
||||||
|
* to do the same operations; therefore, it's better to cache the
|
||||||
|
* intermediate data in a state structure to avoid calculating it twice.
|
||||||
|
* For example, in the preset hook one can draw the glyph on a recorder
|
||||||
|
* surface and later create a bitmap surface from it in the render hook.
|
||||||
|
*
|
||||||
|
* All four hooks must be non-NULL.
|
||||||
|
*
|
||||||
|
* @fields:
|
||||||
|
* init_svg ::
|
||||||
|
* The initialization hook.
|
||||||
|
*
|
||||||
|
* free_svg ::
|
||||||
|
* The cleanup hook.
|
||||||
|
*
|
||||||
|
* render_hook ::
|
||||||
|
* The render hook.
|
||||||
|
*
|
||||||
|
* preset_slot ::
|
||||||
|
* The preset hook.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.12
|
||||||
|
*/
|
||||||
|
typedef struct SVG_RendererHooks_
|
||||||
|
{
|
||||||
|
SVG_Lib_Init_Func init_svg;
|
||||||
|
SVG_Lib_Free_Func free_svg;
|
||||||
|
SVG_Lib_Render_Func render_svg;
|
||||||
|
|
||||||
|
SVG_Lib_Preset_Slot_Func preset_slot;
|
||||||
|
|
||||||
|
} SVG_RendererHooks;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @struct:
|
||||||
|
* FT_SVG_DocumentRec
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* A structure that models one SVG document.
|
||||||
|
*
|
||||||
|
* @fields:
|
||||||
|
* svg_document ::
|
||||||
|
* A pointer to the SVG document.
|
||||||
|
*
|
||||||
|
* svg_document_length ::
|
||||||
|
* The length of `svg_document`.
|
||||||
|
*
|
||||||
|
* 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 ::
|
||||||
|
* The translation to apply to the glyph while rendering.
|
||||||
|
*
|
||||||
|
* @note:
|
||||||
|
* When an @FT_GlyphSlot object `slot` is passed down to a renderer, the
|
||||||
|
* renderer can only access the `metrics` and `units_per_EM` fields via
|
||||||
|
* `slot->face`. However, when @FT_Glyph_To_Bitmap sets up a dummy
|
||||||
|
* object, it has no way to set a `face` object. Thus, metrics
|
||||||
|
* information and `units_per_EM` (which is necessary for OT-SVG) has to
|
||||||
|
* be stored separately.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.12
|
||||||
|
*/
|
||||||
|
typedef struct FT_SVG_DocumentRec_
|
||||||
|
{
|
||||||
|
FT_Byte* svg_document;
|
||||||
|
FT_ULong svg_document_length;
|
||||||
|
|
||||||
|
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_SVG_DocumentRec;
|
||||||
|
|
||||||
|
|
||||||
|
/**************************************************************************
|
||||||
|
*
|
||||||
|
* @type:
|
||||||
|
* FT_SVG_Document
|
||||||
|
*
|
||||||
|
* @description:
|
||||||
|
* A handle to an @FT_SVG_DocumentRec object.
|
||||||
|
*
|
||||||
|
* @since:
|
||||||
|
* 2.12
|
||||||
|
*/
|
||||||
|
typedef struct FT_SVG_DocumentRec_* FT_SVG_Document;
|
||||||
|
|
||||||
|
|
||||||
|
FT_END_HEADER
|
||||||
|
|
||||||
|
#endif /* OTSVG_H_ */
|
||||||
|
|
||||||
|
|
||||||
|
/* END */
|
||||||
@ -5,7 +5,7 @@
|
|||||||
* Basic Type 1/Type 2 tables definitions and interface (specification
|
* Basic Type 1/Type 2 tables definitions and interface (specification
|
||||||
* only).
|
* only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -269,64 +269,6 @@ FT_BEGIN_HEADER
|
|||||||
/* */
|
/* */
|
||||||
|
|
||||||
|
|
||||||
/* maximum number of Multiple Masters designs, as defined in the spec */
|
|
||||||
#define T1_MAX_MM_DESIGNS 16
|
|
||||||
|
|
||||||
/* maximum number of Multiple Masters axes, as defined in the spec */
|
|
||||||
#define T1_MAX_MM_AXIS 4
|
|
||||||
|
|
||||||
/* maximum number of elements in a design map */
|
|
||||||
#define T1_MAX_MM_MAP_POINTS 20
|
|
||||||
|
|
||||||
|
|
||||||
/* this structure is used to store the BlendDesignMap entry for an axis */
|
|
||||||
typedef struct PS_DesignMap_
|
|
||||||
{
|
|
||||||
FT_Byte num_points;
|
|
||||||
FT_Long* design_points;
|
|
||||||
FT_Fixed* blend_points;
|
|
||||||
|
|
||||||
} PS_DesignMapRec, *PS_DesignMap;
|
|
||||||
|
|
||||||
/* backward compatible definition */
|
|
||||||
typedef PS_DesignMapRec T1_DesignMap;
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct PS_BlendRec_
|
|
||||||
{
|
|
||||||
FT_UInt num_designs;
|
|
||||||
FT_UInt num_axis;
|
|
||||||
|
|
||||||
FT_String* axis_names[T1_MAX_MM_AXIS];
|
|
||||||
FT_Fixed* design_pos[T1_MAX_MM_DESIGNS];
|
|
||||||
PS_DesignMapRec design_map[T1_MAX_MM_AXIS];
|
|
||||||
|
|
||||||
FT_Fixed* weight_vector;
|
|
||||||
FT_Fixed* default_weight_vector;
|
|
||||||
|
|
||||||
PS_FontInfo font_infos[T1_MAX_MM_DESIGNS + 1];
|
|
||||||
PS_Private privates [T1_MAX_MM_DESIGNS + 1];
|
|
||||||
|
|
||||||
FT_ULong blend_bitflags;
|
|
||||||
|
|
||||||
FT_BBox* bboxes [T1_MAX_MM_DESIGNS + 1];
|
|
||||||
|
|
||||||
/* since 2.3.0 */
|
|
||||||
|
|
||||||
/* undocumented, optional: the default design instance; */
|
|
||||||
/* corresponds to default_weight_vector -- */
|
|
||||||
/* num_default_design_vector == 0 means it is not present */
|
|
||||||
/* in the font and associated metrics files */
|
|
||||||
FT_UInt default_design_vector[T1_MAX_MM_DESIGNS];
|
|
||||||
FT_UInt num_default_design_vector;
|
|
||||||
|
|
||||||
} PS_BlendRec, *PS_Blend;
|
|
||||||
|
|
||||||
|
|
||||||
/* backward compatible definition */
|
|
||||||
typedef PS_BlendRec T1_Blend;
|
|
||||||
|
|
||||||
|
|
||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @struct:
|
* @struct:
|
||||||
@ -360,7 +302,7 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
FT_UInt num_subrs;
|
FT_UInt num_subrs;
|
||||||
FT_ULong subrmap_offset;
|
FT_ULong subrmap_offset;
|
||||||
FT_Int sd_bytes;
|
FT_UInt sd_bytes;
|
||||||
|
|
||||||
} CID_FaceDictRec;
|
} CID_FaceDictRec;
|
||||||
|
|
||||||
@ -415,11 +357,11 @@ FT_BEGIN_HEADER
|
|||||||
FT_ULong xuid[16];
|
FT_ULong xuid[16];
|
||||||
|
|
||||||
FT_ULong cidmap_offset;
|
FT_ULong cidmap_offset;
|
||||||
FT_Int fd_bytes;
|
FT_UInt fd_bytes;
|
||||||
FT_Int gd_bytes;
|
FT_UInt gd_bytes;
|
||||||
FT_ULong cid_count;
|
FT_ULong cid_count;
|
||||||
|
|
||||||
FT_Int num_dicts;
|
FT_UInt num_dicts;
|
||||||
CID_FaceDict font_dicts;
|
CID_FaceDict font_dicts;
|
||||||
|
|
||||||
FT_ULong data_offset;
|
FT_ULong data_offset;
|
||||||
@ -453,22 +395,22 @@ FT_BEGIN_HEADER
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
* FT_Has_PS_Glyph_Names
|
* FT_Has_PS_Glyph_Names
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Return true if a given face provides reliable PostScript glyph names.
|
* Return true if a given face provides reliable PostScript glyph names.
|
||||||
* This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
|
* This is similar to using the @FT_HAS_GLYPH_NAMES macro, except that
|
||||||
* certain fonts (mostly TrueType) contain incorrect glyph name tables.
|
* certain fonts (mostly TrueType) contain incorrect glyph name tables.
|
||||||
*
|
*
|
||||||
* When this function returns true, the caller is sure that the glyph
|
* When this function returns true, the caller is sure that the glyph
|
||||||
* names returned by @FT_Get_Glyph_Name are reliable.
|
* names returned by @FT_Get_Glyph_Name are reliable.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* face ::
|
* face ::
|
||||||
* face handle
|
* face handle
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* Boolean. True if glyph names are reliable.
|
* Boolean. True if glyph names are reliable.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Int )
|
FT_EXPORT( FT_Int )
|
||||||
@ -478,30 +420,40 @@ FT_BEGIN_HEADER
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
* FT_Get_PS_Font_Info
|
* FT_Get_PS_Font_Info
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Retrieve the @PS_FontInfoRec structure corresponding to a given
|
* Retrieve the @PS_FontInfoRec structure corresponding to a given
|
||||||
* PostScript font.
|
* PostScript font.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* face ::
|
* face ::
|
||||||
* PostScript face handle.
|
* PostScript face handle.
|
||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* afont_info ::
|
* afont_info ::
|
||||||
* Output font info structure pointer.
|
* A pointer to a @PS_FontInfoRec object.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* String pointers within the @PS_FontInfoRec structure are owned by the
|
* String pointers within the @PS_FontInfoRec structure are owned by the
|
||||||
* face and don't need to be freed by the caller. Missing entries in
|
* face and don't need to be freed by the caller. Missing entries in the
|
||||||
* the font's FontInfo dictionary are represented by `NULL` pointers.
|
* font's FontInfo dictionary are represented by `NULL` pointers.
|
||||||
*
|
*
|
||||||
* If the font's format is not PostScript-based, this function will
|
* The following font formats support this feature: 'Type~1', 'Type~42',
|
||||||
* return the `FT_Err_Invalid_Argument` error code.
|
* 'CFF', 'CID~Type~1'. For other font formats this function returns the
|
||||||
|
* `FT_Err_Invalid_Argument` error code.
|
||||||
|
*
|
||||||
|
* @example:
|
||||||
|
* ```
|
||||||
|
* PS_FontInfoRec font_info;
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* error = FT_Get_PS_Font_Info( face, &font_info );
|
||||||
|
* ...
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error )
|
||||||
@ -512,29 +464,39 @@ FT_BEGIN_HEADER
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
* FT_Get_PS_Font_Private
|
* FT_Get_PS_Font_Private
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Retrieve the @PS_PrivateRec structure corresponding to a given
|
* Retrieve the @PS_PrivateRec structure corresponding to a given
|
||||||
* PostScript font.
|
* PostScript font.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* face ::
|
* face ::
|
||||||
* PostScript face handle.
|
* PostScript face handle.
|
||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* afont_private ::
|
* afont_private ::
|
||||||
* Output private dictionary structure pointer.
|
* A pointer to a @PS_PrivateRec object.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* FreeType error code. 0~means success.
|
* FreeType error code. 0~means success.
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* The string pointers within the @PS_PrivateRec structure are owned by
|
* The string pointers within the @PS_PrivateRec structure are owned by
|
||||||
* the face and don't need to be freed by the caller.
|
* the face and don't need to be freed by the caller.
|
||||||
*
|
*
|
||||||
* If the font's format is not PostScript-based, this function returns
|
* Only the 'Type~1' font format supports this feature. For other font
|
||||||
* the `FT_Err_Invalid_Argument` error code.
|
* formats this function returns the `FT_Err_Invalid_Argument` error
|
||||||
|
* code.
|
||||||
|
*
|
||||||
|
* @example:
|
||||||
|
* ```
|
||||||
|
* PS_PrivateRec font_private;
|
||||||
|
*
|
||||||
|
*
|
||||||
|
* error = FT_Get_PS_Font_Private( face, &font_private );
|
||||||
|
* ...
|
||||||
|
* ```
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Error )
|
FT_EXPORT( FT_Error )
|
||||||
@ -693,67 +655,67 @@ FT_BEGIN_HEADER
|
|||||||
/**************************************************************************
|
/**************************************************************************
|
||||||
*
|
*
|
||||||
* @function:
|
* @function:
|
||||||
* FT_Get_PS_Font_Value
|
* FT_Get_PS_Font_Value
|
||||||
*
|
*
|
||||||
* @description:
|
* @description:
|
||||||
* Retrieve the value for the supplied key from a PostScript font.
|
* Retrieve the value for the supplied key from a PostScript font.
|
||||||
*
|
*
|
||||||
* @input:
|
* @input:
|
||||||
* face ::
|
* face ::
|
||||||
* PostScript face handle.
|
* PostScript face handle.
|
||||||
*
|
*
|
||||||
* key ::
|
* key ::
|
||||||
* An enumeration value representing the dictionary key to retrieve.
|
* An enumeration value representing the dictionary key to retrieve.
|
||||||
*
|
*
|
||||||
* idx ::
|
* idx ::
|
||||||
* For array values, this specifies the index to be returned.
|
* For array values, this specifies the index to be returned.
|
||||||
*
|
*
|
||||||
* value ::
|
* value ::
|
||||||
* A pointer to memory into which to write the value.
|
* A pointer to memory into which to write the value.
|
||||||
*
|
*
|
||||||
* valen_len ::
|
* valen_len ::
|
||||||
* The size, in bytes, of the memory supplied for the value.
|
* The size, in bytes, of the memory supplied for the value.
|
||||||
*
|
*
|
||||||
* @output:
|
* @output:
|
||||||
* value ::
|
* value ::
|
||||||
* The value matching the above key, if it exists.
|
* The value matching the above key, if it exists.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* The amount of memory (in bytes) required to hold the requested value
|
* The amount of memory (in bytes) required to hold the requested value
|
||||||
* (if it exists, -1 otherwise).
|
* (if it exists, -1 otherwise).
|
||||||
*
|
*
|
||||||
* @note:
|
* @note:
|
||||||
* The values returned are not pointers into the internal structures of
|
* The values returned are not pointers into the internal structures of
|
||||||
* the face, but are 'fresh' copies, so that the memory containing them
|
* the face, but are 'fresh' copies, so that the memory containing them
|
||||||
* belongs to the calling application. This also enforces the
|
* belongs to the calling application. This also enforces the
|
||||||
* 'read-only' nature of these values, i.e., this function cannot be
|
* 'read-only' nature of these values, i.e., this function cannot be
|
||||||
* used to manipulate the face.
|
* used to manipulate the face.
|
||||||
*
|
*
|
||||||
* `value` is a void pointer because the values returned can be of
|
* `value` is a void pointer because the values returned can be of
|
||||||
* various types.
|
* various types.
|
||||||
*
|
*
|
||||||
* If either `value` is `NULL` or `value_len` is too small, just the
|
* If either `value` is `NULL` or `value_len` is too small, just the
|
||||||
* required memory size for the requested entry is returned.
|
* required memory size for the requested entry is returned.
|
||||||
*
|
*
|
||||||
* The `idx` parameter is used, not only to retrieve elements of, for
|
* The `idx` parameter is used, not only to retrieve elements of, for
|
||||||
* example, the FontMatrix or FontBBox, but also to retrieve name keys
|
* example, the FontMatrix or FontBBox, but also to retrieve name keys
|
||||||
* from the CharStrings dictionary, and the charstrings themselves. It
|
* from the CharStrings dictionary, and the charstrings themselves. It
|
||||||
* is ignored for atomic values.
|
* is ignored for atomic values.
|
||||||
*
|
*
|
||||||
* `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
|
* `PS_DICT_BLUE_SCALE` returns a value that is scaled up by 1000. To
|
||||||
* get the value as in the font stream, you need to divide by 65536000.0
|
* get the value as in the font stream, you need to divide by 65536000.0
|
||||||
* (to remove the FT_Fixed scale, and the x1000 scale).
|
* (to remove the FT_Fixed scale, and the x1000 scale).
|
||||||
*
|
*
|
||||||
* IMPORTANT: Only key/value pairs read by the FreeType interpreter can
|
* IMPORTANT: Only key/value pairs read by the FreeType interpreter can
|
||||||
* be retrieved. So, for example, PostScript procedures such as NP, ND,
|
* be retrieved. So, for example, PostScript procedures such as NP, ND,
|
||||||
* and RD are not available. Arbitrary keys are, obviously, not be
|
* and RD are not available. Arbitrary keys are, obviously, not be
|
||||||
* available either.
|
* available either.
|
||||||
*
|
*
|
||||||
* If the font's format is not PostScript-based, this function returns
|
* If the font's format is not PostScript-based, this function returns
|
||||||
* the `FT_Err_Invalid_Argument` error code.
|
* the `FT_Err_Invalid_Argument` error code.
|
||||||
*
|
*
|
||||||
* @since:
|
* @since:
|
||||||
* 2.4.8
|
* 2.4.8
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Long )
|
FT_EXPORT( FT_Long )
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* TrueType name ID definitions (specification only).
|
* TrueType name ID definitions (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -591,7 +591,7 @@ FT_BEGIN_HEADER
|
|||||||
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043E
|
#define TT_MS_LANGID_MALAY_MALAYSIA 0x043E
|
||||||
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E
|
#define TT_MS_LANGID_MALAY_BRUNEI_DARUSSALAM 0x083E
|
||||||
#define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F
|
#define TT_MS_LANGID_KAZAKH_KAZAKHSTAN 0x043F
|
||||||
#define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic*/ 0x0440
|
#define TT_MS_LANGID_KYRGYZ_KYRGYZSTAN /* Cyrillic */ 0x0440
|
||||||
#define TT_MS_LANGID_KISWAHILI_KENYA 0x0441
|
#define TT_MS_LANGID_KISWAHILI_KENYA 0x0441
|
||||||
#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442
|
#define TT_MS_LANGID_TURKMEN_TURKMENISTAN 0x0442
|
||||||
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
|
#define TT_MS_LANGID_UZBEK_UZBEKISTAN_LATIN 0x0443
|
||||||
|
|||||||
@ -5,7 +5,7 @@
|
|||||||
* Basic SFNT/TrueType tables definitions and interface
|
* Basic SFNT/TrueType tables definitions and interface
|
||||||
* (specification only).
|
* (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -424,8 +424,8 @@ FT_BEGIN_HEADER
|
|||||||
|
|
||||||
/* only version 5 and higher: */
|
/* only version 5 and higher: */
|
||||||
|
|
||||||
FT_UShort usLowerOpticalPointSize; /* in twips (1/20th points) */
|
FT_UShort usLowerOpticalPointSize; /* in twips (1/20 points) */
|
||||||
FT_UShort usUpperOpticalPointSize; /* in twips (1/20th points) */
|
FT_UShort usUpperOpticalPointSize; /* in twips (1/20 points) */
|
||||||
|
|
||||||
} TT_OS2;
|
} TT_OS2;
|
||||||
|
|
||||||
@ -838,8 +838,9 @@ FT_BEGIN_HEADER
|
|||||||
* The target charmap.
|
* The target charmap.
|
||||||
*
|
*
|
||||||
* @return:
|
* @return:
|
||||||
* The format of `charmap`. If `charmap` doesn't belong to an SFNT face,
|
* The format of `charmap`. If `charmap` doesn't belong to an SFNT face
|
||||||
* return -1.
|
* (including the synthetic Unicode charmap sometimes created by
|
||||||
|
* FreeType), return -1.
|
||||||
*/
|
*/
|
||||||
FT_EXPORT( FT_Long )
|
FT_EXPORT( FT_Long )
|
||||||
FT_Get_CMap_Format( FT_CharMap charmap );
|
FT_Get_CMap_Format( FT_CharMap charmap );
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Tags for TrueType and OpenType tables (specification only).
|
* Tags for TrueType and OpenType tables (specification only).
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
@ -95,6 +95,7 @@ FT_BEGIN_HEADER
|
|||||||
#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
|
#define TTAG_sbix FT_MAKE_TAG( 's', 'b', 'i', 'x' )
|
||||||
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
|
#define TTAG_sfnt FT_MAKE_TAG( 's', 'f', 'n', 't' )
|
||||||
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
|
#define TTAG_SING FT_MAKE_TAG( 'S', 'I', 'N', 'G' )
|
||||||
|
#define TTAG_SVG FT_MAKE_TAG( 'S', 'V', 'G', ' ' )
|
||||||
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
|
#define TTAG_trak FT_MAKE_TAG( 't', 'r', 'a', 'k' )
|
||||||
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
|
#define TTAG_true FT_MAKE_TAG( 't', 'r', 'u', 'e' )
|
||||||
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
|
#define TTAG_ttc FT_MAKE_TAG( 't', 't', 'c', ' ' )
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* FreeType 2 build and setup macros.
|
* FreeType 2 build and setup macros.
|
||||||
*
|
*
|
||||||
* Copyright (C) 1996-2020 by
|
* Copyright (C) 1996-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -1,285 +0,0 @@
|
|||||||
/****************************************************************************
|
|
||||||
*
|
|
||||||
* afangles.c
|
|
||||||
*
|
|
||||||
* Routines used to compute vector angles with limited accuracy
|
|
||||||
* and very high speed. It also contains sorting routines (body).
|
|
||||||
*
|
|
||||||
* Copyright (C) 2003-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.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "aftypes.h"
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* We are not using `af_angle_atan' anymore, but we keep the source
|
|
||||||
* code below just in case...
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#if 0
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* The trick here is to realize that we don't need a very accurate angle
|
|
||||||
* approximation. We are going to use the result of `af_angle_atan' to
|
|
||||||
* only compare the sign of angle differences, or check whether its
|
|
||||||
* magnitude is very small.
|
|
||||||
*
|
|
||||||
* The approximation
|
|
||||||
*
|
|
||||||
* dy * PI / (|dx|+|dy|)
|
|
||||||
*
|
|
||||||
* should be enough, and much faster to compute.
|
|
||||||
*/
|
|
||||||
FT_LOCAL_DEF( AF_Angle )
|
|
||||||
af_angle_atan( FT_Fixed dx,
|
|
||||||
FT_Fixed dy )
|
|
||||||
{
|
|
||||||
AF_Angle angle;
|
|
||||||
FT_Fixed ax = dx;
|
|
||||||
FT_Fixed ay = dy;
|
|
||||||
|
|
||||||
|
|
||||||
if ( ax < 0 )
|
|
||||||
ax = -ax;
|
|
||||||
if ( ay < 0 )
|
|
||||||
ay = -ay;
|
|
||||||
|
|
||||||
ax += ay;
|
|
||||||
|
|
||||||
if ( ax == 0 )
|
|
||||||
angle = 0;
|
|
||||||
else
|
|
||||||
{
|
|
||||||
angle = ( AF_ANGLE_PI2 * dy ) / ( ax + ay );
|
|
||||||
if ( dx < 0 )
|
|
||||||
{
|
|
||||||
if ( angle >= 0 )
|
|
||||||
angle = AF_ANGLE_PI - angle;
|
|
||||||
else
|
|
||||||
angle = -AF_ANGLE_PI - angle;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return angle;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#elif 0
|
|
||||||
|
|
||||||
|
|
||||||
/* the following table has been automatically generated with */
|
|
||||||
/* the `mather.py' Python script */
|
|
||||||
|
|
||||||
#define AF_ATAN_BITS 8
|
|
||||||
|
|
||||||
static const FT_Byte af_arctan[1L << AF_ATAN_BITS] =
|
|
||||||
{
|
|
||||||
0, 0, 1, 1, 1, 2, 2, 2,
|
|
||||||
3, 3, 3, 3, 4, 4, 4, 5,
|
|
||||||
5, 5, 6, 6, 6, 7, 7, 7,
|
|
||||||
8, 8, 8, 9, 9, 9, 10, 10,
|
|
||||||
10, 10, 11, 11, 11, 12, 12, 12,
|
|
||||||
13, 13, 13, 14, 14, 14, 14, 15,
|
|
||||||
15, 15, 16, 16, 16, 17, 17, 17,
|
|
||||||
18, 18, 18, 18, 19, 19, 19, 20,
|
|
||||||
20, 20, 21, 21, 21, 21, 22, 22,
|
|
||||||
22, 23, 23, 23, 24, 24, 24, 24,
|
|
||||||
25, 25, 25, 26, 26, 26, 26, 27,
|
|
||||||
27, 27, 28, 28, 28, 28, 29, 29,
|
|
||||||
29, 30, 30, 30, 30, 31, 31, 31,
|
|
||||||
31, 32, 32, 32, 33, 33, 33, 33,
|
|
||||||
34, 34, 34, 34, 35, 35, 35, 35,
|
|
||||||
36, 36, 36, 36, 37, 37, 37, 38,
|
|
||||||
38, 38, 38, 39, 39, 39, 39, 40,
|
|
||||||
40, 40, 40, 41, 41, 41, 41, 42,
|
|
||||||
42, 42, 42, 42, 43, 43, 43, 43,
|
|
||||||
44, 44, 44, 44, 45, 45, 45, 45,
|
|
||||||
46, 46, 46, 46, 46, 47, 47, 47,
|
|
||||||
47, 48, 48, 48, 48, 48, 49, 49,
|
|
||||||
49, 49, 50, 50, 50, 50, 50, 51,
|
|
||||||
51, 51, 51, 51, 52, 52, 52, 52,
|
|
||||||
52, 53, 53, 53, 53, 53, 54, 54,
|
|
||||||
54, 54, 54, 55, 55, 55, 55, 55,
|
|
||||||
56, 56, 56, 56, 56, 57, 57, 57,
|
|
||||||
57, 57, 57, 58, 58, 58, 58, 58,
|
|
||||||
59, 59, 59, 59, 59, 59, 60, 60,
|
|
||||||
60, 60, 60, 61, 61, 61, 61, 61,
|
|
||||||
61, 62, 62, 62, 62, 62, 62, 63,
|
|
||||||
63, 63, 63, 63, 63, 64, 64, 64
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( AF_Angle )
|
|
||||||
af_angle_atan( FT_Fixed dx,
|
|
||||||
FT_Fixed dy )
|
|
||||||
{
|
|
||||||
AF_Angle angle;
|
|
||||||
|
|
||||||
|
|
||||||
/* check trivial cases */
|
|
||||||
if ( dy == 0 )
|
|
||||||
{
|
|
||||||
angle = 0;
|
|
||||||
if ( dx < 0 )
|
|
||||||
angle = AF_ANGLE_PI;
|
|
||||||
return angle;
|
|
||||||
}
|
|
||||||
else if ( dx == 0 )
|
|
||||||
{
|
|
||||||
angle = AF_ANGLE_PI2;
|
|
||||||
if ( dy < 0 )
|
|
||||||
angle = -AF_ANGLE_PI2;
|
|
||||||
return angle;
|
|
||||||
}
|
|
||||||
|
|
||||||
angle = 0;
|
|
||||||
if ( dx < 0 )
|
|
||||||
{
|
|
||||||
dx = -dx;
|
|
||||||
dy = -dy;
|
|
||||||
angle = AF_ANGLE_PI;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( dy < 0 )
|
|
||||||
{
|
|
||||||
FT_Pos tmp;
|
|
||||||
|
|
||||||
|
|
||||||
tmp = dx;
|
|
||||||
dx = -dy;
|
|
||||||
dy = tmp;
|
|
||||||
angle -= AF_ANGLE_PI2;
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( dx == 0 && dy == 0 )
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
if ( dx == dy )
|
|
||||||
angle += AF_ANGLE_PI4;
|
|
||||||
else if ( dx > dy )
|
|
||||||
angle += af_arctan[FT_DivFix( dy, dx ) >> ( 16 - AF_ATAN_BITS )];
|
|
||||||
else
|
|
||||||
angle += AF_ANGLE_PI2 -
|
|
||||||
af_arctan[FT_DivFix( dx, dy ) >> ( 16 - AF_ATAN_BITS )];
|
|
||||||
|
|
||||||
if ( angle > AF_ANGLE_PI )
|
|
||||||
angle -= AF_ANGLE_2PI;
|
|
||||||
|
|
||||||
return angle;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#endif /* 0 */
|
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
|
||||||
af_sort_pos( FT_UInt count,
|
|
||||||
FT_Pos* table )
|
|
||||||
{
|
|
||||||
FT_UInt i, j;
|
|
||||||
FT_Pos swap;
|
|
||||||
|
|
||||||
|
|
||||||
for ( i = 1; i < count; i++ )
|
|
||||||
{
|
|
||||||
for ( j = i; j > 0; j-- )
|
|
||||||
{
|
|
||||||
if ( table[j] >= table[j - 1] )
|
|
||||||
break;
|
|
||||||
|
|
||||||
swap = table[j];
|
|
||||||
table[j] = table[j - 1];
|
|
||||||
table[j - 1] = swap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
FT_LOCAL_DEF( void )
|
|
||||||
af_sort_and_quantize_widths( FT_UInt* count,
|
|
||||||
AF_Width table,
|
|
||||||
FT_Pos threshold )
|
|
||||||
{
|
|
||||||
FT_UInt i, j;
|
|
||||||
FT_UInt cur_idx;
|
|
||||||
FT_Pos cur_val;
|
|
||||||
FT_Pos sum;
|
|
||||||
AF_WidthRec swap;
|
|
||||||
|
|
||||||
|
|
||||||
if ( *count == 1 )
|
|
||||||
return;
|
|
||||||
|
|
||||||
/* sort */
|
|
||||||
for ( i = 1; i < *count; i++ )
|
|
||||||
{
|
|
||||||
for ( j = i; j > 0; j-- )
|
|
||||||
{
|
|
||||||
if ( table[j].org >= table[j - 1].org )
|
|
||||||
break;
|
|
||||||
|
|
||||||
swap = table[j];
|
|
||||||
table[j] = table[j - 1];
|
|
||||||
table[j - 1] = swap;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_idx = 0;
|
|
||||||
cur_val = table[cur_idx].org;
|
|
||||||
|
|
||||||
/* compute and use mean values for clusters not larger than */
|
|
||||||
/* `threshold'; this is very primitive and might not yield */
|
|
||||||
/* the best result, but normally, using reference character */
|
|
||||||
/* `o', `*count' is 2, so the code below is fully sufficient */
|
|
||||||
for ( i = 1; i < *count; i++ )
|
|
||||||
{
|
|
||||||
if ( table[i].org - cur_val > threshold ||
|
|
||||||
i == *count - 1 )
|
|
||||||
{
|
|
||||||
sum = 0;
|
|
||||||
|
|
||||||
/* fix loop for end of array */
|
|
||||||
if ( table[i].org - cur_val <= threshold &&
|
|
||||||
i == *count - 1 )
|
|
||||||
i++;
|
|
||||||
|
|
||||||
for ( j = cur_idx; j < i; j++ )
|
|
||||||
{
|
|
||||||
sum += table[j].org;
|
|
||||||
table[j].org = 0;
|
|
||||||
}
|
|
||||||
table[cur_idx].org = sum / (FT_Pos)j;
|
|
||||||
|
|
||||||
if ( i < *count - 1 )
|
|
||||||
{
|
|
||||||
cur_idx = i + 1;
|
|
||||||
cur_val = table[cur_idx].org;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cur_idx = 1;
|
|
||||||
|
|
||||||
/* compress array to remove zero values */
|
|
||||||
for ( i = 1; i < *count; i++ )
|
|
||||||
{
|
|
||||||
if ( table[i].org )
|
|
||||||
table[cur_idx++] = table[i];
|
|
||||||
}
|
|
||||||
|
|
||||||
*count = cur_idx;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/* END */
|
|
||||||
@ -1,7 +0,0 @@
|
|||||||
/*
|
|
||||||
* afangles.h
|
|
||||||
*
|
|
||||||
* This is a dummy file, used to please the build system. It is never
|
|
||||||
* included by the auto-fitter sources.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* Auto-fitter data for blue strings (body).
|
* Auto-fitter data for blue strings (body).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013-2020 by
|
* Copyright (C) 2013-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* Auto-fitter data for blue strings (body).
|
* Auto-fitter data for blue strings (body).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013-2020 by
|
* Copyright (C) 2013-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
//
|
//
|
||||||
// Auto-fitter data for blue strings.
|
// Auto-fitter data for blue strings.
|
||||||
//
|
//
|
||||||
// Copyright (C) 2013-2020 by
|
// Copyright (C) 2013-2024 by
|
||||||
// David Turner, Robert Wilhelm, and Werner Lemberg.
|
// David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
//
|
//
|
||||||
// This file is part of the FreeType project, and may only be used,
|
// This file is part of the FreeType project, and may only be used,
|
||||||
@ -89,7 +89,7 @@ AF_BLUE_STRING_ENUM AF_BLUE_STRINGS_ARRAY AF_BLUE_STRING_MAX_LEN:
|
|||||||
"ت ث ط ظ ك"
|
"ت ث ط ظ ك"
|
||||||
// We don't necessarily have access to medial forms via Unicode in case
|
// We don't necessarily have access to medial forms via Unicode in case
|
||||||
// Arabic presentational forms are missing. The only character that is
|
// Arabic presentational forms are missing. The only character that is
|
||||||
// guaranteed to have the same vertical position with joining (this is,
|
// guaranteed to have the same vertical position with joining (that is,
|
||||||
// non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both
|
// non-isolated) forms is U+0640, ARABIC TATWEEL, which must join both
|
||||||
// round and flat curves.
|
// round and flat curves.
|
||||||
AF_BLUE_STRING_ARABIC_JOIN
|
AF_BLUE_STRING_ARABIC_JOIN
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
*
|
*
|
||||||
* Auto-fitter data for blue strings (specification).
|
* Auto-fitter data for blue strings (specification).
|
||||||
*
|
*
|
||||||
* Copyright (C) 2013-2020 by
|
* Copyright (C) 2013-2024 by
|
||||||
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
* David Turner, Robert Wilhelm, and Werner Lemberg.
|
||||||
*
|
*
|
||||||
* This file is part of the FreeType project, and may only be used,
|
* This file is part of the FreeType project, and may only be used,
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user