PDFFontSetDefault.java
2.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
/*
* 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;
}
}