[base,cff,cid] Whitespace, formatting.

This commit is contained in:
Werner Lemberg 2017-09-30 16:36:28 +02:00
parent 2127f07624
commit 9b549fa69a
7 changed files with 60 additions and 52 deletions

View File

@ -337,11 +337,11 @@
FT_Pixel_Mode pixel_mode;
FT_BBox cbox;
FT_Pos x_shift = 0;
FT_Pos y_shift = 0;
FT_Pos x_left, y_top;
FT_Pos width, height, pitch;
FT_BBox cbox;
FT_Pos x_shift = 0;
FT_Pos y_shift = 0;
FT_Pos x_left, y_top;
FT_Pos width, height, pitch;
if ( slot->internal && ( slot->internal->flags & FT_GLYPH_OWN_BITMAP ) )
@ -353,8 +353,8 @@
y_shift = origin->y;
}
/* compute the control box, and grid fit it */
/* taking into account the origin shift */
/* compute the control box, and grid-fit it, */
/* taking into account the origin shift */
FT_Outline_Get_CBox( outline, &cbox );
cbox.xMin += x_shift;
@ -422,8 +422,8 @@
x_shift -= cbox.xMin;
y_shift -= cbox.yMin;
x_left = cbox.xMin >> 6;
y_top = cbox.yMax >> 6;
x_left = cbox.xMin >> 6;
y_top = cbox.yMax >> 6;
width = ( (FT_ULong)cbox.xMax - (FT_ULong)cbox.xMin ) >> 6;
height = ( (FT_ULong)cbox.yMax - (FT_ULong)cbox.yMin ) >> 6;
@ -431,15 +431,18 @@
switch ( pixel_mode )
{
case FT_PIXEL_MODE_MONO:
pitch = ( ( width + 15 ) >> 4 ) << 1;
pitch = ( ( width + 15 ) >> 4 ) << 1;
break;
case FT_PIXEL_MODE_LCD:
width *= 3;
pitch = FT_PAD_CEIL( width, 4 );
break;
case FT_PIXEL_MODE_LCD_V:
height *= 3;
/* fall through */
case FT_PIXEL_MODE_GRAY:
default:
pitch = width;

View File

@ -744,8 +744,8 @@
const void* value,
FT_Bool value_is_string )
{
FT_Error error = FT_Err_Ok;
PS_Driver driver = (PS_Driver)module;
FT_Error error = FT_Err_Ok;
PS_Driver driver = (PS_Driver)module;
#ifndef FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES
FT_UNUSED( value_is_string );
@ -910,8 +910,8 @@
const char* property_name,
const void* value )
{
FT_Error error = FT_Err_Ok;
PS_Driver driver = (PS_Driver)module;
FT_Error error = FT_Err_Ok;
PS_Driver driver = (PS_Driver)module;
if ( !ft_strcmp( property_name, "darkening-parameters" ) )
@ -1099,13 +1099,14 @@
FT_DEFINE_SERVICE_CFFLOADREC(
cff_service_cff_load,
(FT_Get_Standard_Encoding_Func) cff_get_standard_encoding,
(FT_Load_Private_Dict_Func) cff_load_private_dict,
(FT_FD_Select_Get_Func) cff_fd_select_get,
(FT_Blend_Check_Vector_Func) cff_blend_check_vector,
(FT_Blend_Build_Vector_Func) cff_blend_build_vector
(FT_Get_Standard_Encoding_Func)cff_get_standard_encoding,
(FT_Load_Private_Dict_Func) cff_load_private_dict,
(FT_FD_Select_Get_Func) cff_fd_select_get,
(FT_Blend_Check_Vector_Func) cff_blend_check_vector,
(FT_Blend_Build_Vector_Func) cff_blend_build_vector
)
/*************************************************************************/
/*************************************************************************/
/*************************************************************************/

View File

@ -145,6 +145,7 @@
PSAux_Service psaux = (PSAux_Service)face->psaux;
const CFF_Decoder_Funcs decoder_funcs = psaux->cff_decoder_funcs;
*max_advance = 0;
/* Initialize load decoder */

View File

@ -2097,7 +2097,8 @@
do
{
face->root.internal->random_seed =
(FT_Int32)psaux->cff_random( (FT_UInt32)face->root.internal->random_seed );
(FT_Int32)psaux->cff_random(
(FT_UInt32)face->root.internal->random_seed );
} while ( face->root.internal->random_seed < 0 );
}

View File

@ -504,8 +504,8 @@
FT_Library library = cffface->driver->root.library;
sfnt = (SFNT_Service)FT_Get_Module_Interface(
library, "sfnt" );
sfnt = (SFNT_Service)FT_Get_Module_Interface( library,
"sfnt" );
if ( !sfnt )
{
FT_ERROR(( "cff_face_init: cannot access `sfnt' module\n" ));
@ -515,11 +515,11 @@
FT_FACE_FIND_GLOBAL_SERVICE( face, psnames, POSTSCRIPT_CMAPS );
pshinter = (PSHinter_Service)FT_Get_Module_Interface(
library, "pshinter" );
pshinter = (PSHinter_Service)FT_Get_Module_Interface( library,
"pshinter" );
psaux = (PSAux_Service)FT_Get_Module_Interface(
library, "psaux" );
psaux = (PSAux_Service)FT_Get_Module_Interface( library,
"psaux" );
if ( !psaux )
{
FT_ERROR(( "cff_face_init: cannot access `psaux' module\n" ));

View File

@ -1303,12 +1303,11 @@
PSAux_Service psaux;
#endif
FT_Byte* p = start;
FT_Error error = FT_Err_Ok;
FT_Library library = parser->library;
FT_UNUSED( library );
FT_UNUSED( library );
parser->top = parser->stack;
@ -1394,8 +1393,7 @@
cff_rec.top_font.font_dict.num_axes = parser->num_axes;
decoder.cff = &cff_rec;
psaux = (PSAux_Service)FT_Get_Module_Interface(
library, "psaux" );
psaux = (PSAux_Service)FT_Get_Module_Interface( library, "psaux" );
if ( !psaux )
{
FT_ERROR(( "cff_parser_run: cannot access `psaux' module\n" ));
@ -1403,10 +1401,8 @@
goto Exit;
}
error = psaux->cff_decoder_funcs->parse_charstrings_old( &decoder,
charstring_base,
charstring_len,
1 );
error = psaux->cff_decoder_funcs->parse_charstrings_old(
&decoder, charstring_base, charstring_len, 1 );
/* Now copy the stack data in the temporary decoder object, */
/* converting it back to charstring number representations */

View File

@ -56,11 +56,11 @@
FT_ULong glyph_length = 0;
PSAux_Service psaux = (PSAux_Service)face->psaux;
FT_Bool force_scaling = FALSE;
FT_Bool force_scaling = FALSE;
#ifdef FT_CONFIG_OPTION_INCREMENTAL
FT_Incremental_InterfaceRec *inc =
face->root.internal->incremental_interface;
FT_Incremental_InterfaceRec *inc =
face->root.internal->incremental_interface;
#endif
@ -176,11 +176,13 @@
psaux->t1_decrypt( charstring, glyph_length, 4330 );
/* choose which renderer to use */
if ( ((PS_Driver)FT_FACE_DRIVER( face ))->hinting_engine == FT_T1_HINTING_FREETYPE ||
decoder->builder.metrics_only )
error = psaux->t1_decoder_funcs->parse_charstrings_old( decoder,
charstring + cs_offset,
glyph_length - cs_offset );
if ( ( (PS_Driver)FT_FACE_DRIVER( face ) )->hinting_engine ==
FT_T1_HINTING_FREETYPE ||
decoder->builder.metrics_only )
error = psaux->t1_decoder_funcs->parse_charstrings_old(
decoder,
charstring + cs_offset,
glyph_length - cs_offset );
else
{
PS_Decoder psdecoder;
@ -189,12 +191,15 @@
psaux->ps_decoder_init( &psdecoder, decoder, TRUE );
psaux->t1_make_subfont( FT_FACE( face ), &dict->private_dict, &subfont );
psaux->t1_make_subfont( FT_FACE( face ),
&dict->private_dict,
&subfont );
psdecoder.current_subfont = &subfont;
error = psaux->t1_decoder_funcs->parse_charstrings( &psdecoder,
charstring + cs_offset,
glyph_length - cs_offset );
error = psaux->t1_decoder_funcs->parse_charstrings(
&psdecoder,
charstring + cs_offset,
glyph_length - cs_offset );
/* Adobe's engine uses 16.16 numbers everywhere; */
/* as a consequence, glyphs larger than 2000ppem get rejected */
@ -207,9 +212,10 @@
force_scaling = TRUE;
error = psaux->t1_decoder_funcs->parse_charstrings( &psdecoder,
charstring + cs_offset,
glyph_length - cs_offset );
error = psaux->t1_decoder_funcs->parse_charstrings(
&psdecoder,
charstring + cs_offset,
glyph_length - cs_offset );
}
}
}
@ -386,9 +392,9 @@
if ( error )
goto Exit;
/* Copy flags back for forced scaling */
hinting = glyph->hint;
scaled = glyph->scaled;
/* copy flags back for forced scaling */
hinting = glyph->hint;
scaled = glyph->scaled;
font_matrix = decoder.font_matrix;
font_offset = decoder.font_offset;