< prev index next >

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

Print this page




1237             if (val >= 0 && val <= 65536) {
1238                 minGlyphs = val;
1239             }
1240         }
1241 
1242         for (j=0; j<nfonts; j++) {
1243             FcPattern *fontPattern = fontset->fonts[j];
1244             FcChar8 *fontformat;
1245             FcCharSet *charset = NULL;
1246 
1247             fontformat = NULL;
1248             (*FcPatternGetString)(fontPattern, FC_FONTFORMAT, 0, &fontformat);
1249             /* We only want TrueType fonts but some Linuxes still depend
1250              * on Type 1 fonts for some Locale support, so we'll allow
1251              * them there.
1252              */
1253             if (fontformat != NULL
1254                 && (strcmp((char*)fontformat, "TrueType") != 0)
1255 #if defined(__linux__) || defined(_AIX)
1256                 && (strcmp((char*)fontformat, "Type 1") != 0)

1257 #endif
1258              ) {
1259                 continue;
1260             }
1261             result = (*FcPatternGetCharSet)(fontPattern,
1262                                             FC_CHARSET, 0, &charset);
1263             if (result != FcResultMatch) {
1264                 free(family);
1265                 free(fullname);
1266                 free(styleStr);
1267                 free(file);
1268                 (*FcPatternDestroy)(pattern);
1269                 (*FcFontSetDestroy)(fontset);
1270                 closeFontConfig(libfontconfig, JNI_FALSE);
1271                 return;
1272             }
1273 
1274             /* We don't want 20 or 30 fonts, so once we hit 10 fonts,
1275              * then require that they really be adding value. Too many
1276              * adversely affects load time for minimal value-add.




1237             if (val >= 0 && val <= 65536) {
1238                 minGlyphs = val;
1239             }
1240         }
1241 
1242         for (j=0; j<nfonts; j++) {
1243             FcPattern *fontPattern = fontset->fonts[j];
1244             FcChar8 *fontformat;
1245             FcCharSet *charset = NULL;
1246 
1247             fontformat = NULL;
1248             (*FcPatternGetString)(fontPattern, FC_FONTFORMAT, 0, &fontformat);
1249             /* We only want TrueType fonts but some Linuxes still depend
1250              * on Type 1 fonts for some Locale support, so we'll allow
1251              * them there.
1252              */
1253             if (fontformat != NULL
1254                 && (strcmp((char*)fontformat, "TrueType") != 0)
1255 #if defined(__linux__) || defined(_AIX)
1256                 && (strcmp((char*)fontformat, "Type 1") != 0)
1257                 && (strcmp((char*)fontformat, "CFF") != 0)
1258 #endif
1259              ) {
1260                 continue;
1261             }
1262             result = (*FcPatternGetCharSet)(fontPattern,
1263                                             FC_CHARSET, 0, &charset);
1264             if (result != FcResultMatch) {
1265                 free(family);
1266                 free(fullname);
1267                 free(styleStr);
1268                 free(file);
1269                 (*FcPatternDestroy)(pattern);
1270                 (*FcFontSetDestroy)(fontset);
1271                 closeFontConfig(libfontconfig, JNI_FALSE);
1272                 return;
1273             }
1274 
1275             /* We don't want 20 or 30 fonts, so once we hit 10 fonts,
1276              * then require that they really be adding value. Too many
1277              * adversely affects load time for minimal value-add.


< prev index next >