diff --git a/CHANGELOG.md b/CHANGELOG.md index ef6742c89..b8ed6f4e8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ All notable changes to this project will be documented in this file. ### Fixed - Exception when bundle selected - File path in window title for SWFs inside DefineBinaryData +- [#1863] Export to PDF - cannot read fonts with long CMAP ## [16.2.0] - 2022-11-08 ### Added @@ -2409,7 +2410,8 @@ All notable changes to this project will be documented in this file. ### Added - Initial public release -[Unreleased]: https://github.com/jindrapetrik/jpexs-decompiler/compare/version16.1.0...dev +[Unreleased]: https://github.com/jindrapetrik/jpexs-decompiler/compare/version16.2.0...dev +[16.2.0]: https://github.com/jindrapetrik/jpexs-decompiler/compare/version16.1.0...version16.2.0 [16.1.0]: https://github.com/jindrapetrik/jpexs-decompiler/compare/version16.0.4...version16.1.0 [16.0.4]: https://github.com/jindrapetrik/jpexs-decompiler/compare/version16.0.3...version16.0.4 [16.0.3]: https://github.com/jindrapetrik/jpexs-decompiler/compare/version16.0.2...version16.0.3 @@ -2536,6 +2538,7 @@ All notable changes to this project will be documented in this file. [alpha 9]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha8...alpha9 [alpha 8]: https://github.com/jindrapetrik/jpexs-decompiler/compare/alpha7...alpha8 [alpha 7]: https://github.com/jindrapetrik/jpexs-decompiler/releases/tag/alpha7 +[#1863]: https://www.free-decompiler.com/flash/issues/1863 [#1414]: https://www.free-decompiler.com/flash/issues/1414 [#1755]: https://www.free-decompiler.com/flash/issues/1755 [#1460]: https://www.free-decompiler.com/flash/issues/1460 diff --git a/lib/gnujpdf.jar b/lib/gnujpdf.jar index f97a11206..dabb6ad78 100644 Binary files a/lib/gnujpdf.jar and b/lib/gnujpdf.jar differ diff --git a/libsrc/gnujpdf/src/gnu/jpdf/TtfParser.java b/libsrc/gnujpdf/src/gnu/jpdf/TtfParser.java index b438d1ba5..58fe923d1 100644 --- a/libsrc/gnujpdf/src/gnu/jpdf/TtfParser.java +++ b/libsrc/gnujpdf/src/gnu/jpdf/TtfParser.java @@ -306,15 +306,9 @@ public class TtfParser { int idRangeOffset = readUnsignedShort(input); idRangeOffsets.add(idRangeOffset); } - - List glyphIndices = new ArrayList<>(); - long startA = input.getFilePointer(); - long a = startA; - for (; a < tableOffsets.get("cmap") + offset + length; a += 2) { - int glyphIndex = readUnsignedShort(input); - glyphIndices.add(glyphIndex); - } - + + long glyphIdArrayOffset = input.getFilePointer(); + for (int j = 0; j < segCount; j++) { for (int k = startCodes.get(j); k <= endCodes.get(j); k++) { if (k == 65535) { @@ -326,7 +320,8 @@ public class TtfParser { } else { int glyphIndex = (idRangeOffsets.get(j) - 2 * (segCount - j)) / 2 + (k - startCodes.get(j)); - int glyph = glyphIndices.get(glyphIndex); + input.seek(glyphIdArrayOffset + 2 * glyphIndex); + int glyph = readUnsignedShort(input); ctg.put(k, glyph); } }