FileDocCategorySizeDatePackage
FontTable.javaAPI DocApache Poi 3.0.11898Mon Jan 01 18:55:24 GMT 2007org.apache.poi.hdf.extractor

FontTable

public class FontTable extends Object
Comment me
author
Ryan Ackley

Fields Summary
String[]
fontNames
Constructors Summary
public FontTable(byte[] fontTable)

    int size = Utils.convertBytesToShort(fontTable, 0);
    fontNames = new String[size];

    int currentIndex = 4;
    for(int x = 0; x < size; x++)
    {
      byte ffnLength = fontTable[currentIndex];

      int nameOffset = currentIndex + 40;
      StringBuffer nameBuf = new StringBuffer();
      char ch = Utils.getUnicodeCharacter(fontTable, nameOffset);
      while(ch != '\0")
      {
        nameBuf.append(ch);
        nameOffset += 2;
        ch = Utils.getUnicodeCharacter(fontTable, nameOffset);
      }
      fontNames[x] = nameBuf.toString();
      if(fontNames[x].startsWith("Times"))
      {
        fontNames[x] = "Times";
      }

      currentIndex += ffnLength + 1;
    }

  
Methods Summary
public java.lang.StringgetFont(int index)

    return fontNames[index];