|
|
|
|
|
|
|
|
unicodeMappings.add(new UnicodeMapping(this, glyphIdx, j)); |
|
|
unicodeMappings.add(new UnicodeMapping(this, glyphIdx, j)); |
|
|
mtxTab[glyphIdx].getUnicodeIndex().add(j); |
|
|
mtxTab[glyphIdx].getUnicodeIndex().add(j); |
|
|
|
|
|
|
|
|
if (encodingID == 0 && j >= 0xF020 && j <= 0xF0FF) { |
|
|
|
|
|
//Experimental: Mapping 0xF020-0xF0FF to 0x0020-0x00FF |
|
|
|
|
|
//Tested with Wingdings and Symbol TTF fonts which map their |
|
|
|
|
|
//glyphs in the region 0xF020-0xF0FF. |
|
|
|
|
|
int mapped = j - 0xF000; |
|
|
|
|
|
if (!eightBitGlyphs.get(mapped)) { |
|
|
|
|
|
//Only map if Unicode code point hasn't been mapped before |
|
|
|
|
|
unicodeMappings.add(new UnicodeMapping(this, glyphIdx, mapped)); |
|
|
|
|
|
mtxTab[glyphIdx].getUnicodeIndex().add(mapped); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
mapSymbol(encodingID, j, eightBitGlyphs, glyphIdx); |
|
|
|
|
|
|
|
|
// Also add winAnsiWidth |
|
|
// Also add winAnsiWidth |
|
|
List<Integer> v = ansiIndex.get(j); |
|
|
List<Integer> v = ansiIndex.get(j); |
|
|
|
|
|
|
|
|
+ mtxTab.length); |
|
|
+ mtxTab.length); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
mapSymbol(encodingID, j, eightBitGlyphs, glyphIdx); |
|
|
|
|
|
|
|
|
// Also add winAnsiWidth |
|
|
// Also add winAnsiWidth |
|
|
List<Integer> v = ansiIndex.get(j); |
|
|
List<Integer> v = ansiIndex.get(j); |
|
|
if (v != null) { |
|
|
if (v != null) { |
|
|
|
|
|
|
|
|
return true; |
|
|
return true; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
private void mapSymbol(int encodingID, int unicodeIndex, BitSet eightBitGlyphs, int glyphIdx) { |
|
|
|
|
|
if (encodingID == 0 && unicodeIndex >= 0xF020 && unicodeIndex <= 0xF0FF) { |
|
|
|
|
|
/* Experimental: Mapping 0xF020-0xF0FF to 0x0020-0x00FF |
|
|
|
|
|
Tested with Wingdings and Symbol TTF fonts which map their |
|
|
|
|
|
glyphs in the region 0xF020-0xF0FF. */ |
|
|
|
|
|
int mapped = unicodeIndex - 0xF000; |
|
|
|
|
|
if (!eightBitGlyphs.get(mapped)) { |
|
|
|
|
|
//Only map if Unicode code point hasn't been mapped before |
|
|
|
|
|
unicodeMappings.add(new UnicodeMapping(this, glyphIdx, mapped)); |
|
|
|
|
|
mtxTab[glyphIdx].getUnicodeIndex().add(mapped); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
private boolean isInPrivateUseArea(int start, int end) { |
|
|
private boolean isInPrivateUseArea(int start, int end) { |
|
|
return (isInPrivateUseArea(start) || isInPrivateUseArea(end)); |
|
|
return (isInPrivateUseArea(start) || isInPrivateUseArea(end)); |
|
|
} |
|
|
} |