diff --git a/include/freetype/ftpcfdrv.h b/include/freetype/ftpcfdrv.h index c9d5cedec..7f602991c 100644 --- a/include/freetype/ftpcfdrv.h +++ b/include/freetype/ftpcfdrv.h @@ -69,7 +69,7 @@ FT_BEGIN_HEADER * selecting `Fixed' in KDE or Gnome one gets results that appear rather * random, the style changes often if one changes the size and one * cannot select some fonts at all. The improve this situation, the PCF - * module prepends the foundry name (plus a space) to the family name. + * module prepends the foundry name (plus a space) to the family name. * It also checks whether there are `wide' characters; all put together, * family names like `Sony Fixed' or `Misc Fixed Wide' are constructed. * diff --git a/include/freetype/ftt1drv.h b/include/freetype/ftt1drv.h index 116b33b05..e082f6b4a 100644 --- a/include/freetype/ftt1drv.h +++ b/include/freetype/ftt1drv.h @@ -4,7 +4,7 @@ /* */ /* FreeType API for controlling the Type 1 driver (specification only). */ /* */ -/* Copyright 2013-2017 by */ +/* Copyright 2017 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -32,7 +32,6 @@ FT_BEGIN_HEADER - /************************************************************************** * * @property: @@ -66,6 +65,10 @@ FT_BEGIN_HEADER * * This property can be set via the `FREETYPE_PROPERTIES' environment * variable (using values `adobe' or `freetype'). + * + * @since: + * 2.8.2 + * */ @@ -85,10 +88,14 @@ FT_BEGIN_HEADER * FT_T1_HINTING_ADOBE :: * Use the hinting engine contributed by Adobe. * + * @since: + * 2.8.2 + * */ #define FT_T1_HINTING_FREETYPE 0 #define FT_T1_HINTING_ADOBE 1 + /************************************************************************** * * @constant: diff --git a/include/freetype/ftttdrv.h b/include/freetype/ftttdrv.h index 381eee7e6..f97c70a2b 100644 --- a/include/freetype/ftttdrv.h +++ b/include/freetype/ftttdrv.h @@ -155,7 +155,7 @@ FT_BEGIN_HEADER * * Details on subpixel hinting and some of the necessary tweaks can be * found in Greg Hitchcock's whitepaper at - * `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'. + * `http://www.microsoft.com/typography/cleartype/truetypecleartype.aspx'. * Note that FreeType currently doesn't really `subpixel hint' (6x1, 6x2, * or 6x5 supersampling) like discussed in the paper. Depending on the * chosen interpreter, it simply ignores instructions on vertical stems @@ -216,7 +216,7 @@ FT_BEGIN_HEADER * TT_INTERPRETER_VERSION_40 :: * Version~40 corresponds to MS rasterizer v.2.1; it is roughly * equivalent to the hinting provided by DirectWrite ClearType (as can - * be found, for example, in Microsoft's Edge Browser on Windows~10). + * be found, for example, in Microsoft's Edge Browser on Windows~10). * It is used in FreeType to select the `minimal' subpixel hinting * code, a stripped-down and higher performance version of the * `Infinality' code. diff --git a/include/freetype/internal/cffotypes.h b/include/freetype/internal/cffotypes.h index 570a92edf..6fd1e1c7a 100644 --- a/include/freetype/internal/cffotypes.h +++ b/include/freetype/internal/cffotypes.h @@ -4,7 +4,14 @@ /* */ /* Basic OpenType/CFF object type definitions (specification). */ /* */ -/* Copyright notice here. */ +/* Copyright 2017 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. */ /* */ /***************************************************************************/ @@ -54,11 +61,11 @@ FT_BEGIN_HEADER { FT_GlyphSlotRec root; - FT_Bool hint; - FT_Bool scaled; + FT_Bool hint; + FT_Bool scaled; - FT_Fixed x_scale; - FT_Fixed y_scale; + FT_Fixed x_scale; + FT_Fixed y_scale; } CFF_GlyphSlotRec, *CFF_GlyphSlot; @@ -87,7 +94,7 @@ FT_BEGIN_HEADER { FT_Fixed xx, xy; /* transformation matrix coefficients */ FT_Fixed yx, yy; - FT_F26Dot6 ox, oy; /* offsets */ + FT_F26Dot6 ox, oy; /* offsets */ } CFF_Transform; diff --git a/include/freetype/internal/ftserv.h b/include/freetype/internal/ftserv.h index 23f2878cc..5d95ee52c 100644 --- a/include/freetype/internal/ftserv.h +++ b/include/freetype/internal/ftserv.h @@ -815,26 +815,26 @@ FT_BEGIN_HEADER if ( FT_ALLOC( clazz, sizeof ( *clazz ) * 11 ) ) \ return error; \ \ - clazz[0].serv_id = serv_id_1; \ - clazz[0].serv_data = serv_data_1; \ - clazz[1].serv_id = serv_id_2; \ - clazz[1].serv_data = serv_data_2; \ - clazz[2].serv_id = serv_id_3; \ - clazz[2].serv_data = serv_data_3; \ - clazz[3].serv_id = serv_id_4; \ - clazz[3].serv_data = serv_data_4; \ - clazz[4].serv_id = serv_id_5; \ - clazz[4].serv_data = serv_data_5; \ - clazz[5].serv_id = serv_id_6; \ - clazz[5].serv_data = serv_data_6; \ - clazz[6].serv_id = serv_id_7; \ - clazz[6].serv_data = serv_data_7; \ - clazz[7].serv_id = serv_id_8; \ - clazz[7].serv_data = serv_data_8; \ - clazz[8].serv_id = serv_id_9; \ - clazz[8].serv_data = serv_data_9; \ - clazz[9].serv_id = serv_id_10; \ - clazz[9].serv_data = serv_data_10; \ + clazz[ 0].serv_id = serv_id_1; \ + clazz[ 0].serv_data = serv_data_1; \ + clazz[ 1].serv_id = serv_id_2; \ + clazz[ 1].serv_data = serv_data_2; \ + clazz[ 2].serv_id = serv_id_3; \ + clazz[ 2].serv_data = serv_data_3; \ + clazz[ 3].serv_id = serv_id_4; \ + clazz[ 3].serv_data = serv_data_4; \ + clazz[ 4].serv_id = serv_id_5; \ + clazz[ 4].serv_data = serv_data_5; \ + clazz[ 5].serv_id = serv_id_6; \ + clazz[ 5].serv_data = serv_data_6; \ + clazz[ 6].serv_id = serv_id_7; \ + clazz[ 6].serv_data = serv_data_7; \ + clazz[ 7].serv_id = serv_id_8; \ + clazz[ 7].serv_data = serv_data_8; \ + clazz[ 8].serv_id = serv_id_9; \ + clazz[ 8].serv_data = serv_data_9; \ + clazz[ 9].serv_id = serv_id_10; \ + clazz[ 9].serv_data = serv_data_10; \ clazz[10].serv_id = NULL; \ clazz[10].serv_data = NULL; \ \ @@ -986,7 +986,9 @@ FT_BEGIN_HEADER */ #define FT_SERVICE_BDF_H +#define FT_SERVICE_CFF_TABLE_LOAD_H #define FT_SERVICE_CID_H +#define FT_SERVICE_FONT_FORMAT_H #define FT_SERVICE_GLYPH_DICT_H #define FT_SERVICE_GX_VALIDATE_H #define FT_SERVICE_KERNING_H @@ -1000,11 +1002,10 @@ FT_BEGIN_HEADER #define FT_SERVICE_PROPERTIES_H #define FT_SERVICE_SFNT_H #define FT_SERVICE_TRUETYPE_ENGINE_H +#define FT_SERVICE_TRUETYPE_GLYF_H #define FT_SERVICE_TT_CMAP_H #define FT_SERVICE_WINFNT_H -#define FT_SERVICE_FONT_FORMAT_H -#define FT_SERVICE_TRUETYPE_GLYF_H -#define FT_SERVICE_CFF_TABLE_LOAD_H + /* */ FT_END_HEADER diff --git a/include/freetype/internal/psaux.h b/include/freetype/internal/psaux.h index 25535475a..46c238a5c 100644 --- a/include/freetype/internal/psaux.h +++ b/include/freetype/internal/psaux.h @@ -467,6 +467,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /*************************************************************************/ + typedef struct PS_Builder_ PS_Builder; typedef const struct PS_Builder_FuncsRec_* PS_Builder_Funcs; @@ -478,7 +479,7 @@ FT_BEGIN_HEADER FT_Bool is_t1 ); void - (*done)( PS_Builder* builder ); + (*done)( PS_Builder* builder ); } PS_Builder_FuncsRec; @@ -524,6 +525,8 @@ FT_BEGIN_HEADER /* the metrics of a given glyph, not load all of its */ /* points. */ /* */ + /* is_t1 :: Set if current font type is Type 1. */ + /* */ /* funcs :: An array of function pointers for the builder. */ /* */ struct PS_Builder_ @@ -535,20 +538,19 @@ FT_BEGIN_HEADER FT_Outline* base; FT_Outline* current; - FT_Pos* pos_x; - FT_Pos* pos_y; + FT_Pos* pos_x; + FT_Pos* pos_y; - FT_Vector* left_bearing; - FT_Vector* advance; + FT_Vector* left_bearing; + FT_Vector* advance; - FT_BBox* bbox; /* bounding box */ - FT_Bool path_begun; - FT_Bool load_points; - FT_Bool no_recurse; + FT_BBox* bbox; /* bounding box */ + FT_Bool path_begun; + FT_Bool load_points; + FT_Bool no_recurse; - FT_Bool metrics_only; - - FT_Bool is_t1; + FT_Bool metrics_only; + FT_Bool is_t1; PS_Builder_FuncsRec funcs; @@ -596,64 +598,64 @@ FT_BEGIN_HEADER typedef struct PS_Decoder_ { - PS_Builder builder; + PS_Builder builder; - FT_Fixed stack[PS_MAX_OPERANDS + 1]; - FT_Fixed* top; + FT_Fixed stack[PS_MAX_OPERANDS + 1]; + FT_Fixed* top; - PS_Decoder_Zone zones[PS_MAX_SUBRS_CALLS + 1]; - PS_Decoder_Zone* zone; + PS_Decoder_Zone zones[PS_MAX_SUBRS_CALLS + 1]; + PS_Decoder_Zone* zone; - FT_Int flex_state; - FT_Int num_flex_vectors; - FT_Vector flex_vectors[7]; + FT_Int flex_state; + FT_Int num_flex_vectors; + FT_Vector flex_vectors[7]; - CFF_Font cff; - CFF_SubFont current_subfont; /* for current glyph_index */ - FT_Generic* cf2_instance; + CFF_Font cff; + CFF_SubFont current_subfont; /* for current glyph_index */ + FT_Generic* cf2_instance; - FT_Pos glyph_width; - FT_Pos nominal_width; + FT_Pos glyph_width; + FT_Pos nominal_width; - FT_Bool read_width; - FT_Bool width_only; - FT_Int num_hints; + FT_Bool read_width; + FT_Bool width_only; + FT_Int num_hints; - FT_UInt num_locals; - FT_UInt num_globals; + FT_UInt num_locals; + FT_UInt num_globals; - FT_Int locals_bias; - FT_Int globals_bias; + FT_Int locals_bias; + FT_Int globals_bias; - FT_Byte** locals; - FT_Byte** globals; + FT_Byte** locals; + FT_Byte** globals; - FT_Byte** glyph_names; /* for pure CFF fonts only */ - FT_UInt num_glyphs; /* number of glyphs in font */ + FT_Byte** glyph_names; /* for pure CFF fonts only */ + FT_UInt num_glyphs; /* number of glyphs in font */ - FT_Render_Mode hint_mode; + FT_Render_Mode hint_mode; - FT_Bool seac; + FT_Bool seac; CFF_Decoder_Get_Glyph_Callback get_glyph_callback; CFF_Decoder_Free_Glyph_Callback free_glyph_callback; /* Type 1 stuff */ - FT_Service_PsCMaps psnames; /* for seac */ + FT_Service_PsCMaps psnames; /* for seac */ - FT_Int lenIV; /* internal for sub routine calls */ - FT_UInt* locals_len; /* array of subrs length (optional) */ - FT_Hash locals_hash; /* used if `num_subrs' was massaged */ + FT_Int lenIV; /* internal for sub routine calls */ + FT_UInt* locals_len; /* array of subrs length (optional) */ + FT_Hash locals_hash; /* used if `num_subrs' was massaged */ - FT_Matrix font_matrix; - FT_Vector font_offset; + FT_Matrix font_matrix; + FT_Vector font_offset; - PS_Blend blend; /* for multiple master support */ + PS_Blend blend; /* for multiple master support */ - FT_Long* buildchar; - FT_UInt len_buildchar; + FT_Long* buildchar; + FT_UInt len_buildchar; - void* t1_parse_callback; + void* t1_parse_callback; } PS_Decoder; @@ -929,6 +931,7 @@ FT_BEGIN_HEADER } T1_DecoderRec; + /*************************************************************************/ /*************************************************************************/ /***** *****/ @@ -938,7 +941,7 @@ FT_BEGIN_HEADER /*************************************************************************/ - typedef struct CFF_Builder_ CFF_Builder; + typedef struct CFF_Builder_ CFF_Builder; typedef FT_Error @@ -1033,6 +1036,8 @@ FT_BEGIN_HEADER /* */ /* hints_globals :: Auxiliary pointer for hinting. */ /* */ + /* funcs :: A table of method pointers for this object. */ + /* */ struct CFF_Builder_ { FT_Memory memory; @@ -1042,24 +1047,24 @@ FT_BEGIN_HEADER FT_Outline* base; FT_Outline* current; - FT_Pos pos_x; - FT_Pos pos_y; + FT_Pos pos_x; + FT_Pos pos_y; - FT_Vector left_bearing; - FT_Vector advance; + FT_Vector left_bearing; + FT_Vector advance; - FT_BBox bbox; /* bounding box */ - FT_Bool path_begun; - FT_Bool load_points; - FT_Bool no_recurse; + FT_BBox bbox; /* bounding box */ - FT_Bool metrics_only; + FT_Bool path_begun; + FT_Bool load_points; + FT_Bool no_recurse; - void* hints_funcs; /* hinter-specific */ - void* hints_globals; /* hinter-specific */ + FT_Bool metrics_only; + + void* hints_funcs; /* hinter-specific */ + void* hints_globals; /* hinter-specific */ CFF_Builder_FuncsRec funcs; - }; @@ -1071,6 +1076,7 @@ FT_BEGIN_HEADER /*************************************************************************/ /*************************************************************************/ + #define CFF_MAX_OPERANDS 48 #define CFF_MAX_SUBRS_CALLS 16 /* maximum subroutine nesting; */ /* only 10 are allowed but there exist */ @@ -1093,61 +1099,62 @@ FT_BEGIN_HEADER typedef struct CFF_Decoder_ { - CFF_Builder builder; - CFF_Font cff; + CFF_Builder builder; + CFF_Font cff; - FT_Fixed stack[CFF_MAX_OPERANDS + 1]; - FT_Fixed* top; + FT_Fixed stack[CFF_MAX_OPERANDS + 1]; + FT_Fixed* top; CFF_Decoder_Zone zones[CFF_MAX_SUBRS_CALLS + 1]; CFF_Decoder_Zone* zone; - FT_Int flex_state; - FT_Int num_flex_vectors; - FT_Vector flex_vectors[7]; + FT_Int flex_state; + FT_Int num_flex_vectors; + FT_Vector flex_vectors[7]; - FT_Pos glyph_width; - FT_Pos nominal_width; + FT_Pos glyph_width; + FT_Pos nominal_width; - FT_Bool read_width; - FT_Bool width_only; - FT_Int num_hints; - FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS]; + FT_Bool read_width; + FT_Bool width_only; + FT_Int num_hints; + FT_Fixed buildchar[CFF_MAX_TRANS_ELEMENTS]; - FT_UInt num_locals; - FT_UInt num_globals; + FT_UInt num_locals; + FT_UInt num_globals; - FT_Int locals_bias; - FT_Int globals_bias; + FT_Int locals_bias; + FT_Int globals_bias; - FT_Byte** locals; - FT_Byte** globals; + FT_Byte** locals; + FT_Byte** globals; - FT_Byte** glyph_names; /* for pure CFF fonts only */ - FT_UInt num_glyphs; /* number of glyphs in font */ + FT_Byte** glyph_names; /* for pure CFF fonts only */ + FT_UInt num_glyphs; /* number of glyphs in font */ - FT_Render_Mode hint_mode; + FT_Render_Mode hint_mode; - FT_Bool seac; + FT_Bool seac; - CFF_SubFont current_subfont; /* for current glyph_index */ + CFF_SubFont current_subfont; /* for current glyph_index */ CFF_Decoder_Get_Glyph_Callback get_glyph_callback; CFF_Decoder_Free_Glyph_Callback free_glyph_callback; } CFF_Decoder; + typedef const struct CFF_Decoder_FuncsRec_* CFF_Decoder_Funcs; typedef struct CFF_Decoder_FuncsRec_ { void - (*init)( CFF_Decoder* decoder, - TT_Face face, - CFF_Size size, - CFF_GlyphSlot slot, - FT_Bool hinting, - FT_Render_Mode hint_mode, + (*init)( CFF_Decoder* decoder, + TT_Face face, + CFF_Size size, + CFF_GlyphSlot slot, + FT_Bool hinting, + FT_Render_Mode hint_mode, CFF_Decoder_Get_Glyph_Callback get_callback, CFF_Decoder_Free_Glyph_Callback free_callback ); diff --git a/include/freetype/internal/services/svcfftl.h b/include/freetype/internal/services/svcfftl.h index a47debf1f..851bcde3a 100644 --- a/include/freetype/internal/services/svcfftl.h +++ b/include/freetype/internal/services/svcfftl.h @@ -4,7 +4,14 @@ /* */ /* The FreeType CFF tables loader service (specification). */ /* */ -/* Copyright notice here */ +/* Copyright 2017 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. */ /* */ /***************************************************************************/ @@ -96,10 +103,9 @@ FT_BEGIN_HEADER #endif /* FT_CONFIG_OPTION_PIC */ - - FT_END_HEADER + #endif diff --git a/src/psaux/psobjs.h b/src/psaux/psobjs.h index e1f72407a..08fd4fc7f 100644 --- a/src/psaux/psobjs.h +++ b/src/psaux/psobjs.h @@ -245,7 +245,7 @@ FT_BEGIN_HEADER ps_builder_init( PS_Builder* ps_builder, void* builder, FT_Bool is_t1 ); - + FT_LOCAL( void ) ps_builder_done( PS_Builder* builder );