@Override public float getWidthFromFont(int code) throws IOException { int cid = codeToCID(code); float width; if (cidFont != null) { width = getType2CharString(cid).getWidth(); } else if (isEmbedded && t1Font instanceof CFFType1Font) { width = ((CFFType1Font)t1Font).getType2CharString(cid).getWidth(); } else { width = t1Font.getWidth(getGlyphName(code)); } Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
@Override public boolean hasGlyph(int code) throws IOException { int cid = codeToCID(code); Type2CharString charstring = getType2CharString(cid); if (charstring != null) { return charstring.getGID() != 0; } else if (isEmbedded && t1Font instanceof CFFType1Font) { return ((CFFType1Font)t1Font).getType2CharString(cid).getGID() != 0; } else { return t1Font.hasGlyph(getGlyphName(code)); } }
@Override public GeneralPath getPath(int code) throws IOException { int cid = codeToCID(code); if (cid2gid != null && isEmbedded) { // PDFBOX-4093: despite being a type 0 font, there is a CIDToGIDMap cid = cid2gid[cid]; } Type2CharString charstring = getType2CharString(cid); if (charstring != null) { return charstring.getPath(); } else if (isEmbedded && t1Font instanceof CFFType1Font) { return ((CFFType1Font)t1Font).getType2CharString(cid).getPath(); } else { return t1Font.getPath(getGlyphName(code)); } }
@Override public float getWidthFromFont(int code) throws IOException { int cid = codeToCID(code); float width; if (cidFont != null) { width = getType2CharString(cid).getWidth(); } else if (isEmbedded && t1Font instanceof CFFType1Font) { width = ((CFFType1Font)t1Font).getType2CharString(cid).getWidth(); } else { width = t1Font.getWidth(getGlyphName(code)); } Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
@Override public float getWidthFromFont(int code) throws IOException { int cid = codeToCID(code); float width; if (cidFont != null) { width = getType2CharString(cid).getWidth(); } else if (isEmbedded && t1Font instanceof CFFType1Font) { width = ((CFFType1Font)t1Font).getType2CharString(cid).getWidth(); } else { width = t1Font.getWidth(getGlyphName(code)); } Point2D p = new Point2D.Float(width, 0); fontMatrixTransform.transform(p, p); return (float)p.getX(); }
@Override public boolean hasGlyph(int code) throws IOException { int cid = codeToCID(code); Type2CharString charstring = getType2CharString(cid); if (charstring != null) { return charstring.getGID() != 0; } else if (isEmbedded && t1Font instanceof CFFType1Font) { return ((CFFType1Font)t1Font).getType2CharString(cid).getGID() != 0; } else { return t1Font.hasGlyph(getGlyphName(code)); } }
@Override public boolean hasGlyph(int code) throws IOException { int cid = codeToCID(code); Type2CharString charstring = getType2CharString(cid); if (charstring != null) { return charstring.getGID() != 0; } else if (isEmbedded && t1Font instanceof CFFType1Font) { return ((CFFType1Font)t1Font).getType2CharString(cid).getGID() != 0; } else { return t1Font.hasGlyph(getGlyphName(code)); } }
@Override public GeneralPath getPath(int code) throws IOException { int cid = codeToCID(code); Type2CharString charstring = getType2CharString(cid); if (charstring != null) { return charstring.getPath(); } else if (isEmbedded && t1Font instanceof CFFType1Font) { return ((CFFType1Font)t1Font).getType2CharString(cid).getPath(); } else { return t1Font.getPath(getGlyphName(code)); } }
@Override public GeneralPath getPath(int code) throws IOException { int cid = codeToCID(code); if (cid2gid != null && isEmbedded) { // PDFBOX-4093: despite being a type 0 font, there is a CIDToGIDMap cid = cid2gid[cid]; } Type2CharString charstring = getType2CharString(cid); if (charstring != null) { return charstring.getPath(); } else if (isEmbedded && t1Font instanceof CFFType1Font) { return ((CFFType1Font)t1Font).getType2CharString(cid).getPath(); } else { return t1Font.getPath(getGlyphName(code)); } }