Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.awt.*;

import java.awt.geom.*;
import java.awt.font.*;

public class Main {
    public static boolean isVectorFont(Font font) {
        GlyphVector gv = font.createGlyphVector(new FontRenderContext(null, true, false), "Test");
        Shape fontShape = gv.getOutline();
        Rectangle2D bounds = fontShape.getBounds2D();
        return !(bounds.getWidth() == 0 && bounds.getHeight() == 0);
    }
}