Minor formatting.
Adding copyright/C++ guards to psaux files.
This commit is contained in:
parent
24d7024c44
commit
b1c8bf0683
|
@ -1,8 +1,34 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* psaux.h */
|
||||
/* */
|
||||
/* Auxiliary functions and data structures related to PostScript fonts */
|
||||
/* (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2000 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 PSAUX_H
|
||||
#define PSAUX_H
|
||||
|
||||
|
||||
#include <freetype/internal/ftobjs.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -119,7 +145,7 @@
|
|||
{
|
||||
FT_Byte* start; /* first character of token in input stream */
|
||||
FT_Byte* limit; /* first character after the token */
|
||||
T1_Token_Type type; /* type of token.. */
|
||||
T1_Token_Type type; /* type of token */
|
||||
|
||||
} T1_Token;
|
||||
|
||||
|
@ -239,16 +265,17 @@
|
|||
/* T1_Parser */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* A T1_Parser is an object used to parse a Type 1 font very */
|
||||
/* quickly. */
|
||||
/* A T1_Parser is an object used to parse a Type 1 font very quickly. */
|
||||
/* */
|
||||
/* <Fields> */
|
||||
/* cursor :: current position in text. */
|
||||
/* base :: start of processed text. */
|
||||
/* limit :: end of processed text. */
|
||||
/* error :: last error returned. */
|
||||
/* cursor :: The current position in the text. */
|
||||
/* */
|
||||
/* base :: Start of the processed text. */
|
||||
/* */
|
||||
/* limit :: End of the processed text. */
|
||||
/* */
|
||||
/* error :: The last error returned. */
|
||||
/* */
|
||||
|
||||
typedef struct T1_Parser_
|
||||
{
|
||||
FT_Byte* cursor;
|
||||
|
@ -305,7 +332,6 @@
|
|||
} T1_Parser_Funcs;
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -330,10 +356,12 @@
|
|||
/* */
|
||||
/* glyph :: The current glyph slot. */
|
||||
/* */
|
||||
/* current :: The current glyph outline. */
|
||||
/* loader :: XXX */
|
||||
/* */
|
||||
/* base :: The base glyph outline. */
|
||||
/* */
|
||||
/* current :: The current glyph outline. */
|
||||
/* */
|
||||
/* max_points :: maximum points in builder outline */
|
||||
/* */
|
||||
/* max_contours :: Maximal number of contours in builder outline. */
|
||||
|
@ -437,6 +465,7 @@
|
|||
|
||||
} T1_Builder_Funcs;
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -445,8 +474,6 @@
|
|||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
|
||||
typedef struct PSAux_Interface_
|
||||
{
|
||||
const T1_Table_Funcs* t1_table_funcs;
|
||||
|
@ -456,4 +483,11 @@
|
|||
} PSAux_Interface;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* PSAUX_H */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -87,7 +87,6 @@
|
|||
|
||||
typedef struct T1_Font_
|
||||
{
|
||||
|
||||
/* font info dictionary */
|
||||
T1_FontInfo font_info;
|
||||
|
||||
|
|
|
@ -1,6 +1,35 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* psobjs.c */
|
||||
/* */
|
||||
/* Auxiliary functions for PostScript fonts (body). */
|
||||
/* */
|
||||
/* Copyright 1996-2000 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 <freetype/internal/psaux.h>
|
||||
#include <freetype/fterrors.h>
|
||||
|
||||
#ifdef FT_FLAT_COMPILE
|
||||
|
||||
#include "psobjs.h"
|
||||
|
||||
#else
|
||||
|
||||
#include <psaux/psobjs.h>
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -15,7 +44,7 @@
|
|||
/* T1_New_Table */
|
||||
/* */
|
||||
/* <Description> */
|
||||
/* Initialises a T1_Table. */
|
||||
/* Initializes a T1_Table. */
|
||||
/* */
|
||||
/* <InOut> */
|
||||
/* table :: The address of the target table. */
|
||||
|
@ -43,7 +72,7 @@
|
|||
goto Exit;
|
||||
|
||||
table->max_elems = count;
|
||||
table->init = 0xDEADBEEF;
|
||||
table->init = 0xDEADBEEFL;
|
||||
table->num_elems = 0;
|
||||
table->block = 0;
|
||||
table->capacity = 0;
|
||||
|
@ -157,7 +186,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/* */
|
||||
/* <Function> */
|
||||
|
@ -181,7 +209,7 @@
|
|||
FT_Byte* old_base;
|
||||
|
||||
|
||||
/* should never fail, as rec.cursor <= rec.size */
|
||||
/* should never fail, because rec.cursor <= rec.size */
|
||||
old_base = table->block;
|
||||
if ( !old_base )
|
||||
return;
|
||||
|
@ -194,14 +222,13 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
LOCAL_FUNC
|
||||
void T1_Release_Table( T1_Table* table )
|
||||
{
|
||||
FT_Memory memory = table->memory;
|
||||
|
||||
|
||||
if ( table->init == (FT_Long)0xDEADBEEF )
|
||||
if ( table->init == 0xDEADBEEFL )
|
||||
{
|
||||
FREE( table->block );
|
||||
FREE( table->elements );
|
||||
|
@ -211,7 +238,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -220,6 +246,7 @@
|
|||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
|
||||
|
||||
#define IS_T1_WHITESPACE( c ) ( (c) == ' ' || (c) == '\t' )
|
||||
#define IS_T1_LINESPACE( c ) ( (c) == '\r' || (c) == '\n' )
|
||||
|
||||
|
@ -266,7 +293,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
LOCAL_FUNC
|
||||
void T1_ToToken( T1_Parser* parser,
|
||||
T1_Token* token )
|
||||
|
@ -545,7 +571,7 @@
|
|||
if ( cur >= limit )
|
||||
goto Exit;
|
||||
|
||||
/* check for the beginning of an array. If not, only one number will */
|
||||
/* check for the beginning of an array; if not, only one number will */
|
||||
/* be read */
|
||||
c = *cur;
|
||||
ender = 0;
|
||||
|
@ -786,6 +812,7 @@
|
|||
FT_Long val;
|
||||
FT_String* string;
|
||||
|
||||
|
||||
switch ( field->type )
|
||||
{
|
||||
case t1_field_bool:
|
||||
|
@ -824,6 +851,7 @@
|
|||
FT_Memory memory = parser->memory;
|
||||
FT_UInt len = limit-cur;
|
||||
|
||||
|
||||
if ( *(FT_String**)q )
|
||||
/* with synthetic fonts, it's possible to find a field twice */
|
||||
break;
|
||||
|
@ -989,6 +1017,7 @@
|
|||
FT_UNUSED( parser );
|
||||
}
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -1193,6 +1222,7 @@
|
|||
FT_Vector* p1 = outline->points + first;
|
||||
FT_Vector* p2 = outline->points + outline->n_points - 1;
|
||||
|
||||
|
||||
if ( outline->n_contours > 1 )
|
||||
{
|
||||
first = outline->contours[outline->n_contours - 2] + 1;
|
||||
|
@ -1208,7 +1238,6 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -1218,10 +1247,6 @@
|
|||
/*************************************************************************/
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
LOCAL_FUNC
|
||||
void T1_Decrypt( FT_Byte* buffer,
|
||||
FT_Int length,
|
||||
|
@ -1240,5 +1265,4 @@
|
|||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -1,9 +1,32 @@
|
|||
/***************************************************************************/
|
||||
/* */
|
||||
/* psobjs.h */
|
||||
/* */
|
||||
/* Auxiliary functions for PostScript fonts (specification). */
|
||||
/* */
|
||||
/* Copyright 1996-2000 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 PSOBJS_H
|
||||
#define PSOBJS_H
|
||||
|
||||
#include <freetype/internal/psaux.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -31,7 +54,6 @@
|
|||
void T1_Release_Table( T1_Table* table );
|
||||
|
||||
|
||||
|
||||
/*************************************************************************/
|
||||
/*************************************************************************/
|
||||
/***** *****/
|
||||
|
@ -102,12 +124,18 @@
|
|||
void T1_Done_Parser( T1_Parser* parser )
|
||||
|
||||
|
||||
|
||||
LOCAL_DEF
|
||||
void T1_Decrypt( FT_Byte* buffer,
|
||||
FT_Int length,
|
||||
FT_UShort seed );
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* PSOBJS_H */
|
||||
|
||||
|
||||
/* END */
|
||||
|
|
|
@ -1080,14 +1080,14 @@
|
|||
(void)Z1_ToFixedArray( parser, 6, temp, 3 );
|
||||
|
||||
/* we need to scale the values by 1.0/temp[3] */
|
||||
if ( temp[3] != 0x10000 )
|
||||
if ( temp[3] != 0x10000L )
|
||||
{
|
||||
temp[0] = FT_DivFix( temp[0], temp[3] );
|
||||
temp[1] = FT_DivFix( temp[1], temp[3] );
|
||||
temp[2] = FT_DivFix( temp[2], temp[3] );
|
||||
temp[4] = FT_DivFix( temp[4], temp[3] );
|
||||
temp[5] = FT_DivFix( temp[5], temp[3] );
|
||||
temp[3] = 0x10000;
|
||||
temp[3] = 0x10000L;
|
||||
}
|
||||
|
||||
matrix->xx = temp[0];
|
||||
|
|
Loading…
Reference in New Issue