sun.font.FontConfigManager.FontConfigFont Java Examples

The following examples show how to use sun.font.FontConfigManager.FontConfigFont. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: FcFontConfiguration.java    From openjdk-8 with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #2
Source File: FcFontConfiguration.java    From TencentKona-8 with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #3
Source File: FcFontConfiguration.java    From jdk8u-dev-jdk with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #4
Source File: FcFontConfiguration.java    From jdk8u60 with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #5
Source File: FcFontConfiguration.java    From openjdk-8-source with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #6
Source File: FcFontConfiguration.java    From openjdk-jdk8u with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #7
Source File: FcFontConfiguration.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #8
Source File: FcFontConfiguration.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #9
Source File: FcFontConfiguration.java    From openjdk-jdk9 with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #10
Source File: FcFontConfiguration.java    From jdk8u_jdk with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #11
Source File: FcFontConfiguration.java    From jdk8u-jdk with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #12
Source File: FcFontConfiguration.java    From dragonwell8_jdk with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #13
Source File: FcFontConfiguration.java    From hottub with GNU General Public License v2.0 6 votes vote down vote up
private FontConfigFont[] getFcFontList(FcCompFont[] fcFonts,
                                       String fontname, int style) {

    if (fontname.equals("dialog")) {
        fontname = "sansserif";
    } else if (fontname.equals("dialoginput")) {
        fontname = "monospaced";
    }
    for (int i=0; i<fcFonts.length; i++) {
        if (fontname.equals(fcFonts[i].jdkName) &&
            style == fcFonts[i].style) {
            return fcFonts[i].allFonts;
        }
    }
    return fcFonts[0].allFonts;
}
 
Example #14
Source File: FcFontConfiguration.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    FcFontManager fm = (FcFontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #15
Source File: FcFontConfiguration.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    X11FontManager fm = (X11FontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        null,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #16
Source File: FcFontConfiguration.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    FcFontManager fm = (FcFontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #17
Source File: FcFontConfiguration.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    X11FontManager fm = (X11FontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #18
Source File: FcFontConfiguration.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    X11FontManager fm = (X11FontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #19
Source File: FcFontConfiguration.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    X11FontManager fm = (X11FontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        null,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #20
Source File: FcFontConfiguration.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    FcFontManager fm = (FcFontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #21
Source File: FcFontConfiguration.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    FcFontManager fm = (FcFontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #22
Source File: FcFontConfiguration.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    FcFontManager fm = (FcFontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #23
Source File: FcFontConfiguration.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    FcFontManager fm = (FcFontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #24
Source File: FcFontConfiguration.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    X11FontManager fm = (X11FontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #25
Source File: FcFontConfiguration.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    FcFontManager fm = (FcFontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}
 
Example #26
Source File: FcFontConfiguration.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
@Override
public CompositeFontDescriptor[] get2DCompositeFontInfo() {

    FcFontManager fm = (FcFontManager) fontManager;
    FontConfigManager fcm = fm.getFontConfigManager();
    FcCompFont[] fcCompFonts = fcm.loadFontConfig();

    CompositeFontDescriptor[] result =
            new CompositeFontDescriptor[NUM_FONTS * NUM_STYLES];

    for (int fontIndex = 0; fontIndex < NUM_FONTS; fontIndex++) {
        String fontName = publicFontNames[fontIndex];

        for (int styleIndex = 0; styleIndex < NUM_STYLES; styleIndex++) {

            String faceName = fontName + "." + styleNames[styleIndex];
            FontConfigFont[] fcFonts =
                getFcFontList(fcCompFonts,
                              fontNames[fontIndex], styleIndex);

            int numFonts = fcFonts.length;
            // fall back fonts listed in the lib/fonts/fallback directory
            if (installedFallbackFontFiles != null) {
                numFonts += installedFallbackFontFiles.length;
            }

            String[] fileNames = new String[numFonts];
            String[] faceNames = new String[numFonts];

            int index;
            for (index = 0; index < fcFonts.length; index++) {
                fileNames[index] = fcFonts[index].fontFile;
                faceNames[index] = fcFonts[index].familyName;
            }

            if (installedFallbackFontFiles != null) {
                System.arraycopy(installedFallbackFontFiles, 0,
                                 fileNames, fcFonts.length,
                                 installedFallbackFontFiles.length);
            }

            result[fontIndex * NUM_STYLES + styleIndex]
                    = new CompositeFontDescriptor(
                        faceName,
                        1,
                        faceNames,
                        fileNames,
                        null, null);
        }
    }
    return result;
}