public NativeFont (String baseFont, PDFObject fontObj,
                       PDFFontDescriptor descriptor)
            throws IOException {
        super (baseFont, fontObj, descriptor);

        String fontName = descriptor.getFontName ();

        PDFObject ttf = descriptor.getFontFile2 ();
        if (ttf != null) {
            byte[] fontdata = ttf.getStream ();

            try {
                setFont (fontdata);
            } catch (FontFormatException ffe) {
                throw new PDFParseException ("Font format exception: " + ffe);
            }
        } else {
            int flags = descriptor.getFlags ();
            int style = ((flags & PDFFontDescriptor.FORCEBOLD) != 0) ? Font.BOLD : Font.PLAIN;

            if (fontName.indexOf ("Bold") > 0) {
                style |= Font.BOLD;
            }
            if (descriptor.getItalicAngle () != 0) {
                style |= Font.ITALIC;
            }
            if ((flags & PDFFontDescriptor.FIXED_PITCH) != 0) { // fixed width
                setFont (new Font ("Monospaced", style, 1));
            } else if ((flags & PDFFontDescriptor.SERIF) != 0) {  // serif font
                setFont (new Font ("Serif", style, 1));
            } else {
                setFont (new Font ("Sans-serif", style, 1));
            }
        }
    }