Java Code Examples for sun.font.SunFontManager#FONTFORMAT_TYPE1

The following examples show how to use sun.font.SunFontManager#FONTFORMAT_TYPE1 . 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: Win32FontManager.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 2
Source File: Win32FontManager.java    From TencentKona-8 with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 3
Source File: Win32FontManager.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 4
Source File: Win32FontManager.java    From openjdk-jdk8u with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 5
Source File: Win32FontManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 6
Source File: Win32FontManager.java    From openjdk-jdk9 with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 7
Source File: Win32FontManager.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 8
Source File: Win32FontManager.java    From hottub with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 9
Source File: Win32FontManager.java    From openjdk-8-source with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 10
Source File: Win32FontManager.java    From openjdk-8 with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 11
Source File: Win32FontManager.java    From jdk8u_jdk with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 12
Source File: Win32FontManager.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}
 
Example 13
Source File: Win32FontManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
protected void registerFontFile(String fontFileName, String[] nativeNames,
                                int fontRank, boolean defer) {

    // REMIND: case compare depends on platform
    if (registeredFontFiles.contains(fontFileName)) {
        return;
    }
    registeredFontFiles.add(fontFileName);

    int fontFormat;
    if (getTrueTypeFilter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TRUETYPE;
    } else if (getType1Filter().accept(null, fontFileName)) {
        fontFormat = SunFontManager.FONTFORMAT_TYPE1;
    } else {
        /* on windows we don't use/register native fonts */
        return;
    }

    if (fontPath == null) {
        fontPath = getPlatformFontPath(noType1Font);
    }

    /* Look in the JRE font directory first.
     * This is playing it safe as we would want to find fonts in the
     * JRE font directory ahead of those in the system directory
     */
    String tmpFontPath = jreFontDirName+File.pathSeparator+fontPath;
    StringTokenizer parser = new StringTokenizer(tmpFontPath,
                                                 File.pathSeparator);

    boolean found = false;
    try {
        while (!found && parser.hasMoreTokens()) {
            String newPath = parser.nextToken();
            boolean isJREFont = newPath.equals(jreFontDirName);
            File theFile = new File(newPath, fontFileName);
            if (theFile.canRead()) {
                found = true;
                String path = theFile.getAbsolutePath();
                if (defer) {
                    registerDeferredFont(fontFileName, path,
                                         nativeNames,
                                         fontFormat, isJREFont,
                                         fontRank);
                } else {
                    registerFontFile(path, nativeNames,
                                     fontFormat, isJREFont,
                                     fontRank);
                }
                break;
            }
        }
    } catch (NoSuchElementException e) {
        System.err.println(e);
    }
    if (!found) {
        addToMissingFontFileList(fontFileName);
    }
}