private static long readLong(CFFDataInput input) throws IOException { return (input.readCard16() << 16) | input.readCard16(); }
/** * Read the Format 3 of the FDSelect data structure. * * @param dataInput * @param format * @param nGlyphs * @param ros * @return the Format 3 of the FDSelect data * @throws IOException */ private static Format3FDSelect readFormat3FDSelect(CFFDataInput dataInput, int format, int nGlyphs, CFFCIDFont ros) throws IOException { Format3FDSelect fdselect = new Format3FDSelect(ros); fdselect.format = format; fdselect.nbRanges = dataInput.readCard16(); fdselect.range3 = new Range3[fdselect.nbRanges]; for (int i = 0; i < fdselect.nbRanges; i++) { Range3 r3 = new Range3(); r3.first = dataInput.readCard16(); r3.fd = dataInput.readCard8(); fdselect.range3[i] = r3; } fdselect.sentinel = dataInput.readCard16(); return fdselect; }
private static int[] readIndexDataOffsets(CFFDataInput input) throws IOException { int count = input.readCard16(); if (count == 0) { return null; } int offSize = input.readOffSize(); int[] offsets = new int[count+1]; for (int i = 0; i <= count; i++) { int offset = input.readOffset(offSize); if (offset > input.length()) { throw new IOException("illegal offset value " + offset + " in CFF font"); } offsets[i] = offset; } return offsets; }
int nLeft = dataInput.readCard16(); if (!isCIDFont)
private static long readLong(CFFDataInput input) throws IOException { return (input.readCard16() << 16) | input.readCard16(); }
private static long readLong(CFFDataInput input) throws IOException { return (input.readCard16() << 16) | input.readCard16(); }
private static long readLong(CFFDataInput input) throws IOException { return (input.readCard16() << 16) | input.readCard16(); }
/** * Read the Format 3 of the FDSelect data structure. * * @param dataInput * @param format * @param nGlyphs * @param ros * @return the Format 3 of the FDSelect data * @throws IOException */ private static Format3FDSelect readFormat3FDSelect(CFFDataInput dataInput, int format, int nGlyphs, CFFCIDFont ros) throws IOException { Format3FDSelect fdselect = new Format3FDSelect(ros); fdselect.format = format; fdselect.nbRanges = dataInput.readCard16(); fdselect.range3 = new Range3[fdselect.nbRanges]; for (int i = 0; i < fdselect.nbRanges; i++) { Range3 r3 = new Range3(); r3.first = dataInput.readCard16(); r3.fd = dataInput.readCard8(); fdselect.range3[i] = r3; } fdselect.sentinel = dataInput.readCard16(); return fdselect; }
/** * Read the Format 3 of the FDSelect data structure. * * @param dataInput * @param format * @param nGlyphs * @param ros * @return the Format 3 of the FDSelect data * @throws IOException */ private static Format3FDSelect readFormat3FDSelect(CFFDataInput dataInput, int format, int nGlyphs, CFFCIDFont ros) throws IOException { Format3FDSelect fdselect = new Format3FDSelect(ros); fdselect.format = format; fdselect.nbRanges = dataInput.readCard16(); fdselect.range3 = new Range3[fdselect.nbRanges]; for (int i = 0; i < fdselect.nbRanges; i++) { Range3 r3 = new Range3(); r3.first = dataInput.readCard16(); r3.fd = dataInput.readCard8(); fdselect.range3[i] = r3; } fdselect.sentinel = dataInput.readCard16(); return fdselect; }
private int getSIDFromGIDFormat(int gid, int format) throws IOException { int glyphCount = 0; while (true) { int oldGlyphCount = glyphCount; int start = cffData.readSID(); glyphCount += ((format == 1) ? cffData.readCard8() : cffData.readCard16()) + 1; if (gid <= glyphCount) { return start + (gid - oldGlyphCount) - 1; } } }
private Format3FDSelect readFormat3FDSelect() throws IOException { Format3FDSelect newFDs = new Format3FDSelect(); newFDs.setFormat(3); int rangeCount = cffData.readCard16(); newFDs.setRangeCount(rangeCount); Map<Integer, Integer> ranges = new LinkedHashMap<Integer, Integer>(); for (int i = 0; i < rangeCount; i++) { int first = cffData.readCard16(); int fd = cffData.readCard8(); ranges.put(first, fd); } newFDs.setRanges(ranges); newFDs.setSentinelGID(cffData.readCard16()); return newFDs; }
private static int[] readIndexDataOffsets(CFFDataInput input) throws IOException { int count = input.readCard16(); if (count == 0) { return null; } int offSize = input.readOffSize(); int[] offsets = new int[count+1]; for (int i = 0; i <= count; i++) { int offset = input.readOffset(offSize); if (offset > input.length()) { throw new IOException("illegal offset value " + offset + " in CFF font"); } offsets[i] = offset; } return offsets; }
private static int[] readIndexDataOffsets(CFFDataInput input) throws IOException { int count = input.readCard16(); if (count == 0) { return null; } int offSize = input.readOffSize(); int[] offsets = new int[count+1]; for (int i = 0; i <= count; i++) { int offset = input.readOffset(offSize); if (offset > input.length()) { throw new IOException("illegal offset value " + offset + " in CFF font"); } offsets[i] = offset; } return offsets; }
int nLeft = dataInput.readCard16(); if (!isCIDFont)
int nLeft = dataInput.readCard16(); if (!isCIDFont)
setNumObjects(cffData.readCard16()); setOffSize(cffData.readOffSize()); int[] offsets = new int[getNumObjects() + 1]; break; case 2: offsets[i] = cffData.readCard16(); break; case 3: