/** * Some Type 1 fonts have an invalid Length2, see PDFBOX-3475. A negative /Length2 brings an * IllegalArgumentException in Arrays.copyOfRange(), a huge value eats up memory because of * padding. * * @param bytes Type 1 stream bytes * @param length1 Length1 from the Type 1 stream * @param length2 Length2 from the Type 1 stream * @return repaired Length2 value */ private int repairLength2(byte[] bytes, int length1, int length2) { // repair Length2 if necessary if (length2 < 0 || length2 > bytes.length - length1) { LOG.warn("Ignored invalid Length2 " + length2 + " for Type 1 font " + getName()); return bytes.length - length1; } return length2; }
unicode, name, getName(), encoding.getEncodingName())); String.format("No glyph for U+%04X in font %s", unicode, getName())); unicode, name, getName(), genericFont.getName(), encoding.getEncodingName())); String.format("No glyph for U+%04X in font %s (generic: %s)", unicode, getName(), genericFont.getName()));
unicode, name, getName(), encoding.getEncodingName())); String.format("No glyph for U+%04X in font %s", unicode, getName())); unicode, name, getName(), genericFont.getName(), encoding.getEncodingName())); String.format("No glyph for U+%04X in font %s (generic: %s)", unicode, getName(), genericFont.getName()));
LOG.warn("Ignored invalid Length1 " + length1 + " for Type 1 font " + getName());
unicode, name, getName(), encoding.getEncodingName())); String.format("No glyph for U+%04X in font %s", unicode, getName())); unicode, name, getName(), genericFont.getName(), encoding.getEncodingName())); String.format("No glyph for U+%04X in font %s (generic: %s)", unicode, getName(), genericFont.getName()));
/** * Some Type 1 fonts have an invalid Length2, see PDFBOX-3475. A negative /Length2 brings an * IllegalArgumentException in Arrays.copyOfRange(), a huge value eats up memory because of * padding. * * @param bytes Type 1 stream bytes * @param length1 Length1 from the Type 1 stream * @param length2 Length2 from the Type 1 stream * @return repaired Length2 value */ private int repairLength2(byte[] bytes, int length1, int length2) { // repair Length2 if necessary if (length2 < 0 || length2 > bytes.length - length1) { LOG.warn("Ignored invalid Length2 " + length2 + " for Type 1 font " + getName()); return bytes.length - length1; } return length2; }
/** * Some Type 1 fonts have an invalid Length2, see PDFBOX-3475. A negative /Length2 brings an * IllegalArgumentException in Arrays.copyOfRange(), a huge value eats up memory because of * padding. * * @param bytes Type 1 stream bytes * @param length1 Length1 from the Type 1 stream * @param length2 Length2 from the Type 1 stream * @return repaired Length2 value */ private int repairLength2(byte[] bytes, int length1, int length2) { // repair Length2 if necessary if (length2 < 0 || length2 > bytes.length - length1) { LOG.warn("Ignored invalid Length2 " + length2 + " for Type 1 font " + getName()); return bytes.length - length1; } return length2; }
LOG.warn("Ignored invalid Length1 " + length1 + " for Type 1 font " + getName());
LOG.warn("Ignored invalid Length1 " + length1 + " for Type 1 font " + getName());