| OLD | NEW |
| 1 /***************************************************************************/ | 1 /***************************************************************************/ |
| 2 /* */ | 2 /* */ |
| 3 /* t1afm.c */ | 3 /* t1afm.c */ |
| 4 /* */ | 4 /* */ |
| 5 /* AFM support for Type 1 fonts (body). */ | 5 /* AFM support for Type 1 fonts (body). */ |
| 6 /* */ | 6 /* */ |
| 7 /* Copyright 1996-2011, 2013 by */ | 7 /* Copyright 1996-2015 by */ |
| 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ | 8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
| 9 /* */ | 9 /* */ |
| 10 /* This file is part of the FreeType project, and may only be used, */ | 10 /* This file is part of the FreeType project, and may only be used, */ |
| 11 /* modified, and distributed under the terms of the FreeType project */ | 11 /* modified, and distributed under the terms of the FreeType project */ |
| 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ | 12 /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ |
| 13 /* this file you indicate that you have read the license and */ | 13 /* this file you indicate that you have read the license and */ |
| 14 /* understand and accept it fully. */ | 14 /* understand and accept it fully. */ |
| 15 /* */ | 15 /* */ |
| 16 /***************************************************************************/ | 16 /***************************************************************************/ |
| 17 | 17 |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 | 162 |
| 163 /* Actually, kerning pairs are simply optional! */ | 163 /* Actually, kerning pairs are simply optional! */ |
| 164 if ( fi->NumKernPair == 0 ) | 164 if ( fi->NumKernPair == 0 ) |
| 165 goto Exit; | 165 goto Exit; |
| 166 | 166 |
| 167 /* allocate the pairs */ | 167 /* allocate the pairs */ |
| 168 if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) ) | 168 if ( FT_QNEW_ARRAY( fi->KernPairs, fi->NumKernPair ) ) |
| 169 goto Exit; | 169 goto Exit; |
| 170 | 170 |
| 171 /* now, read each kern pair */ | 171 /* now, read each kern pair */ |
| 172 kp = fi->KernPairs; | 172 kp = fi->KernPairs; |
| 173 limit = p + 4 * fi->NumKernPair; | 173 limit = p + 4 * fi->NumKernPair; |
| 174 | 174 |
| 175 /* PFM kerning data are stored by encoding rather than glyph index, */ | 175 /* PFM kerning data are stored by encoding rather than glyph index, */ |
| 176 /* so find the PostScript charmap of this font and install it */ | 176 /* so find the PostScript charmap of this font and install it */ |
| 177 /* temporarily. If we find no PostScript charmap, then just use */ | 177 /* temporarily. If we find no PostScript charmap, then just use */ |
| 178 /* the default and hope it is the right one. */ | 178 /* the default and hope it is the right one. */ |
| 179 oldcharmap = t1_face->charmap; | 179 oldcharmap = t1_face->charmap; |
| 180 charmap = NULL; | 180 charmap = NULL; |
| 181 | 181 |
| 182 for ( n = 0; n < t1_face->num_charmaps; n++ ) | 182 for ( n = 0; n < t1_face->num_charmaps; n++ ) |
| 183 { | 183 { |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 355 } | 355 } |
| 356 | 356 |
| 357 | 357 |
| 358 FT_LOCAL_DEF( FT_Error ) | 358 FT_LOCAL_DEF( FT_Error ) |
| 359 T1_Get_Track_Kerning( FT_Face face, | 359 T1_Get_Track_Kerning( FT_Face face, |
| 360 FT_Fixed ptsize, | 360 FT_Fixed ptsize, |
| 361 FT_Int degree, | 361 FT_Int degree, |
| 362 FT_Fixed* kerning ) | 362 FT_Fixed* kerning ) |
| 363 { | 363 { |
| 364 AFM_FontInfo fi = (AFM_FontInfo)( (T1_Face)face )->afm_data; | 364 AFM_FontInfo fi = (AFM_FontInfo)( (T1_Face)face )->afm_data; |
| 365 FT_Int i; | 365 FT_UInt i; |
| 366 | 366 |
| 367 | 367 |
| 368 if ( !fi ) | 368 if ( !fi ) |
| 369 return FT_THROW( Invalid_Argument ); | 369 return FT_THROW( Invalid_Argument ); |
| 370 | 370 |
| 371 for ( i = 0; i < fi->NumTrackKern; i++ ) | 371 for ( i = 0; i < fi->NumTrackKern; i++ ) |
| 372 { | 372 { |
| 373 AFM_TrackKern tk = fi->TrackKerns + i; | 373 AFM_TrackKern tk = fi->TrackKerns + i; |
| 374 | 374 |
| 375 | 375 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 387 tk->max_ptsize - tk->min_ptsize ) + | 387 tk->max_ptsize - tk->min_ptsize ) + |
| 388 tk->min_kern; | 388 tk->min_kern; |
| 389 } | 389 } |
| 390 } | 390 } |
| 391 | 391 |
| 392 return FT_Err_Ok; | 392 return FT_Err_Ok; |
| 393 } | 393 } |
| 394 | 394 |
| 395 | 395 |
| 396 /* END */ | 396 /* END */ |
| OLD | NEW |