@Override public BoundingBox getFontBBox() throws IOException { short xMin = getHeader().getXMin(); short xMax = getHeader().getXMax(); short yMin = getHeader().getYMin(); short yMax = getHeader().getYMax(); float scale = 1000f / getUnitsPerEm(); return new BoundingBox(xMin * scale, yMin * scale, xMax * scale, yMax * scale); }
private byte[] buildHeadTable() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(bos); HeaderTable h = ttf.getHeader(); writeFixed(out, h.getVersion()); writeFixed(out, h.getFontRevision()); writeUint32(out, 0); // h.getCheckSumAdjustment() writeUint32(out, h.getMagicNumber()); writeUint16(out, h.getFlags()); writeUint16(out, h.getUnitsPerEm()); writeLongDateTime(out, h.getCreated()); writeLongDateTime(out, h.getModified()); writeSInt16(out, h.getXMin()); writeSInt16(out, h.getYMin()); writeSInt16(out, h.getXMax()); writeSInt16(out, h.getYMax()); writeUint16(out, h.getMacStyle()); writeUint16(out, h.getLowestRecPPEM()); writeSInt16(out, h.getFontDirectionHint()); // force long format of 'loca' table writeSInt16(out, (short)1); // h.getIndexToLocFormat() writeSInt16(out, h.getGlyphDataFormat()); out.flush(); return bos.toByteArray(); }
PDRectangle rect = new PDRectangle(); float scaling = 1000f / header.getUnitsPerEm(); rect.setLowerLeftX(header.getXMin() * scaling); rect.setLowerLeftY(header.getYMin() * scaling); rect.setUpperRightX(header.getXMax() * scaling);
@Override public BoundingBox getFontBBox() throws IOException { short xMin = getHeader().getXMin(); short xMax = getHeader().getXMax(); short yMin = getHeader().getYMin(); short yMax = getHeader().getYMax(); float scale = 1000f / getUnitsPerEm(); return new BoundingBox(xMin * scale, yMin * scale, xMax * scale, yMax * scale); }
@Override public BoundingBox getFontBBox() throws IOException { short xMin = getHeader().getXMin(); short xMax = getHeader().getXMax(); short yMin = getHeader().getYMin(); short yMax = getHeader().getYMax(); float scale = 1000f / getUnitsPerEm(); return new BoundingBox(xMin * scale, yMin * scale, xMax * scale, yMax * scale); }
private byte[] buildHeadTable() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(bos); HeaderTable h = ttf.getHeader(); writeFixed(out, h.getVersion()); writeFixed(out, h.getFontRevision()); writeUint32(out, 0); // h.getCheckSumAdjustment() writeUint32(out, h.getMagicNumber()); writeUint16(out, h.getFlags()); writeUint16(out, h.getUnitsPerEm()); writeLongDateTime(out, h.getCreated()); writeLongDateTime(out, h.getModified()); writeSInt16(out, h.getXMin()); writeSInt16(out, h.getYMin()); writeSInt16(out, h.getXMax()); writeSInt16(out, h.getYMax()); writeUint16(out, h.getMacStyle()); writeUint16(out, h.getLowestRecPPEM()); writeSInt16(out, h.getFontDirectionHint()); // force long format of 'loca' table writeSInt16(out, (short)1); // h.getIndexToLocFormat() writeSInt16(out, h.getGlyphDataFormat()); out.flush(); return bos.toByteArray(); }
private byte[] buildHeadTable() throws IOException { ByteArrayOutputStream bos = new ByteArrayOutputStream(); DataOutputStream out = new DataOutputStream(bos); HeaderTable h = ttf.getHeader(); writeFixed(out, h.getVersion()); writeFixed(out, h.getFontRevision()); writeUint32(out, 0); // h.getCheckSumAdjustment() writeUint32(out, h.getMagicNumber()); writeUint16(out, h.getFlags()); writeUint16(out, h.getUnitsPerEm()); writeLongDateTime(out, h.getCreated()); writeLongDateTime(out, h.getModified()); writeSInt16(out, h.getXMin()); writeSInt16(out, h.getYMin()); writeSInt16(out, h.getXMax()); writeSInt16(out, h.getYMax()); writeUint16(out, h.getMacStyle()); writeUint16(out, h.getLowestRecPPEM()); writeSInt16(out, h.getFontDirectionHint()); // force long format of 'loca' table writeSInt16(out, (short)1); // h.getIndexToLocFormat() writeSInt16(out, h.getGlyphDataFormat()); out.flush(); return bos.toByteArray(); }
PDRectangle rect = new PDRectangle(); float scaling = 1000f / header.getUnitsPerEm(); rect.setLowerLeftX(header.getXMin() * scaling); rect.setLowerLeftY(header.getYMin() * scaling); rect.setUpperRightX(header.getXMax() * scaling);
PDRectangle rect = new PDRectangle(); float scaling = 1000f / header.getUnitsPerEm(); rect.setLowerLeftX(header.getXMin() * scaling); rect.setLowerLeftY(header.getYMin() * scaling); rect.setUpperRightX(header.getXMax() * scaling);