Base14Font.java
4.9 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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
/*
* Decompiled with CFR 0_118.
*/
package com.adobe.fontengine.fontmanagement;
import com.adobe.fontengine.font.Base14;
import com.adobe.fontengine.font.FontData;
import com.adobe.fontengine.font.FontInputStream;
import com.adobe.fontengine.font.FontLoadingException;
import com.adobe.fontengine.font.InvalidFontException;
import com.adobe.fontengine.font.UnsupportedFontException;
import com.adobe.fontengine.font.opentype.FontFactory;
import com.adobe.fontengine.font.opentype.OpenTypeFont;
import com.adobe.fontengine.fontmanagement.URLFont;
import java.io.IOException;
import java.io.InputStream;
import java.io.ObjectInputStream;
import java.lang.ref.SoftReference;
import java.net.URL;
import java.util.HashMap;
import java.util.Iterator;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public final class Base14Font
extends URLFont {
static final long serialVersionUID = 1;
private final String mBase14CSSName;
private final String mBase14PSName;
private static final HashMap<String, HashMap<String, Object>> mBase14DescCache;
public Base14Font(String resourceName, String base14CSSName, String base14PSName) {
super(Base14.class.getResource(resourceName), 0);
this.mBase14CSSName = base14CSSName;
this.mBase14PSName = base14PSName;
}
/*
* WARNING - Removed try catching itself - possible behaviour change.
*/
@Override
protected synchronized FontData retrieveFontData() throws UnsupportedFontException, InvalidFontException, FontLoadingException {
FontData font = null;
try {
font = (FontData)this.fontRef.get();
if (font == null) {
FontInputStream stream = new FontInputStream(this.outlineFileURL.openStream());
try {
OpenTypeFont[] arr = FontFactory.load(stream, this.mBase14CSSName, this.mBase14PSName);
font = arr[this.index];
this.fontRef = new SoftReference<FontData>(font);
}
finally {
stream.close();
}
}
}
catch (IOException e) {
throw new FontLoadingException(e);
}
return font;
}
@Override
public String getCanonicalPath() {
return null;
}
@Override
public long getLength() {
return 0;
}
@Override
public long getLastModified() {
return 0;
}
@Override
public Object getCachedFontDescription(String key) {
if (mBase14DescCache == null) {
return null;
}
HashMap<String, Object> descMap = mBase14DescCache.get(this.mBase14PSName);
if (descMap == null) {
return null;
}
return descMap.get(key);
}
public Iterator<String> getCachedFontDescriptionIterator() {
return null;
}
@Override
public void setCachedFontDescription(String key, Object value) {
}
/*
* WARNING - Removed try catching itself - possible behaviour change.
* Unable to fully structure code
* Enabled aggressive block sorting
* Enabled unnecessary exception pruning
* Enabled aggressive exception aggregation
* Lifted jumps to return sites
*/
static {
block19 : {
inStm = null;
objInStm = null;
base14DescCache = null;
inStm = Base14.class.getResourceAsStream("Base14Cache");
objInStm = new ObjectInputStream(inStm);
try {
base14DescCache = (HashMap)objInStm.readObject();
}
catch (ClassNotFoundException e) {
// empty catch block
}
try {
if (objInStm != null) {
objInStm.close();
} else if (inStm != null) {
inStm.close();
}
break block19;
}
catch (Exception e) {}
** GOTO lbl44
catch (Exception e) {
try {
if (objInStm != null) {
objInStm.close();
} else if (inStm != null) {
inStm.close();
}
}
catch (Exception e) {}
catch (Throwable var4_7) {
try {
if (objInStm != null) {
objInStm.close();
throw var4_7;
}
if (inStm == null) throw var4_7;
inStm.close();
throw var4_7;
}
catch (Exception e) {
// empty catch block
}
throw var4_7;
}
}
}
Base14Font.mBase14DescCache = base14DescCache;
}
}