String name = tok.nextToken(); char uni = (char) Integer.parseInt(tok.nextToken(), 16); int uniName = AdobeGlyphList.nameToUnicode(name); int orderK; if (order.startsWith("'")) { String hex = tok.nextToken(); int uni = Integer.parseInt(hex, 16) % 0x10000; String name = AdobeGlyphList.unicodeToName(uni); if (name == null) { name = "uni" + hex;
public boolean addSymbol(int code, int unicode) { if (code < 0 || code > 255) { return false; } String glyphName = AdobeGlyphList.unicodeToName(unicode); if (glyphName != null) { unicodeToCode.put(unicode, code); codeToUnicode[code] = unicode; differences[code] = glyphName; unicodeDifferences.put(unicode, unicode); return true; } else { return false; } }
/** * Find glyph by glyph name. * @param name Glyph name * @return Glyph instance if found, otherwise null. */ public Glyph getGlyph(String name) { int unicode = AdobeGlyphList.nameToUnicode(name); if (unicode != -1) { return getGlyph((int) unicode); } else { return null; } }
public boolean addSymbol(int code, int unicode) { if (code < 0 || code > 255) { return false; } String glyphName = AdobeGlyphList.unicodeToName(unicode); if (glyphName != null) { unicodeToCode.put(unicode, code); codeToUnicode[code] = unicode; differences[code] = glyphName; unicodeDifferences.put(unicode, unicode); return true; } else { return false; } }
/** * Find glyph by glyph name. * @param name Glyph name * @return Glyph instance if found, otherwise null. */ public Glyph getGlyph(String name) { int unicode = AdobeGlyphList.nameToUnicode(name); if (unicode != -1) { return getGlyph((int) unicode); } else { return null; } }
String name = tok.nextToken(); char uni = (char) Integer.parseInt(tok.nextToken(), 16); int uniName = AdobeGlyphList.nameToUnicode(name); int orderK; if (order.startsWith("'")) { String hex = tok.nextToken(); int uni = Integer.parseInt(hex, 16) % 0x10000; String name = AdobeGlyphList.unicodeToName(uni); if (name == null) { name = "uni" + hex;
protected void fillStandardEncoding() { int[] encoded = PdfEncodings.standardEncoding; for (int ch = 0; ch < 256; ++ch) { int uni = encoded[ch]; String name = AdobeGlyphList.unicodeToName(uni); if (name == null) { name = NOTDEF; } else { unicodeToCode.put(uni, ch); codeToUnicode[ch] = uni; unicodeDifferences.put(uni, uni); } if (differences != null) { differences[ch] = name; } } }
int unicode = AdobeGlyphList.nameToUnicode(N); Glyph glyph = new Glyph(C, WX, unicode, B); if (C >= 0) { Integer width = (int) Float.parseFloat(tok.nextToken()); int firstUni = AdobeGlyphList.nameToUnicode(first); int secondUni = AdobeGlyphList.nameToUnicode(second);
protected void fillStandardEncoding() { int[] encoded = PdfEncodings.standardEncoding; for (int ch = 0; ch < 256; ++ch) { int uni = encoded[ch]; String name = AdobeGlyphList.unicodeToName(uni); if (name == null) { name = NOTDEF; } else { unicodeToCode.put(uni, ch); codeToUnicode[ch] = uni; unicodeDifferences.put(uni, uni); } if (differences != null) { differences[ch] = name; } } }
int unicode = AdobeGlyphList.nameToUnicode(N); Glyph glyph = new Glyph(C, WX, unicode, B); if (C >= 0) { Integer width = (int) Float.parseFloat(tok.nextToken()); int firstUni = AdobeGlyphList.nameToUnicode(first); int secondUni = AdobeGlyphList.nameToUnicode(second);
protected void fillNamedEncoding() { PdfEncodings.convertToBytes(" ", baseEncoding); // check if the encoding exists boolean stdEncoding = PdfEncodings.WINANSI.equals(baseEncoding) || PdfEncodings.MACROMAN.equals(baseEncoding); if (!stdEncoding && differences == null) { differences = new String[256]; } byte[] b = new byte[256]; for (int k = 0; k < 256; ++k) { b[k] = (byte) k; } String str = PdfEncodings.convertToString(b, baseEncoding); char[] encoded = str.toCharArray(); for (int ch = 0; ch < 256; ++ch) { char uni = encoded[ch]; String name = AdobeGlyphList.unicodeToName(uni); if (name == null) { name = NOTDEF; } else { unicodeToCode.put(uni, ch); codeToUnicode[ch] = (int) uni; unicodeDifferences.put(uni, uni); } if (differences != null) { differences[ch] = name; } } }
int unicode = AdobeGlyphList.nameToUnicode(glyphName); if (unicode != -1) { fontEncoding.codeToUnicode[currentNumber] = (int) unicode;
protected void fillNamedEncoding() { PdfEncodings.convertToBytes(" ", baseEncoding); // check if the encoding exists boolean stdEncoding = PdfEncodings.WINANSI.equals(baseEncoding) || PdfEncodings.MACROMAN.equals(baseEncoding); if (!stdEncoding && differences == null) { differences = new String[256]; } byte[] b = new byte[256]; for (int k = 0; k < 256; ++k) { b[k] = (byte) k; } String str = PdfEncodings.convertToString(b, baseEncoding); char[] encoded = str.toCharArray(); for (int ch = 0; ch < 256; ++ch) { char uni = encoded[ch]; String name = AdobeGlyphList.unicodeToName(uni); if (name == null) { name = NOTDEF; } else { unicodeToCode.put(uni, ch); codeToUnicode[ch] = (int) uni; unicodeDifferences.put(uni, uni); } if (differences != null) { differences[ch] = name; } } }
int unicode = AdobeGlyphList.nameToUnicode(glyphName.getValue()); if (unicode != -1 && fontEncoding.canEncode(unicode)) { int code = fontEncoding.convertToByte(unicode);
private static void fillDifferences(DocFontEncoding fontEncoding, CMapToUnicode toUnicode) { IntHashtable byte2uni = toUnicode.createDirectMapping(); for(Integer code : byte2uni.getKeys()) { int unicode = byte2uni.get((int) code); String glyphName = AdobeGlyphList.unicodeToName(unicode); fontEncoding.codeToUnicode[(int) code] = unicode; fontEncoding.unicodeToCode.put(unicode, (int) code); fontEncoding.differences[(int) code] = glyphName; fontEncoding.unicodeDifferences.put(unicode, unicode); } } }