PdfBox-Android
PdfBox-Android copied to clipboard
I think I fixed a text rendering bug.
in PageDrawer.java --------------------------------------------------------------------
private void drawGlyph2D(Glyph2D glyph2D, PDFont font, int code, Vector displacement, AffineTransform at) throws IOException { PDGraphicsState state = getGraphicsState(); RenderingMode renderingMode = state.getTextState().getRenderingMode();
// Path path = glyph2D.getPathForCharacterCode(code); // -------> this may problem Path path = new Path(glyph2D.getPathForCharacterCode(code)); //-------> fix like this. or better way.
I think
'path.transform(at.toMatrix());' transforms the path within the cache.
As a result, while the first character is rendered correctly, subsequent cached paths are transformed incorrectly, leading to issues.
Please include the affected file.
Yes, I also found this issue and submitted the pr, but it has not been merged yet