freetype: Update to upstream version 2.10.1

This commit is contained in:
Rémi Verschelde 2019-07-11 09:48:08 +02:00
parent 49ce6bacc3
commit ca71f7d3d0
82 changed files with 1943 additions and 1409 deletions

View file

@ -645,7 +645,7 @@ FT_BEGIN_HEADER
* FT_ENCODING_MS_SYMBOL ::
* Microsoft Symbol encoding, used to encode mathematical symbols and
* wingdings. For more information, see
* 'https://www.microsoft.com/typography/otspec/recom.htm',
* 'https://www.microsoft.com/typography/otspec/recom.htm#non-standard-symbol-fonts',
* 'http://www.kostis.net/charsets/symbol.htm', and
* 'http://www.kostis.net/charsets/wingding.htm'.
*
@ -1766,6 +1766,13 @@ FT_BEGIN_HEADER
* transformed, distorted, emboldened, etc. However, it must not be
* freed.
*
* [Since 2.10.1] If @FT_LOAD_NO_SCALE is set, outline coordinates of
* OpenType variation fonts for a selected instance are internally
* handled as 26.6 fractional font units but returned as (rounded)
* integers, as expected. To get unrounded font units, don't use
* @FT_LOAD_NO_SCALE but load the glyph with @FT_LOAD_NO_HINTING and
* scale it, using the font's `units_per_EM` value as the ppem.
*
* num_subglyphs ::
* The number of subglyphs in a composite glyph. This field is only
* valid for the composite glyph format that should normally only be
@ -3932,8 +3939,8 @@ FT_BEGIN_HEADER
* The glyph index. 0~means 'undefined character code'.
*/
FT_EXPORT( FT_UInt )
FT_Get_Name_Index( FT_Face face,
FT_String* glyph_name );
FT_Get_Name_Index( FT_Face face,
const FT_String* glyph_name );
/**************************************************************************
@ -4774,7 +4781,7 @@ FT_BEGIN_HEADER
*/
#define FREETYPE_MAJOR 2
#define FREETYPE_MINOR 10
#define FREETYPE_PATCH 0
#define FREETYPE_PATCH 1
/**************************************************************************

View file

@ -244,6 +244,8 @@
#define FT_ERR_PROTOS_DEFINED
FT_BEGIN_HEADER
/**************************************************************************
*
* @function:
@ -274,6 +276,8 @@
FT_EXPORT( const char* )
FT_Error_String( FT_Error error_code );
FT_END_HEADER
#endif /* FT_ERR_PROTOS_DEFINED */

View file

@ -210,7 +210,7 @@ FT_BEGIN_HEADER
*
* As the outline is extracted from a glyph slot, its coordinates are
* expressed normally in 26.6 pixels, unless the flag @FT_LOAD_NO_SCALE
* was used in @FT_Load_Glyph() or @FT_Load_Char().
* was used in @FT_Load_Glyph or @FT_Load_Char.
*
* The outline's tables are always owned by the object and are destroyed
* with it.

View file

@ -869,7 +869,7 @@ FT_BEGIN_HEADER
*
* @input:
* y ::
* The scanline's y~coordinate.
* The scanline's upward y~coordinate.
*
* count ::
* The number of spans to draw on this scanline.
@ -945,19 +945,16 @@ FT_BEGIN_HEADER
* This flag is set to indicate direct rendering. In this mode, client
* applications must provide their own span callback. This lets them
* directly draw or compose over an existing bitmap. If this bit is
* not set, the target pixmap's buffer _must_ be zeroed before
* rendering.
* _not_ set, the target pixmap's buffer _must_ be zeroed before
* rendering and the output will be clipped to its size.
*
* Direct rendering is only possible with anti-aliased glyphs.
*
* FT_RASTER_FLAG_CLIP ::
* This flag is only used in direct rendering mode. If set, the output
* will be clipped to a box specified in the `clip_box` field of the
* @FT_Raster_Params structure.
*
* Note that by default, the glyph bitmap is clipped to the target
* pixmap, except in direct rendering mode where all spans are
* generated if no clipping box is set.
* @FT_Raster_Params structure. Otherwise, the `clip_box` is
* effectively set to the bounding box and all spans are generated.
*/
#define FT_RASTER_FLAG_DEFAULT 0x0
#define FT_RASTER_FLAG_AA 0x1
@ -978,7 +975,8 @@ FT_BEGIN_HEADER
* FT_Raster_Params
*
* @description:
* A structure to hold the arguments used by a raster's render function.
* A structure to hold the parameters used by a raster's render function,
* passed as an argument to @FT_Outline_Render.
*
* @fields:
* target ::

View file

@ -623,7 +623,7 @@ FT_BEGIN_HEADER
* it is bytecode interpreter's execution context, `TT_ExecContext`,
* which is declared in FreeType's internal header file `tttypes.h`.
*/
typedef void
typedef FT_Error
(*FT_DebugHook_Func)( void* arg );

View file

@ -466,8 +466,6 @@ FT_BEGIN_HEADER
*
* @description:
* Render an outline within a bitmap using the current scan-convert.
* This function uses an @FT_Raster_Params structure as an argument,
* allowing advanced features like direct composition, translucency, etc.
*
* @input:
* library ::
@ -485,8 +483,10 @@ FT_BEGIN_HEADER
* FreeType error code. 0~means success.
*
* @note:
* You should know what you are doing and how @FT_Raster_Params works to
* use this function.
* This advanced function uses @FT_Raster_Params as an argument,
* allowing FreeType rasterizer to be used for direct composition,
* translucency, etc. You should know how to set up @FT_Raster_Params
* for this function to work.
*
* The field `params.source` will be set to `outline` before the scan
* converter is called, which means that the value you give to it is

View file

@ -58,7 +58,7 @@ FT_BEGIN_HEADER
* @description:
* A list of valid values for the `charset` byte in @FT_WinFNT_HeaderRec.
* Exact mapping tables for the various 'cpXXXX' encodings (except for
* 'cp1361') can be found at 'ftp://ftp.unicode.org/Public' in the
* 'cp1361') can be found at 'ftp://ftp.unicode.org/Public/' in the
* `MAPPINGS/VENDORS/MICSFT/WINDOWS` subdirectory. 'cp1361' is roughly a
* superset of `MAPPINGS/OBSOLETE/EASTASIA/KSC/JOHAB.TXT`.
*

View file

@ -378,6 +378,7 @@ FT_BEGIN_HEADER
#if FT_SIZEOF_INT == 4
#include <intrin.h>
#pragma intrinsic( _BitScanReverse )
static __inline FT_Int32
FT_MSB_i386( FT_UInt32 x )
@ -385,7 +386,6 @@ FT_BEGIN_HEADER
unsigned long where;
/* not available in older VC versions */
_BitScanReverse( &where, x );
return (FT_Int32)where;

View file

@ -278,14 +278,12 @@ FT_BEGIN_HEADER
#ifdef FT_CONFIG_OPTION_SUBPIXEL_RENDERING
typedef void (*FT_Bitmap_LcdFilterFunc)( FT_Bitmap* bitmap,
FT_Render_Mode render_mode,
FT_Byte* weights );
/* This is the default LCD filter, an in-place, 5-tap FIR filter. */
FT_BASE( void )
ft_lcd_filter_fir( FT_Bitmap* bitmap,
FT_Render_Mode mode,
FT_LcdFiveTapFilter weights );
#endif /* FT_CONFIG_OPTION_SUBPIXEL_RENDERING */
@ -941,8 +939,8 @@ FT_BEGIN_HEADER
FT_UInt buffer_max );
typedef FT_UInt
(*FT_Face_GetGlyphNameIndexFunc)( FT_Face face,
FT_String* glyph_name );
(*FT_Face_GetGlyphNameIndexFunc)( FT_Face face,
const FT_String* glyph_name );
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM

View file

@ -165,6 +165,17 @@ FT_BEGIN_HEADER
#define FT_BYTE_U32( p, i, s ) ( FT_UINT32( FT_BYTE_( p, i ) ) << (s) )
/*
* function acts on increases does range for emits
* pointer checking frames error
* -------------------------------------------------------------------
* FT_PEEK_XXX buffer pointer no no no no
* FT_NEXT_XXX buffer pointer yes no no no
* FT_GET_XXX stream->cursor yes yes yes no
* FT_READ_XXX stream->pos yes yes no yes
*/
/*
* `FT_PEEK_XXX' are generic macros to get data from a buffer position. No
* safety checks are performed.

View file

@ -48,6 +48,7 @@ FT_TRACE_DEF( cache ) /* cache sub-system (ftcache.c, etc.) */
/* SFNT driver components */
FT_TRACE_DEF( sfdriver ) /* SFNT font driver (sfdriver.c) */
FT_TRACE_DEF( sfobjs ) /* SFNT object handler (sfobjs.c) */
FT_TRACE_DEF( sfwoff ) /* WOFF format handler (sfwoff.c) */
FT_TRACE_DEF( ttbdf ) /* TrueType embedded BDF (ttbdf.c) */
FT_TRACE_DEF( ttcmap ) /* charmap handler (ttcmap.c) */
FT_TRACE_DEF( ttcolr ) /* glyph layer table (ttcolr.c) */

View file

@ -40,6 +40,7 @@
#define FT_INTERNAL_TRUETYPE_TYPES_H <freetype/internal/tttypes.h>
#define FT_INTERNAL_TYPE1_TYPES_H <freetype/internal/t1types.h>
#define FT_INTERNAL_WOFF_TYPES_H <freetype/internal/wofftypes.h>
#define FT_INTERNAL_POSTSCRIPT_AUX_H <freetype/internal/psaux.h>
#define FT_INTERNAL_POSTSCRIPT_HINTS_H <freetype/internal/pshints.h>

View file

@ -96,10 +96,10 @@ FT_BEGIN_HEADER
(*done)( PS_Table table );
FT_Error
(*add)( PS_Table table,
FT_Int idx,
void* object,
FT_UInt length );
(*add)( PS_Table table,
FT_Int idx,
const void* object,
FT_UInt length );
void
(*release)( PS_Table table );

View file

@ -41,8 +41,8 @@ FT_BEGIN_HEADER
FT_UInt buffer_max );
typedef FT_UInt
(*FT_GlyphDict_NameIndexFunc)( FT_Face face,
FT_String* glyph_name );
(*FT_GlyphDict_NameIndexFunc)( FT_Face face,
const FT_String* glyph_name );
FT_DEFINE_SERVICE( GlyphDict )

View file

@ -23,6 +23,7 @@
#include <ft2build.h>
#include FT_INTERNAL_DRIVER_H
#include FT_INTERNAL_TRUETYPE_TYPES_H
#include FT_INTERNAL_WOFF_TYPES_H
FT_BEGIN_HEADER

View file

@ -76,8 +76,8 @@ FT_BEGIN_HEADER
FT_Int code_first;
FT_Int code_last;
FT_UShort* char_index;
FT_String** char_name;
FT_UShort* char_index;
const FT_String** char_name;
} T1_EncodingRec, *T1_Encoding;

View file

@ -150,81 +150,6 @@ FT_BEGIN_HEADER
} TT_TableRec, *TT_Table;
/**************************************************************************
*
* @struct:
* WOFF_HeaderRec
*
* @description:
* WOFF file format header.
*
* @fields:
* See
*
* https://www.w3.org/TR/WOFF/#WOFFHeader
*/
typedef struct WOFF_HeaderRec_
{
FT_ULong signature;
FT_ULong flavor;
FT_ULong length;
FT_UShort num_tables;
FT_UShort reserved;
FT_ULong totalSfntSize;
FT_UShort majorVersion;
FT_UShort minorVersion;
FT_ULong metaOffset;
FT_ULong metaLength;
FT_ULong metaOrigLength;
FT_ULong privOffset;
FT_ULong privLength;
} WOFF_HeaderRec, *WOFF_Header;
/**************************************************************************
*
* @struct:
* WOFF_TableRec
*
* @description:
* This structure describes a given table of a WOFF font.
*
* @fields:
* Tag ::
* A four-bytes tag describing the table.
*
* Offset ::
* The offset of the table from the start of the WOFF font in its
* resource.
*
* CompLength ::
* Compressed table length (in bytes).
*
* OrigLength ::
* Uncompressed table length (in bytes).
*
* CheckSum ::
* The table checksum. This value can be ignored.
*
* OrigOffset ::
* The uncompressed table file offset. This value gets computed while
* constructing the (uncompressed) SFNT header. It is not contained in
* the WOFF file.
*/
typedef struct WOFF_TableRec_
{
FT_ULong Tag; /* table ID */
FT_ULong Offset; /* table file offset */
FT_ULong CompLength; /* compressed table length */
FT_ULong OrigLength; /* uncompressed table length */
FT_ULong CheckSum; /* uncompressed checksum */
FT_ULong OrigOffset; /* uncompressed table file offset */
/* (not in the WOFF file) */
} WOFF_TableRec, *WOFF_Table;
/**************************************************************************
*
* @struct:
@ -1395,8 +1320,10 @@ FT_BEGIN_HEADER
*
* cvt ::
* The face's original control value table. Coordinates are expressed
* in unscaled font units. Comes from the 'cvt~' table. Ignored for
* Type 2 fonts.
* in unscaled font units (in 26.6 format). Comes from the 'cvt~'
* table. Ignored for Type 2 fonts.
*
* If varied by the `CVAR' table, non-integer values are possible.
*
* interpreter ::
* A pointer to the TrueType bytecode interpreters field is also used
@ -1633,7 +1560,7 @@ FT_BEGIN_HEADER
/* the original, unscaled, control value table */
FT_ULong cvt_size;
FT_Short* cvt;
FT_Int32* cvt;
/* A pointer to the bytecode interpreter to use. This is also */
/* used to hook the debugger for the `ttdebug' utility. */

View file

@ -0,0 +1,112 @@
/****************************************************************************
*
* wofftypes.h
*
* Basic WOFF/WOFF2 type definitions and interface (specification
* only).
*
* Copyright (C) 1996-2019 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 WOFFTYPES_H_
#define WOFFTYPES_H_
#include <ft2build.h>
#include FT_TRUETYPE_TABLES_H
#include FT_INTERNAL_OBJECTS_H
FT_BEGIN_HEADER
/**************************************************************************
*
* @struct:
* WOFF_HeaderRec
*
* @description:
* WOFF file format header.
*
* @fields:
* See
*
* https://www.w3.org/TR/WOFF/#WOFFHeader
*/
typedef struct WOFF_HeaderRec_
{
FT_ULong signature;
FT_ULong flavor;
FT_ULong length;
FT_UShort num_tables;
FT_UShort reserved;
FT_ULong totalSfntSize;
FT_UShort majorVersion;
FT_UShort minorVersion;
FT_ULong metaOffset;
FT_ULong metaLength;
FT_ULong metaOrigLength;
FT_ULong privOffset;
FT_ULong privLength;
} WOFF_HeaderRec, *WOFF_Header;
/**************************************************************************
*
* @struct:
* WOFF_TableRec
*
* @description:
* This structure describes a given table of a WOFF font.
*
* @fields:
* Tag ::
* A four-bytes tag describing the table.
*
* Offset ::
* The offset of the table from the start of the WOFF font in its
* resource.
*
* CompLength ::
* Compressed table length (in bytes).
*
* OrigLength ::
* Uncompressed table length (in bytes).
*
* CheckSum ::
* The table checksum. This value can be ignored.
*
* OrigOffset ::
* The uncompressed table file offset. This value gets computed while
* constructing the (uncompressed) SFNT header. It is not contained in
* the WOFF file.
*/
typedef struct WOFF_TableRec_
{
FT_ULong Tag; /* table ID */
FT_ULong Offset; /* table file offset */
FT_ULong CompLength; /* compressed table length */
FT_ULong OrigLength; /* uncompressed table length */
FT_ULong CheckSum; /* uncompressed checksum */
FT_ULong OrigOffset; /* uncompressed table file offset */
/* (not in the WOFF file) */
} WOFF_TableRec, *WOFF_Table;
FT_END_HEADER
#endif /* WOFFTYPES_H_ */
/* END */