< prev index next >

src/java.desktop/unix/native/common/awt/fontpath.c

Print this page




 272       XFreeFontPath ( origFontPath );
 273       return;
 274     }
 275 
 276     for ( origIndex = 0; origIndex < nPaths; origIndex++ ) {
 277       onePath = origFontPath[origIndex];
 278       newFontPath[origIndex] = onePath;
 279     }
 280 
 281     /* now add the other font paths */
 282 
 283     for (index = 0; index < fDirP->num; index++ ) {
 284 
 285       if ( appendDirList[index] == 1 ) {
 286 
 287         /* printf ( "Appending %s\n", fDirP->name[index] ); */
 288 
 289         onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, strlen (fDirP->name[index]) + 2, sizeof( char ) );
 290         if (onePath == NULL) {
 291             free ( ( void *) appendDirList );

 292             XFreeFontPath ( origFontPath );
 293             return;
 294         }
 295         strcpy ( onePath, fDirP->name[index] );
 296         strcat ( onePath, "/" );
 297         newFontPath[nPaths++] = onePath;
 298         /* printf ( "The path to be appended is %s\n", onePath ); */
 299       }
 300     }
 301 
 302     /*   printf ( "The dir count = %d\n", totalDirCount ); */
 303     free ( ( void *) appendDirList );
 304 
 305     XSetFontPath ( awt_display, newFontPath, totalDirCount );
 306 
 307         for ( index = origNumPaths; index < totalDirCount; index++ ) {
 308                 free( newFontPath[index] );
 309     }
 310 
 311         free ( (void *) newFontPath );




 272       XFreeFontPath ( origFontPath );
 273       return;
 274     }
 275 
 276     for ( origIndex = 0; origIndex < nPaths; origIndex++ ) {
 277       onePath = origFontPath[origIndex];
 278       newFontPath[origIndex] = onePath;
 279     }
 280 
 281     /* now add the other font paths */
 282 
 283     for (index = 0; index < fDirP->num; index++ ) {
 284 
 285       if ( appendDirList[index] == 1 ) {
 286 
 287         /* printf ( "Appending %s\n", fDirP->name[index] ); */
 288 
 289         onePath = SAFE_SIZE_ARRAY_ALLOC(malloc, strlen (fDirP->name[index]) + 2, sizeof( char ) );
 290         if (onePath == NULL) {
 291             free ( ( void *) appendDirList );
 292             free ( ( void *) newFontPath );
 293             XFreeFontPath ( origFontPath );
 294             return;
 295         }
 296         strcpy ( onePath, fDirP->name[index] );
 297         strcat ( onePath, "/" );
 298         newFontPath[nPaths++] = onePath;
 299         /* printf ( "The path to be appended is %s\n", onePath ); */
 300       }
 301     }
 302 
 303     /*   printf ( "The dir count = %d\n", totalDirCount ); */
 304     free ( ( void *) appendDirList );
 305 
 306     XSetFontPath ( awt_display, newFontPath, totalDirCount );
 307 
 308         for ( index = origNumPaths; index < totalDirCount; index++ ) {
 309                 free( newFontPath[index] );
 310     }
 311 
 312         free ( (void *) newFontPath );


< prev index next >