PDFFontSetDefault.java 2.12 KB
/*
 * Decompiled with CFR 0_118.
 * 
 * Could not load the following classes:
 *  com.adobe.fontengine.font.Base14
 *  com.adobe.fontengine.font.Font
 *  com.adobe.fontengine.fontmanagement.FontResolutionPriority
 *  com.adobe.internal.pdftoolkit.core.fontset.PDFFontSet
 *  com.adobe.internal.pdftoolkit.core.fontset.impl.PDFFontSetImpl
 */
package com.adobe.internal.pdf.tika;

import com.adobe.fontengine.font.Base14;
import com.adobe.fontengine.font.Font;
import com.adobe.fontengine.fontmanagement.FontResolutionPriority;
import com.adobe.internal.pdf.tika.PDFFontSetInterface;
import com.adobe.internal.pdftoolkit.core.fontset.PDFFontSet;
import com.adobe.internal.pdftoolkit.core.fontset.impl.PDFFontSetImpl;
import com.adobe.internal.pdftoolkit.pdf.document.PDFDocument;
import java.io.File;
import java.util.Locale;

public class PDFFontSetDefault
implements PDFFontSetInterface {
    private static final Font[] mBase14Fonts = new Font[]{Base14.courierBold, Base14.courierBoldOblique, Base14.courierOblique, Base14.courierRegular, Base14.helveticaBold, Base14.helveticaBoldOblique, Base14.helveticaOblique, Base14.helveticaRegular, Base14.symbol, Base14.timesBold, Base14.timesBoldItalic, Base14.timesItalic, Base14.timesRegular, Base14.zapfDingbats};

    public PDFFontSet getPdfFontSet() {
        return this.getBase14FontSet();
    }

    private PDFFontSet getBase14FontSet() {
        try {
            PDFFontSetImpl pdfFontSet = new PDFFontSetImpl();
            pdfFontSet.setResolutionPriority(FontResolutionPriority.LAST);
            for (int idxFont = 0; idxFont < mBase14Fonts.length; ++idxFont) {
                pdfFontSet.addFont(mBase14Fonts[idxFont]);
            }
            if (!pdfFontSet.hasRootFallback()) {
                pdfFontSet.addFallbackFont(PDFDocument.ROOT_LOCALE, Base14.courierRegular);
            }
            return pdfFontSet;
        }
        catch (Exception e) {
            throw new IllegalStateException("Internal error with built-in base 14 fonts", e);
        }
    }

    public File[] getFontDirectories() {
        return null;
    }

    public byte[] getFontSetStream() {
        return null;
    }
}