Java Code Examples for sun.font.FontUtilities#isLinux()

The following examples show how to use sun.font.FontUtilities#isLinux() . 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: FontConfiguration.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public boolean needToSearchForFile(String fileName) {
    if (!FontUtilities.isLinux) {
        return false;
    } else if (existsMap == null) {
       existsMap = new HashMap<String, Boolean>();
    }
    Boolean exists = existsMap.get(fileName);
    if (exists == null) {
        /* call getNumberCoreFonts() to ensure these are initialised, and
         * if this file isn't for a core component, ie, is a for a fallback
         * font which very typically isn't available, then can't afford
         * to take the start-up penalty to search for it.
         */
        getNumberCoreFonts();
        if (!coreFontFileNames.contains(fileName)) {
            exists = Boolean.TRUE;
        } else {
            exists = Boolean.valueOf((new File(fileName)).exists());
            existsMap.put(fileName, exists);
            if (FontUtilities.debugFonts() &&
                exists == Boolean.FALSE) {
                logger.warning("Couldn't locate font file " + fileName);
            }
        }
    }
    return exists == Boolean.FALSE;
}
 
Example 2
Source File: X11FontManager.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void registerPlatformFontsUsedByFontConfiguration() {
    // Lazily initialize fontConfigDirs.
    getPlatformFontPathFromFontConfig();
    if (fontConfigDirs == null) {
        return;
    }
    if (FontUtilities.isLinux) {
        fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
    }
    fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}
 
Example 3
Source File: X11FontManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
protected FontConfiguration createFontConfiguration() {
    /* The logic here decides whether to use a preconfigured
     * fontconfig.properties file, or synthesise one using platform APIs.
     * On Solaris (as opposed to OpenSolaris) we try to use the
     * pre-configured ones, but if the files it specifies are missing
     * we fail-safe to synthesising one. This might happen if Solaris
     * changes its fonts.
     * For OpenSolaris I don't expect us to ever create fontconfig files,
     * so it will always synthesise. Note that if we misidentify
     * OpenSolaris as Solaris, then the test for the presence of
     * Solaris-only font files will correct this.
     * For Linux we require an exact match of distro and version to
     * use the preconfigured file, and also that it points to
     * existent fonts.
     * If synthesising fails, we fall back to any preconfigured file
     * and do the best we can. For the commercial JDK this will be
     * fine as it includes the Lucida fonts. OpenJDK should not hit
     * this as the synthesis should always work on its platforms.
     */
    FontConfiguration mFontConfig = new MFontConfiguration(this);
    if (FontUtilities.isOpenSolaris ||
        (FontUtilities.isLinux &&
         (!mFontConfig.foundOsSpecificFile() ||
          !mFontConfig.fontFilesArePresent()) ||
         (FontUtilities.isSolaris && !mFontConfig.fontFilesArePresent()))) {
        FcFontConfiguration fcFontConfig =
            new FcFontConfiguration(this);
        if (fcFontConfig.init()) {
            return fcFontConfig;
        }
    }
    mFontConfig.init();
    return mFontConfig;
}
 
Example 4
Source File: FontConfiguration.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public boolean needToSearchForFile(String fileName) {
    if (!FontUtilities.isLinux) {
        return false;
    } else if (existsMap == null) {
       existsMap = new HashMap<String, Boolean>();
    }
    Boolean exists = existsMap.get(fileName);
    if (exists == null) {
        /* call getNumberCoreFonts() to ensure these are initialised, and
         * if this file isn't for a core component, ie, is a for a fallback
         * font which very typically isn't available, then can't afford
         * to take the start-up penalty to search for it.
         */
        getNumberCoreFonts();
        if (!coreFontFileNames.contains(fileName)) {
            exists = Boolean.TRUE;
        } else {
            exists = Boolean.valueOf((new File(fileName)).exists());
            existsMap.put(fileName, exists);
            if (FontUtilities.debugFonts() &&
                exists == Boolean.FALSE) {
                logger.warning("Couldn't locate font file " + fileName);
            }
        }
    }
    return exists == Boolean.FALSE;
}
 
Example 5
Source File: FontConfiguration.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public boolean needToSearchForFile(String fileName) {
    if (!FontUtilities.isLinux) {
        return false;
    } else if (existsMap == null) {
       existsMap = new HashMap<String, Boolean>();
    }
    Boolean exists = existsMap.get(fileName);
    if (exists == null) {
        /* call getNumberCoreFonts() to ensure these are initialised, and
         * if this file isn't for a core component, ie, is a for a fallback
         * font which very typically isn't available, then can't afford
         * to take the start-up penalty to search for it.
         */
        getNumberCoreFonts();
        if (!coreFontFileNames.contains(fileName)) {
            exists = Boolean.TRUE;
        } else {
            exists = Boolean.valueOf((new File(fileName)).exists());
            existsMap.put(fileName, exists);
            if (FontUtilities.debugFonts() &&
                exists == Boolean.FALSE) {
                logger.warning("Couldn't locate font file " + fileName);
            }
        }
    }
    return exists == Boolean.FALSE;
}
 
Example 6
Source File: X11FontManager.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
protected FontConfiguration createFontConfiguration() {
    /* The logic here decides whether to use a preconfigured
     * fontconfig.properties file, or synthesise one using platform APIs.
     * On Solaris (as opposed to OpenSolaris) we try to use the
     * pre-configured ones, but if the files it specifies are missing
     * we fail-safe to synthesising one. This might happen if Solaris
     * changes its fonts.
     * For OpenSolaris I don't expect us to ever create fontconfig files,
     * so it will always synthesise. Note that if we misidentify
     * OpenSolaris as Solaris, then the test for the presence of
     * Solaris-only font files will correct this.
     * For Linux we require an exact match of distro and version to
     * use the preconfigured file, and also that it points to
     * existent fonts.
     * If synthesising fails, we fall back to any preconfigured file
     * and do the best we can.
     */
    FontConfiguration mFontConfig = new MFontConfiguration(this);
    if (FontUtilities.isOpenSolaris ||
        (FontUtilities.isLinux &&
         (!mFontConfig.foundOsSpecificFile() ||
          !mFontConfig.fontFilesArePresent()) ||
         (FontUtilities.isSolaris && !mFontConfig.fontFilesArePresent()))) {
        FcFontConfiguration fcFontConfig =
            new FcFontConfiguration(this);
        if (fcFontConfig.init()) {
            return fcFontConfig;
        }
    }
    mFontConfig.init();
    return mFontConfig;
}
 
Example 7
Source File: FontConfiguration.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean needToSearchForFile(String fileName) {
    if (!FontUtilities.isLinux) {
        return false;
    } else if (existsMap == null) {
       existsMap = new HashMap<String, Boolean>();
    }
    Boolean exists = existsMap.get(fileName);
    if (exists == null) {
        /* call getNumberCoreFonts() to ensure these are initialised, and
         * if this file isn't for a core component, ie, is a for a fallback
         * font which very typically isn't available, then can't afford
         * to take the start-up penalty to search for it.
         */
        getNumberCoreFonts();
        if (!coreFontFileNames.contains(fileName)) {
            exists = Boolean.TRUE;
        } else {
            exists = Boolean.valueOf((new File(fileName)).exists());
            existsMap.put(fileName, exists);
            if (FontUtilities.debugFonts() &&
                exists == Boolean.FALSE) {
                logger.warning("Couldn't locate font file " + fileName);
            }
        }
    }
    return exists == Boolean.FALSE;
}
 
Example 8
Source File: X11FontManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void registerPlatformFontsUsedByFontConfiguration() {
    // Lazily initialize fontConfigDirs.
    getPlatformFontPathFromFontConfig();
    if (fontConfigDirs == null) {
        return;
    }
    if (FontUtilities.isLinux) {
        fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
    }
    fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}
 
Example 9
Source File: FontConfiguration.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public boolean needToSearchForFile(String fileName) {
    if (!FontUtilities.isLinux) {
        return false;
    } else if (existsMap == null) {
       existsMap = new HashMap<String, Boolean>();
    }
    Boolean exists = existsMap.get(fileName);
    if (exists == null) {
        /* call getNumberCoreFonts() to ensure these are initialised, and
         * if this file isn't for a core component, ie, is a for a fallback
         * font which very typically isn't available, then can't afford
         * to take the start-up penalty to search for it.
         */
        getNumberCoreFonts();
        if (!coreFontFileNames.contains(fileName)) {
            exists = Boolean.TRUE;
        } else {
            exists = Boolean.valueOf((new File(fileName)).exists());
            existsMap.put(fileName, exists);
            if (FontUtilities.debugFonts() &&
                exists == Boolean.FALSE) {
                logger.warning("Couldn't locate font file " + fileName);
            }
        }
    }
    return exists == Boolean.FALSE;
}
 
Example 10
Source File: X11FontManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void registerPlatformFontsUsedByFontConfiguration() {
    // Lazily initialize fontConfigDirs.
    getPlatformFontPathFromFontConfig();
    if (fontConfigDirs == null) {
        return;
    }
    if (FontUtilities.isLinux) {
        fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
    }
    fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}
 
Example 11
Source File: FontConfiguration.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
public boolean needToSearchForFile(String fileName) {
    if (!FontUtilities.isLinux) {
        return false;
    } else if (existsMap == null) {
       existsMap = new HashMap<String, Boolean>();
    }
    Boolean exists = existsMap.get(fileName);
    if (exists == null) {
        /* call getNumberCoreFonts() to ensure these are initialised, and
         * if this file isn't for a core component, ie, is a for a fallback
         * font which very typically isn't available, then can't afford
         * to take the start-up penalty to search for it.
         */
        getNumberCoreFonts();
        if (!coreFontFileNames.contains(fileName)) {
            exists = Boolean.TRUE;
        } else {
            exists = Boolean.valueOf((new File(fileName)).exists());
            existsMap.put(fileName, exists);
            if (FontUtilities.debugFonts() &&
                exists == Boolean.FALSE) {
                logger.warning("Couldn't locate font file " + fileName);
            }
        }
    }
    return exists == Boolean.FALSE;
}
 
Example 12
Source File: X11FontManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void registerPlatformFontsUsedByFontConfiguration() {
    // Lazily initialize fontConfigDirs.
    getPlatformFontPathFromFontConfig();
    if (fontConfigDirs == null) {
        return;
    }
    if (FontUtilities.isLinux) {
        fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
    }
    fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}
 
Example 13
Source File: X11FontManager.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
protected FontConfiguration createFontConfiguration() {
    /* The logic here decides whether to use a preconfigured
     * fontconfig.properties file, or synthesise one using platform APIs.
     * On Solaris (as opposed to OpenSolaris) we try to use the
     * pre-configured ones, but if the files it specifies are missing
     * we fail-safe to synthesising one. This might happen if Solaris
     * changes its fonts.
     * For OpenSolaris I don't expect us to ever create fontconfig files,
     * so it will always synthesise. Note that if we misidentify
     * OpenSolaris as Solaris, then the test for the presence of
     * Solaris-only font files will correct this.
     * For Linux we require an exact match of distro and version to
     * use the preconfigured file, and also that it points to
     * existent fonts.
     * If synthesising fails, we fall back to any preconfigured file
     * and do the best we can. For the commercial JDK this will be
     * fine as it includes the Lucida fonts. OpenJDK should not hit
     * this as the synthesis should always work on its platforms.
     */
    FontConfiguration mFontConfig = new MFontConfiguration(this);
    if (FontUtilities.isOpenSolaris ||
        (FontUtilities.isLinux &&
         (!mFontConfig.foundOsSpecificFile() ||
          !mFontConfig.fontFilesArePresent()) ||
         (FontUtilities.isSolaris && !mFontConfig.fontFilesArePresent()))) {
        FcFontConfiguration fcFontConfig =
            new FcFontConfiguration(this);
        if (fcFontConfig.init()) {
            return fcFontConfig;
        }
    }
    mFontConfig.init();
    return mFontConfig;
}
 
Example 14
Source File: X11FontManager.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void registerPlatformFontsUsedByFontConfiguration() {
    // Lazily initialize fontConfigDirs.
    getPlatformFontPathFromFontConfig();
    if (fontConfigDirs == null) {
        return;
    }
    if (FontUtilities.isLinux) {
        fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
    }
    fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}
 
Example 15
Source File: X11FontManager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void registerPlatformFontsUsedByFontConfiguration() {
    // Lazily initialize fontConfigDirs.
    getPlatformFontPathFromFontConfig();
    if (fontConfigDirs == null) {
        return;
    }
    if (FontUtilities.isLinux) {
        fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
    }
    fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}
 
Example 16
Source File: X11FontManager.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
protected FontConfiguration createFontConfiguration() {
    /* The logic here decides whether to use a preconfigured
     * fontconfig.properties file, or synthesise one using platform APIs.
     * On Solaris (as opposed to OpenSolaris) we try to use the
     * pre-configured ones, but if the files it specifies are missing
     * we fail-safe to synthesising one. This might happen if Solaris
     * changes its fonts.
     * For OpenSolaris I don't expect us to ever create fontconfig files,
     * so it will always synthesise. Note that if we misidentify
     * OpenSolaris as Solaris, then the test for the presence of
     * Solaris-only font files will correct this.
     * For Linux we require an exact match of distro and version to
     * use the preconfigured file, and also that it points to
     * existent fonts.
     * If synthesising fails, we fall back to any preconfigured file
     * and do the best we can. For the commercial JDK this will be
     * fine as it includes the Lucida fonts. OpenJDK should not hit
     * this as the synthesis should always work on its platforms.
     */
    FontConfiguration mFontConfig = new MFontConfiguration(this);
    if (FontUtilities.isOpenSolaris ||
        (FontUtilities.isLinux &&
         (!mFontConfig.foundOsSpecificFile() ||
          !mFontConfig.fontFilesArePresent()) ||
         (FontUtilities.isSolaris && !mFontConfig.fontFilesArePresent()))) {
        FcFontConfiguration fcFontConfig =
            new FcFontConfiguration(this);
        if (fcFontConfig.init()) {
            return fcFontConfig;
        }
    }
    mFontConfig.init();
    return mFontConfig;
}
 
Example 17
Source File: X11FontManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void registerPlatformFontsUsedByFontConfiguration() {
    // Lazily initialize fontConfigDirs.
    getPlatformFontPathFromFontConfig();
    if (fontConfigDirs == null) {
        return;
    }
    if (FontUtilities.isLinux) {
        fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
    }
    fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}
 
Example 18
Source File: FontConfiguration.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public boolean needToSearchForFile(String fileName) {
    if (!FontUtilities.isLinux) {
        return false;
    } else if (existsMap == null) {
       existsMap = new HashMap<String, Boolean>();
    }
    Boolean exists = existsMap.get(fileName);
    if (exists == null) {
        /* call getNumberCoreFonts() to ensure these are initialised, and
         * if this file isn't for a core component, ie, is a for a fallback
         * font which very typically isn't available, then can't afford
         * to take the start-up penalty to search for it.
         */
        getNumberCoreFonts();
        if (!coreFontFileNames.contains(fileName)) {
            exists = Boolean.TRUE;
        } else {
            exists = Boolean.valueOf((new File(fileName)).exists());
            existsMap.put(fileName, exists);
            if (FontUtilities.debugFonts() &&
                exists == Boolean.FALSE) {
                logger.warning("Couldn't locate font file " + fileName);
            }
        }
    }
    return exists == Boolean.FALSE;
}
 
Example 19
Source File: X11FontManager.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void registerPlatformFontsUsedByFontConfiguration() {
    // Lazily initialize fontConfigDirs.
    getPlatformFontPathFromFontConfig();
    if (fontConfigDirs == null) {
        return;
    }
    if (FontUtilities.isLinux) {
        fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
    }
    fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}
 
Example 20
Source File: X11FontManager.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected void registerPlatformFontsUsedByFontConfiguration() {
    // Lazily initialize fontConfigDirs.
    getPlatformFontPathFromFontConfig();
    if (fontConfigDirs == null) {
        return;
    }
    if (FontUtilities.isLinux) {
        fontConfigDirs.add(jreLibDirName+File.separator+"oblique-fonts");
    }
    fontdirs = (String[])fontConfigDirs.toArray(new String[0]);
}