2018-06-03 22:00:42 +02:00
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
* ftotval.h
|
|
|
|
*
|
|
|
|
* FreeType API for validating OpenType tables (specification).
|
|
|
|
*
|
2024-01-27 17:11:22 +01:00
|
|
|
* Copyright (C) 2004-2024 by
|
2018-06-03 22:00:42 +02:00
|
|
|
* 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.
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Warning: This module might be moved to a different library in the
|
2018-06-17 11:22:37 +02:00
|
|
|
* future to avoid a tight dependency between FreeType and the
|
|
|
|
* OpenType specification.
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
|
|
|
*
|
|
|
|
*/
|
2005-06-02 09:12:05 +02:00
|
|
|
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#ifndef FTOTVAL_H_
|
|
|
|
#define FTOTVAL_H_
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
|
2020-06-08 13:31:55 +02:00
|
|
|
#include <freetype/freetype.h>
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
|
|
|
|
#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
|
|
|
|
|
|
|
|
|
2018-06-03 22:00:42 +02:00
|
|
|
/**************************************************************************
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @section:
|
2018-06-03 22:00:42 +02:00
|
|
|
* ot_validation
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @title:
|
2018-06-03 22:00:42 +02:00
|
|
|
* OpenType Validation
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @abstract:
|
2018-06-03 22:00:42 +02:00
|
|
|
* An API to validate OpenType tables.
|
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @description:
|
2018-08-24 18:52:30 +02:00
|
|
|
* This section contains the declaration of functions to validate some
|
|
|
|
* OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
|
2018-06-03 22:00:42 +02:00
|
|
|
*
|
2018-06-17 21:08:36 +02:00
|
|
|
* @order:
|
2018-06-03 22:00:42 +02:00
|
|
|
* FT_OpenType_Validate
|
|
|
|
* FT_OpenType_Free
|
|
|
|
*
|
|
|
|
* FT_VALIDATE_OTXXX
|
|
|
|
*
|
|
|
|
*/
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
|
|
|
|
|
2018-09-04 08:00:58 +02:00
|
|
|
/**************************************************************************
|
2018-06-17 11:22:37 +02:00
|
|
|
*
|
|
|
|
* @enum:
|
|
|
|
* FT_VALIDATE_OTXXX
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* A list of bit-field constants used with @FT_OpenType_Validate to
|
|
|
|
* indicate which OpenType tables should be validated.
|
|
|
|
*
|
|
|
|
* @values:
|
|
|
|
* FT_VALIDATE_BASE ::
|
|
|
|
* Validate BASE table.
|
|
|
|
*
|
|
|
|
* FT_VALIDATE_GDEF ::
|
|
|
|
* Validate GDEF table.
|
|
|
|
*
|
|
|
|
* FT_VALIDATE_GPOS ::
|
|
|
|
* Validate GPOS table.
|
|
|
|
*
|
|
|
|
* FT_VALIDATE_GSUB ::
|
|
|
|
* Validate GSUB table.
|
|
|
|
*
|
|
|
|
* FT_VALIDATE_JSTF ::
|
|
|
|
* Validate JSTF table.
|
|
|
|
*
|
|
|
|
* FT_VALIDATE_MATH ::
|
|
|
|
* Validate MATH table.
|
|
|
|
*
|
|
|
|
* FT_VALIDATE_OT ::
|
|
|
|
* Validate all OpenType tables (BASE, GDEF, GPOS, GSUB, JSTF, MATH).
|
|
|
|
*
|
|
|
|
*/
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
#define FT_VALIDATE_BASE 0x0100
|
|
|
|
#define FT_VALIDATE_GDEF 0x0200
|
|
|
|
#define FT_VALIDATE_GPOS 0x0400
|
|
|
|
#define FT_VALIDATE_GSUB 0x0800
|
|
|
|
#define FT_VALIDATE_JSTF 0x1000
|
2007-08-08 08:38:06 +02:00
|
|
|
#define FT_VALIDATE_MATH 0x2000
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
|
2016-05-21 04:04:01 +02:00
|
|
|
#define FT_VALIDATE_OT ( FT_VALIDATE_BASE | \
|
|
|
|
FT_VALIDATE_GDEF | \
|
|
|
|
FT_VALIDATE_GPOS | \
|
|
|
|
FT_VALIDATE_GSUB | \
|
|
|
|
FT_VALIDATE_JSTF | \
|
|
|
|
FT_VALIDATE_MATH )
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
|
2018-06-17 11:22:37 +02:00
|
|
|
|
2018-09-04 08:00:58 +02:00
|
|
|
/**************************************************************************
|
2018-06-17 11:22:37 +02:00
|
|
|
*
|
|
|
|
* @function:
|
|
|
|
* FT_OpenType_Validate
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* Validate various OpenType tables to assure that all offsets and
|
|
|
|
* indices are valid. The idea is that a higher-level library that
|
2018-08-24 18:52:30 +02:00
|
|
|
* actually does the text layout can access those tables without error
|
|
|
|
* checking (which can be quite time consuming).
|
2018-06-17 11:22:37 +02:00
|
|
|
*
|
|
|
|
* @input:
|
|
|
|
* face ::
|
|
|
|
* A handle to the input face.
|
|
|
|
*
|
|
|
|
* validation_flags ::
|
|
|
|
* A bit field that specifies the tables to be validated. See
|
|
|
|
* @FT_VALIDATE_OTXXX for possible values.
|
|
|
|
*
|
|
|
|
* @output:
|
|
|
|
* BASE_table ::
|
|
|
|
* A pointer to the BASE table.
|
|
|
|
*
|
|
|
|
* GDEF_table ::
|
|
|
|
* A pointer to the GDEF table.
|
|
|
|
*
|
|
|
|
* GPOS_table ::
|
|
|
|
* A pointer to the GPOS table.
|
|
|
|
*
|
|
|
|
* GSUB_table ::
|
|
|
|
* A pointer to the GSUB table.
|
|
|
|
*
|
|
|
|
* JSTF_table ::
|
|
|
|
* A pointer to the JSTF table.
|
|
|
|
*
|
|
|
|
* @return:
|
|
|
|
* FreeType error code. 0~means success.
|
|
|
|
*
|
|
|
|
* @note:
|
|
|
|
* This function only works with OpenType fonts, returning an error
|
|
|
|
* otherwise.
|
|
|
|
*
|
|
|
|
* After use, the application should deallocate the five tables with
|
2019-02-20 16:18:40 +01:00
|
|
|
* @FT_OpenType_Free. A `NULL` value indicates that the table either
|
2018-06-17 11:22:37 +02:00
|
|
|
* doesn't exist in the font, or the application hasn't asked for
|
|
|
|
* validation.
|
|
|
|
*/
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
FT_EXPORT( FT_Error )
|
|
|
|
FT_OpenType_Validate( FT_Face face,
|
|
|
|
FT_UInt validation_flags,
|
2007-01-16 07:11:27 +01:00
|
|
|
FT_Bytes *BASE_table,
|
|
|
|
FT_Bytes *GDEF_table,
|
|
|
|
FT_Bytes *GPOS_table,
|
|
|
|
FT_Bytes *GSUB_table,
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
FT_Bytes *JSTF_table );
|
|
|
|
|
2018-06-17 11:22:37 +02:00
|
|
|
|
2018-09-04 08:00:58 +02:00
|
|
|
/**************************************************************************
|
2018-06-17 11:22:37 +02:00
|
|
|
*
|
|
|
|
* @function:
|
|
|
|
* FT_OpenType_Free
|
|
|
|
*
|
|
|
|
* @description:
|
|
|
|
* Free the buffer allocated by OpenType validator.
|
|
|
|
*
|
|
|
|
* @input:
|
|
|
|
* face ::
|
|
|
|
* A handle to the input face.
|
|
|
|
*
|
|
|
|
* table ::
|
|
|
|
* The pointer to the buffer that is allocated by
|
|
|
|
* @FT_OpenType_Validate.
|
|
|
|
*
|
|
|
|
* @note:
|
|
|
|
* This function must be used to free the buffer allocated by
|
|
|
|
* @FT_OpenType_Validate only.
|
|
|
|
*/
|
2005-11-18 08:47:06 +01:00
|
|
|
FT_EXPORT( void )
|
|
|
|
FT_OpenType_Free( FT_Face face,
|
|
|
|
FT_Bytes table );
|
|
|
|
|
2018-06-17 11:22:37 +02:00
|
|
|
|
2014-12-02 23:06:04 +01:00
|
|
|
/* */
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
FT_END_HEADER
|
|
|
|
|
2016-01-12 21:37:13 +01:00
|
|
|
#endif /* FTOTVAL_H_ */
|
Adding OpenType validation module. The code is based on the
(unfinished) `otlayout' module but has been heavily modified to make
it much more compact.
* src/otvalid/*: New module.
* include/freetype/ftotval.h, src/base/ftotval.c,
include/freetype/internal/services/svotval.h: New files.
* include/freetype/config/ftmodule.h: Add otv_module_class.
* include/freetype/config/ftheader.h (FT_OPENTYPE_VALIDATE_H): New
macro.
* include/freetype/internal/ftserv.h
(FT_SERVICE_OPENTYPE_VALIDATE_H): New macro.
* include/freetype/internal/fttrace.h (otvmodule, otvcommon,
otvbase, otvgdef, otvgpos, otvgsub, otvjstf): New trace components.
* include/freetype/ftchapters.h: Updated.
* src/base/Jamfile (Library), src/base/descrip.mms (OBJS),
src/base/rules.mk (BASE_EXT_SRC): Updated.
* docs/CHANGES: Updated.
2004-09-10 16:39:00 +02:00
|
|
|
|
|
|
|
|
|
|
|
/* END */
|