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(); }
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(); }