From: <ai...@us...> - 2010-04-28 06:58:48
|
Revision: 10940 http://plplot.svn.sourceforge.net/plplot/?rev=10940&view=rev Author: airwin Date: 2010-04-28 06:58:38 +0000 (Wed, 28 Apr 2010) Log Message: ----------- Style recent changes. Modified Paths: -------------- trunk/drivers/pdf.c trunk/drivers/pstex.c trunk/include/plfci-type1.h trunk/src/plcore.c trunk/src/plstripc.c trunk/src/plsym.c Modified: trunk/drivers/pdf.c =================================================================== --- trunk/drivers/pdf.c 2010-04-27 21:53:09 UTC (rev 10939) +++ trunk/drivers/pdf.c 2010-04-28 06:58:38 UTC (rev 10940) @@ -553,26 +553,25 @@ // fci = 0 is a special value indicating the Type 1 Symbol font // is desired. This value cannot be confused with a normal FCI value // because it doesn't have the PL_FCI_MARK. - if ( fci == 0) + if ( fci == 0 ) { - font = "Symbol"; - dev->nlookup = number_of_entries_in_unicode_to_symbol_table; - dev->lookup = unicode_to_symbol_lookup_table; - dev->if_symbol_font = 1; + font = "Symbol"; + dev->nlookup = number_of_entries_in_unicode_to_symbol_table; + dev->lookup = unicode_to_symbol_lookup_table; + dev->if_symbol_font = 1; } else { - /* convert the fci to Base14/Type1 font information */ - font = plP_FCI2FontName( fci, Type1Lookup, N_Type1Lookup ); - dev->nlookup = number_of_entries_in_unicode_to_standard_table; - dev->lookup = unicode_to_standard_lookup_table; - dev->if_symbol_font = 0; + /* convert the fci to Base14/Type1 font information */ + font = plP_FCI2FontName( fci, Type1Lookup, N_Type1Lookup ); + dev->nlookup = number_of_entries_in_unicode_to_standard_table; + dev->lookup = unicode_to_standard_lookup_table; + dev->if_symbol_font = 0; } if ( !( dev->m_font = HPDF_GetFont( dev->pdf, font, NULL ) ) ) plexit( "ERROR: Couldn't open font\n" ); HPDF_Page_SetFontAndSize( dev->page, dev->m_font, dev->fontSize * dev->fontScale ); - } @@ -612,106 +611,106 @@ if ( ucs4[i] != (PLUNICODE) plplotEsc ) /* a character to display */ { type1_string[s] = plunicode2type1( ucs4[i], dev->lookup, dev->nlookup ); - if(ucs4[i] != ' ' && type1_string[s] == ' ') + if ( ucs4[i] != ' ' && type1_string[s] == ' ' ) { - // failed lookup - if(! dev->if_symbol_font) - { - // failed standard font lookup. Try "last chance" - // symbol font instead. - type1_string[s] = '\0'; - PSDrawTextToCanvas( dev, type1_string, drawText ); - s = 0; - last_chance = 1; - PSSetFont( dev, 0 ); - continue; - } - else if(!last_chance) - { - // failed symbol font lookup that is not right - // after a failed standard font lookup (i.e., - // last_change = 0). Try standard fonts lookup instead. - type1_string[s] = '\0'; - PSDrawTextToCanvas( dev, type1_string, drawText ); - s = 0; - last_chance = 0; - PSSetFont( dev, fci ); - continue; - } - else - { - // failed "last_chance" symbol font lookup that - // has occurred right after a failed standard - // fonts lookup. Just accept blank result and - // move on using standard fonts. - PSDrawTextToCanvas( dev, type1_string, drawText ); - s = 0; - last_chance = 0; - PSSetFont( dev, fci ); - i++; - continue; - } + // failed lookup + if ( !dev->if_symbol_font ) + { + // failed standard font lookup. Try "last chance" + // symbol font instead. + type1_string[s] = '\0'; + PSDrawTextToCanvas( dev, type1_string, drawText ); + s = 0; + last_chance = 1; + PSSetFont( dev, 0 ); + continue; + } + else if ( !last_chance ) + { + // failed symbol font lookup that is not right + // after a failed standard font lookup (i.e., + // last_change = 0). Try standard fonts lookup instead. + type1_string[s] = '\0'; + PSDrawTextToCanvas( dev, type1_string, drawText ); + s = 0; + last_chance = 0; + PSSetFont( dev, fci ); + continue; + } + else + { + // failed "last_chance" symbol font lookup that + // has occurred right after a failed standard + // fonts lookup. Just accept blank result and + // move on using standard fonts. + PSDrawTextToCanvas( dev, type1_string, drawText ); + s = 0; + last_chance = 0; + PSSetFont( dev, fci ); + i++; + continue; + } } else { - // font lookup succeeded. - s++; - i++; - last_chance = 0; - continue; + // font lookup succeeded. + s++; + i++; + last_chance = 0; + continue; } } i++; if ( ucs4[i] == (PLUNICODE) plplotEsc ) /* a escape character to display */ { type1_string[s] = plunicode2type1( ucs4[i], dev->lookup, dev->nlookup ); - if(ucs4[i] != ' ' && type1_string[s] == ' ') + if ( ucs4[i] != ' ' && type1_string[s] == ' ' ) { - // failed lookup - if(! dev->if_symbol_font) - { - // failed standard font lookup. Try "last chance" - // symbol font instead. - type1_string[s] = '\0'; - PSDrawTextToCanvas( dev, type1_string, drawText ); - s = 0; - last_chance = 1; - PSSetFont( dev, 0 ); - continue; - } - else if(!last_chance) - { - // failed symbol font lookup that is not right - // after a failed standard font lookup (i.e., - // last_change = 0). Try standard fonts lookup instead. - type1_string[s] = '\0'; - PSDrawTextToCanvas( dev, type1_string, drawText ); - s = 0; - last_chance = 0; - PSSetFont( dev, fci ); - continue; - } - else - { - // failed "last_chance" symbol font lookup that - // has occurred right after a failed standard - // fonts lookup. Just accept blank result and - // move on using standard fonts. - PSDrawTextToCanvas( dev, type1_string, drawText ); - s = 0; - last_chance = 0; - PSSetFont( dev, fci ); - i++; - continue; - } + // failed lookup + if ( !dev->if_symbol_font ) + { + // failed standard font lookup. Try "last chance" + // symbol font instead. + type1_string[s] = '\0'; + PSDrawTextToCanvas( dev, type1_string, drawText ); + s = 0; + last_chance = 1; + PSSetFont( dev, 0 ); + continue; + } + else if ( !last_chance ) + { + // failed symbol font lookup that is not right + // after a failed standard font lookup (i.e., + // last_change = 0). Try standard fonts lookup instead. + type1_string[s] = '\0'; + PSDrawTextToCanvas( dev, type1_string, drawText ); + s = 0; + last_chance = 0; + PSSetFont( dev, fci ); + continue; + } + else + { + // failed "last_chance" symbol font lookup that + // has occurred right after a failed standard + // fonts lookup. Just accept blank result and + // move on using standard fonts. + PSDrawTextToCanvas( dev, type1_string, drawText ); + s = 0; + last_chance = 0; + PSSetFont( dev, fci ); + i++; + continue; + } } else { - // font lookup succeeded. - s++; - i++; - last_chance = 0; - continue; + // font lookup succeeded. + s++; + i++; + last_chance = 0; + continue; } } else Modified: trunk/drivers/pstex.c =================================================================== --- trunk/drivers/pstex.c 2010-04-27 21:53:09 UTC (rev 10939) +++ trunk/drivers/pstex.c 2010-04-28 06:58:38 UTC (rev 10940) @@ -51,10 +51,10 @@ void plD_init_pstex( PLStream *pls ) { - char *ofile; + char *ofile; size_t len; - PSDev *dev; - FILE *fp; + PSDev *dev; + FILE *fp; plParseDrvOpts( pstex_options ); if ( color ) @@ -68,10 +68,10 @@ pls->dev_unicode = 0; /* don't want unicode */ /* open latex output file */ - len = strlen( pls->FileName ) + 3; - ofile = (char *) malloc( sizeof( char )*len ); + len = strlen( pls->FileName ) + 3; + ofile = (char *) malloc( sizeof ( char ) * len ); snprintf( ofile, len, "%s_t", pls->FileName ); - fp = fopen( ofile, "w" ); + fp = fopen( ofile, "w" ); free( ofile ); dev->fp = fp; Modified: trunk/include/plfci-type1.h =================================================================== --- trunk/include/plfci-type1.h 2010-04-27 21:53:09 UTC (rev 10939) +++ trunk/include/plfci-type1.h 2010-04-28 06:58:38 UTC (rev 10940) @@ -23,20 +23,20 @@ */ /* This file only relevant to device drivers (currently just pdf and - ps) that use Type1 fonts. */ + * ps) that use Type1 fonts. */ /* There are no good choices for script fonts for Type1 so default to - the Helvetica (sans) variants in that case. */ + * the Helvetica (sans) variants in that case. */ /* Default to Helvetica (sans) variants for symbol fonts to follow - what is done for all modern unicode-aware TrueType font devices. */ + * what is done for all modern unicode-aware TrueType font devices. */ /* N.B. if the glyph lookup comes up blank for any of the fonts below, - then an additional search of the Type1 Symbol font glyphs is - implemented in the Type1 device drivers as a fallback. */ + * then an additional search of the Type1 Symbol font glyphs is + * implemented in the Type1 device drivers as a fallback. */ /* N.B. When updating this table by hand be sure to keep it in - ascending order in fci! */ + * ascending order in fci! */ #define N_Type1Lookup 30 static const FCI_to_FontName_Table Type1Lookup[N_Type1Lookup] = { Modified: trunk/src/plcore.c =================================================================== --- trunk/src/plcore.c 2010-04-27 21:53:09 UTC (rev 10939) +++ trunk/src/plcore.c 2010-04-28 06:58:38 UTC (rev 10940) @@ -862,8 +862,8 @@ switch ( string[i + 1] ) { case '(': /* hershey code */ - i += 2 + text2num( &string[i + 2], ')', &code ); - idx = plhershey2unicode( code ); + i += 2 + text2num( &string[i + 2], ')', &code ); + idx = plhershey2unicode( code ); args.n_char = \ (PLUNICODE) hershey_to_unicode_lookup_table[idx].Unicode; plP_esc( PLESC_TEXT_CHAR, &args ); @@ -872,7 +872,7 @@ break; case '[': /* unicode */ - i += 2 + text2num( &string[i + 2], ']', &code ); + i += 2 + text2num( &string[i + 2], ']', &code ); args.n_char = code; plP_esc( PLESC_TEXT_CHAR, &args ); skip = 1; Modified: trunk/src/plstripc.c =================================================================== --- trunk/src/plstripc.c 2010-04-27 21:53:09 UTC (rev 10939) +++ trunk/src/plstripc.c 2010-04-28 06:58:38 UTC (rev 10940) @@ -310,10 +310,10 @@ else stripc->xlen = stripc->xlen * ( 1 + stripc->xjump ); - if( stripc->acc == 0 ) - stripc->xmin = stripc->xmin + stripc->xlen * stripc->xjump; - else - stripc->xmin = stripc->x[p][0]; + if ( stripc->acc == 0 ) + stripc->xmin = stripc->xmin + stripc->xlen * stripc->xjump; + else + stripc->xmin = stripc->x[p][0]; stripc->xmax = stripc->xmax + stripc->xlen * stripc->xjump; plstrip_gen( stripc ); Modified: trunk/src/plsym.c =================================================================== --- trunk/src/plsym.c 2010-04-27 21:53:09 UTC (rev 10939) +++ trunk/src/plsym.c 2010-04-28 06:58:38 UTC (rev 10940) @@ -288,8 +288,8 @@ args.string = NULL; /* Since we are using unicode, we want this to be NULL */ /* "array method" */ plgesc( &esc ); - args.xform = xform; - args.unicode_array_len = 1; + args.xform = xform; + args.unicode_array_len = 1; plhrsh_unicode_buffer[0] = unicode_char; /* watch out for escape character and unescape it by appending * one extra. */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |