523 * set load & XFontStruct 524 */ 525 fdata->flist[i].load = 0; 526 527 /* 528 * This appears to be a bogus check. The actual intent appears 529 * to be to find out whether this is the "base" font in a set, 530 * rather than iso8859_1 explicitly. Note that iso8859_15 will 531 * and must also pass this test. 532 */ 533 534 if (fdata->xfont == NULL && 535 strstr(fdata->flist[i].charset_name, "8859_1")) { 536 fdata->flist[i].xfont = 537 loadFont(awt_display, fdata->flist[i].xlfd, size * 10); 538 if (fdata->flist[i].xfont != NULL) { 539 fdata->flist[i].load = 1; 540 fdata->xfont = fdata->flist[i].xfont; 541 fdata->flist[i].index_length = 1; 542 } else { 543 if (errmsg != NULL) { 544 *errmsg = "java/lang" "NullPointerException"; 545 } 546 (*env)->DeleteLocalRef(env, componentFonts); 547 return NULL; 548 } 549 } 550 } 551 (*env)->DeleteLocalRef(env, componentFonts); 552 /* 553 * XFontSet will create if the peer of TextField/TextArea 554 * are used. 555 */ 556 fdata->xfs = NULL; 557 558 JNU_SetLongFieldFromPtr(env,font,fontIDs.pData,fdata); 559 Disposer_AddRecord(env, font, pDataDisposeMethod, ptr_to_jlong(fdata)); 560 return fdata; 561 } else { 562 Display *display = NULL; | 523 * set load & XFontStruct 524 */ 525 fdata->flist[i].load = 0; 526 527 /* 528 * This appears to be a bogus check. The actual intent appears 529 * to be to find out whether this is the "base" font in a set, 530 * rather than iso8859_1 explicitly. Note that iso8859_15 will 531 * and must also pass this test. 532 */ 533 534 if (fdata->xfont == NULL && 535 strstr(fdata->flist[i].charset_name, "8859_1")) { 536 fdata->flist[i].xfont = 537 loadFont(awt_display, fdata->flist[i].xlfd, size * 10); 538 if (fdata->flist[i].xfont != NULL) { 539 fdata->flist[i].load = 1; 540 fdata->xfont = fdata->flist[i].xfont; 541 fdata->flist[i].index_length = 1; 542 } else { 543 /* Free any already allocated storage and fonts */ 544 int j = i; 545 for (j = 0; j <= i; j++) { 546 free((void *)fdata->flist[j].xlfd); 547 JNU_ReleaseStringPlatformChars(env, NULL, 548 fdata->flist[j].charset_name); 549 if (fdata->flist[j].load) { 550 XFreeFont(awt_display, fdata->flist[j].xfont); 551 } 552 } 553 free((void *)fdata->flist); 554 free((void *)fdata); 555 556 if (errmsg != NULL) { 557 *errmsg = "java/lang" "NullPointerException"; 558 } 559 (*env)->DeleteLocalRef(env, componentFonts); 560 return NULL; 561 } 562 } 563 } 564 (*env)->DeleteLocalRef(env, componentFonts); 565 /* 566 * XFontSet will create if the peer of TextField/TextArea 567 * are used. 568 */ 569 fdata->xfs = NULL; 570 571 JNU_SetLongFieldFromPtr(env,font,fontIDs.pData,fdata); 572 Disposer_AddRecord(env, font, pDataDisposeMethod, ptr_to_jlong(fdata)); 573 return fdata; 574 } else { 575 Display *display = NULL; |