private static DictData readDictData(CFFDataInput input, int dictSize) throws IOException { DictData dict = new DictData(); int endPosition = input.getPosition() + dictSize; while (input.getPosition() < endPosition) { dict.add(readEntry(input)); } return dict; }
private static DictData readDictData(CFFDataInput input) throws IOException { DictData dict = new DictData(); while (input.hasRemaining()) { dict.add(readEntry(input)); } return dict; }
@Override public GeneralPath getPath(String selector) throws IOException { int cid = selectorToCID(selector); return getType2CharString(cid).getPath(); }
private void readSupplement(CFFDataInput dataInput, CFFBuiltInEncoding encoding) throws IOException { encoding.nSups = dataInput.readCard8(); encoding.supplement = new CFFBuiltInEncoding.Supplement[encoding.nSups]; for (int i = 0; i < encoding.supplement.length; i++) { CFFBuiltInEncoding.Supplement supplement = new CFFBuiltInEncoding.Supplement(); supplement.code = dataInput.readCard8(); supplement.sid = dataInput.readSID(); supplement.name = readString(supplement.sid); encoding.supplement[i] = supplement; encoding.add(supplement.code, supplement.sid, readString(supplement.sid)); } }
@Override public float getWidth(String name) throws IOException { return getType1CharString(name).getWidth(); }
@Override public float getWidth(String selector) throws IOException { int cid = selectorToCID(selector); return getType2CharString(cid).getWidth(); }
private static Header readHeader(CFFDataInput input) throws IOException { Header cffHeader = new Header(); cffHeader.major = input.readCard8(); cffHeader.minor = input.readCard8(); cffHeader.hdrSize = input.readCard8(); cffHeader.offSize = input.readOffSize(); return cffHeader; }
@Override public GeneralPath getPath(String name) throws IOException { return getType1CharString(name).getPath(); }
@Override public int getGIDForCID(int cid) { for (RangeMapping mapping : rangesCID2GID) { if (mapping.isInReverseRange(cid)) { return mapping.mapReverseValue(cid); } } return super.getGIDForCID(cid); }
@Override public int getCIDForGID(int gid) { for (RangeMapping mapping : rangesCID2GID) { if (mapping.isInRange(gid)) { return mapping.mapValue(gid); } } return super.getCIDForGID(gid); }
private String getString(DictData dict, String name) throws IOException { DictData.Entry entry = dict.getEntry(name); return entry != null ? readString(entry.getNumber(0).intValue()) : null; }
private static CFFOperator readOperator(CFFDataInput input, int b0) throws IOException { CFFOperator.Key key = readOperatorKey(input, b0); return CFFOperator.getOperator(key); }
private static CFFOperator.Key readOperatorKey(CFFDataInput input, int b0) throws IOException { if (b0 == 12) { int b1 = input.readUnsignedByte(); return new CFFOperator.Key(b0, b1); } return new CFFOperator.Key(b0); }
private CharStringCommand readCommand(DataInput input, int b0) throws IOException { if (b0 == 12) { int b1 = input.readUnsignedByte(); return new CharStringCommand(b0, b1); } return new CharStringCommand(b0); }