float fontWidth = font.getWidthFromFont(code); if (fontWidth > 0 && // ignore spaces Math.abs(fontWidth - displacement.getX() * 1000) > 0.0001)
fontWidthOfSpace = getWidthFromFont(32);
width = getWidthFromFont(code); codeToWidthMap.put(code, width); return width;
float fontWidth = font.getWidthFromFont(code); if (fontWidth > 0 && // ignore spaces Math.abs(fontWidth - displacement.getX() * 1000) > 0.0001)
private boolean checkWidths(int glyphCode) throws IOException { org.apache.pdfbox.pdmodel.font.PDFont font = getFontFromResources(); float expectedWidth = font.getWidth(glyphCode); float foundWidth = font.getWidthFromFont(glyphCode); // consistent is defined to be a difference of no more than 1/1000 unit. return Math.abs(foundWidth - expectedWidth) <= 1; }
width = getWidthFromFont(code); codeToWidthMap.put(code, width); return width;
width = getWidthFromFont(code); codeToWidthMap.put(code, width); return width;
fontWidthOfSpace = getWidthFromFont(32);
float fontWidth = font.getWidthFromFont(code); if (fontWidth > 0 && // ignore spaces Math.abs(fontWidth - displacement.getX() * 1000) > 0.0001)
fontWidthOfSpace = getWidthFromFont(32);
float fontWidth = font.getWidthFromFont(code); if (fontWidth > 0 && // ignore spaces Math.abs(fontWidth - displacement.getX() * 1000) > 0.0001)