|
|
@@ -173,7 +173,21 @@ public class Type1FontLoader extends FontLoader { |
|
|
|
addUnencodedBasedOnAFM(afm); |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (pfm.getCharSet() >= 0 && pfm.getCharSet() <= 2) { |
|
|
|
if (pfm.getCharSet() == 2 && !pfm.getCharSetName().equals("Symbol")) { |
|
|
|
int[] table = new int[256]; |
|
|
|
String[] charNameMap = new String[256]; |
|
|
|
int j = 0; |
|
|
|
for (int i = pfm.getFirstChar(); i < pfm.getLastChar(); i++) { |
|
|
|
if (j < table.length) { |
|
|
|
table[j] = i; |
|
|
|
table[j + 1] = i; |
|
|
|
j += 2; |
|
|
|
} |
|
|
|
charNameMap[i] = String.format("x%03o", i); |
|
|
|
} |
|
|
|
CodePointMapping mapping = new CodePointMapping("custom", table, charNameMap); |
|
|
|
singleFont.setEncoding(mapping); |
|
|
|
} else if (pfm.getCharSet() >= 0 && pfm.getCharSet() <= 2) { |
|
|
|
singleFont.setEncoding(pfm.getCharSetName() + "Encoding"); |
|
|
|
} else { |
|
|
|
log.warn("The PFM reports an unsupported encoding (" |