This commit is contained in:
Lana Steuck 2012-07-03 20:54:45 -07:00
commit aa516b42ef
3 changed files with 15 additions and 19 deletions

View File

@ -200,29 +200,25 @@ public class CGraphicsEnvironment extends SunGraphicsEnvironment {
return true;
}
private Font[] allFontsWithLogical;
static String[] sLogicalFonts = { "Serif", "SansSerif", "Monospaced", "Dialog", "DialogInput" };
@Override
public Font[] getAllFonts() {
if (allFontsWithLogical == null)
Font[] newFonts;
Font[] superFonts = super.getAllFonts();
int numLogical = sLogicalFonts.length;
int numOtherFonts = superFonts.length;
newFonts = new Font[numOtherFonts + numLogical];
System.arraycopy(superFonts,0,newFonts,numLogical,numOtherFonts);
for (int i = 0; i < numLogical; i++)
{
Font[] newFonts;
Font[] superFonts = super.getAllFonts();
int numLogical = sLogicalFonts.length;
int numOtherFonts = superFonts.length;
newFonts = new Font[numOtherFonts + numLogical];
System.arraycopy(superFonts,0,newFonts,numLogical,numOtherFonts);
for (int i = 0; i < numLogical; i++)
{
newFonts[i] = new Font(sLogicalFonts[i], Font.PLAIN, 1);
}
allFontsWithLogical = newFonts;
newFonts[i] = new Font(sLogicalFonts[i], Font.PLAIN, 1);
}
return java.util.Arrays.copyOf(allFontsWithLogical, allFontsWithLogical.length);
return newFonts;
}
}

View File

@ -1240,7 +1240,7 @@ Java_sun_font_FontConfigManager_getFontConfig
FC_CHARSET, 0, &charset);
if (result != FcResultMatch) {
free(family);
free(family);
free(fullname);
free(styleStr);
free(file);
(*FcPatternDestroy)(pattern);

View File

@ -409,7 +409,7 @@ Java_sun_font_FileFontStrike__1getGlyphImageFromWindows
*/
imageSize = bytesWidth*height;
glyphInfo = (GlyphInfo*)malloc(sizeof(GlyphInfo)+imageSize);
if (malloc == NULL) {
if (glyphInfo == NULL) {
FREE_AND_RETURN;
}
glyphInfo->cellInfo = NULL;