PDFFontStretch.java
2.25 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
/*
* Decompiled with CFR 0_118.
*
* Could not load the following classes:
* com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException
* com.adobe.internal.pdftoolkit.core.types.ASName
*/
package com.adobe.internal.pdftoolkit.pdf.graphics.font;
import com.adobe.internal.pdftoolkit.core.exceptions.PDFInvalidParameterException;
import com.adobe.internal.pdftoolkit.core.types.ASName;
/*
* This class specifies class file version 49.0 but uses Java 6 signatures. Assumed Java 6.
*/
public enum PDFFontStretch {
ULTRA_CONDENSED(ASName.k_UltraCondensed),
EXTRA_CONDENSED(ASName.k_ExtraCondensed),
CONDENSED(ASName.k_Condensed),
SEMI_CONDENSED(ASName.k_SemiCondensed),
NORMAL(ASName.k_Normal),
SEMI_EXPANDED(ASName.k_SemiExpanded),
EXPANDED(ASName.k_Expanded),
EXTRA_EXPANDED(ASName.k_ExtraExpanded),
ULTRA_EXPANDED(ASName.k_UltraExpanded);
private final ASName stretch;
private PDFFontStretch(ASName stretch) {
this.stretch = stretch;
}
public String toString() {
return this.stretch.asString(true);
}
ASName getValue() {
return this.stretch;
}
static final PDFFontStretch newInstance(ASName stretchValue) throws PDFInvalidParameterException {
PDFFontStretch stretch = null;
if (stretchValue == ASName.k_UltraCondensed) {
stretch = ULTRA_CONDENSED;
} else if (stretchValue == ASName.k_ExtraCondensed) {
stretch = EXTRA_CONDENSED;
} else if (stretchValue == ASName.k_Condensed) {
stretch = CONDENSED;
} else if (stretchValue == ASName.k_SemiCondensed) {
stretch = SEMI_CONDENSED;
} else if (stretchValue == ASName.k_Normal) {
stretch = NORMAL;
} else if (stretchValue == ASName.k_SemiExpanded) {
stretch = SEMI_EXPANDED;
} else if (stretchValue == ASName.k_Expanded) {
stretch = EXPANDED;
} else if (stretchValue == ASName.k_ExtraExpanded) {
stretch = EXTRA_EXPANDED;
} else if (stretchValue == ASName.k_UltraExpanded) {
stretch = ULTRA_EXPANDED;
} else {
throw new PDFInvalidParameterException("illegal font stretch value");
}
return stretch;
}
}