Copyright notices, formatting, whitespace, minor doc fixes.

This commit is contained in:
Werner Lemberg 2017-09-26 12:53:41 +02:00
parent 4cdbac05b9
commit 12ae57d992
8 changed files with 157 additions and 129 deletions

View File

@ -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.
*

View File

@ -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:

View File

@ -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.

View File

@ -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;

View File

@ -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 <freetype/internal/services/svbdf.h>
#define FT_SERVICE_CFF_TABLE_LOAD_H <freetype/internal/services/svcfftl.h>
#define FT_SERVICE_CID_H <freetype/internal/services/svcid.h>
#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h>
#define FT_SERVICE_GLYPH_DICT_H <freetype/internal/services/svgldict.h>
#define FT_SERVICE_GX_VALIDATE_H <freetype/internal/services/svgxval.h>
#define FT_SERVICE_KERNING_H <freetype/internal/services/svkern.h>
@ -1000,11 +1002,10 @@ FT_BEGIN_HEADER
#define FT_SERVICE_PROPERTIES_H <freetype/internal/services/svprop.h>
#define FT_SERVICE_SFNT_H <freetype/internal/services/svsfnt.h>
#define FT_SERVICE_TRUETYPE_ENGINE_H <freetype/internal/services/svtteng.h>
#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
#define FT_SERVICE_TT_CMAP_H <freetype/internal/services/svttcmap.h>
#define FT_SERVICE_WINFNT_H <freetype/internal/services/svwinfnt.h>
#define FT_SERVICE_FONT_FORMAT_H <freetype/internal/services/svfntfmt.h>
#define FT_SERVICE_TRUETYPE_GLYF_H <freetype/internal/services/svttglyf.h>
#define FT_SERVICE_CFF_TABLE_LOAD_H <freetype/internal/services/svcfftl.h>
/* */
FT_END_HEADER

View File

@ -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 );

View File

@ -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

View File

@ -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 );