Пример #1
0
  /** write TrueType file to the random access file */
  public void write() throws IOException {
    m_cmap.write();
    // hmtx must be written before hhea
    m_hmtx.write();
    m_hhea.write();

    m_glyf.write();
    m_loca.write();

    m_head.setCheckSumAdjustment(0);
    m_head.write();
    m_maxp.write(); // must be written after m_glyf
    m_hdmx.write();
    m_name.write();
    m_post.write();
    m_os2.write();

    writeTableDirectory();
    byte[] tableDir = toByteArray();
    for (FontFormatWriter table : m_tables) {
      m_buffer.write(table.toByteArray());
    } // for table

    long checkSum = 0xb1b0afba - (0xffffffff & getCheckSum());
    m_head.setCheckSumAdjustment(checkSum);
    m_head.reset();
    m_head.write();

    reset();

    m_buffer.write(tableDir);
    for (FontFormatWriter table : m_tables) {
      m_buffer.write(table.toByteArray());
    } // for table

    //		FileOutputStream writer = new FileOutputStream(m_file);
    //		writer.write(toByteArray());
    //		writer.close();
  }
Пример #2
0
 public void setFontVersion(String a_version) {
   m_name.m_version = a_version;
 }
Пример #3
0
 public void setManufacturer(String a_manufacturer) {
   m_name.m_manufacturer = a_manufacturer;
 }
Пример #4
0
 public void setCopyrightYear(String a_year) {
   m_name.m_year = a_year;
 }
Пример #5
0
 public void setFontFamilyName(String a_name) {
   m_name.m_familyName = a_name;
 }