sun.font.TrueTypeFont Java Examples

The following examples show how to use sun.font.TrueTypeFont. 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 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true, false);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #2
Source File: Win32FontManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #3
Source File: WPathGraphics.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #4
Source File: Win32FontManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #5
Source File: WPathGraphics.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #6
Source File: Win32FontManager.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true, false);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #7
Source File: WPathGraphics.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #8
Source File: Win32FontManager.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #9
Source File: WPathGraphics.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #10
Source File: Win32FontManager.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #11
Source File: WPathGraphics.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #12
Source File: Win32FontManager.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true, false);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #13
Source File: WPathGraphics.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #14
Source File: Win32FontManager.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true, false);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #15
Source File: WPathGraphics.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #16
Source File: Win32FontManager.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true, false);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #17
Source File: WPathGraphics.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #18
Source File: Win32FontManager.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true, false);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #19
Source File: WPathGraphics.java    From openjdk-jdk8u-backup with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #20
Source File: WPathGraphics.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #21
Source File: Win32FontManager.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true, false);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #22
Source File: WPathGraphics.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #23
Source File: Win32FontManager.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true, false);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #24
Source File: WPathGraphics.java    From openjdk-jdk9 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #25
Source File: Win32FontManager.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
public Object run() {
    String eudcFile = getEUDCFontFile();
    if (eudcFile != null) {
        try {
            /* Must use Java rasteriser since GDI doesn't
             * enumerate (allow direct use) of EUDC fonts.
             */
            eudcFont = new TrueTypeFont(eudcFile, null, 0,
                                        true);
        } catch (FontFormatException e) {
        }
    }
    return null;
}
 
Example #26
Source File: WPathGraphics.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
@Override
protected int platformFontCount(Font font, String str) {

    AffineTransform deviceTransform = getTransform();
    AffineTransform fontTransform = new AffineTransform(deviceTransform);
    fontTransform.concatenate(getFont().getTransform());
    int transformType = fontTransform.getType();

    /* Test if GDI can handle the transform */
    boolean directToGDI = ((transformType !=
                           AffineTransform.TYPE_GENERAL_TRANSFORM)
                           && ((transformType & AffineTransform.TYPE_FLIP)
                               == 0));

    if (!directToGDI) {
        return 0;
    }

    /* Since all windows fonts are available, and the JRE fonts
     * are also registered. Only the Font.createFont() case is presently
     * unknown to GDI. Those can be registered too, although that
     * code does not exist yet, it can be added too, so we should not
     * fail that case. Just do a quick check whether its a TrueTypeFont
     * - ie not a Type1 font etc, and let drawString() resolve the rest.
     */
    Font2D font2D = FontUtilities.getFont2D(font);
    if (font2D instanceof CompositeFont ||
        font2D instanceof TrueTypeFont) {
        return 1;
    } else {
        return 0;
    }
}
 
Example #27
Source File: Win32FontManager.java    From jdk8u60 with GNU General Public License v2.0 4 votes vote down vote up
public TrueTypeFont getEUDCFont() {
    return eudcFont;
}
 
Example #28
Source File: Win32FontManager.java    From jdk8u-dev-jdk with GNU General Public License v2.0 4 votes vote down vote up
public TrueTypeFont getEUDCFont() {
    return eudcFont;
}
 
Example #29
Source File: Win32FontManager.java    From dragonwell8_jdk with GNU General Public License v2.0 4 votes vote down vote up
public TrueTypeFont getEUDCFont() {
    return eudcFont;
}
 
Example #30
Source File: Win32FontManager.java    From jdk8u-jdk with GNU General Public License v2.0 4 votes vote down vote up
public TrueTypeFont getEUDCFont() {
    return eudcFont;
}