org.apache.poi.hslf.record
Class FontCollection

java.lang.Object
  extended by org.apache.poi.hslf.record.Record
      extended by org.apache.poi.hslf.record.RecordContainer
          extended by org.apache.poi.hslf.record.FontCollection

public final class FontCollection
extends RecordContainer

FontCollection ia a container that holds information about all the fonts in the presentation.

Author:
Yegor Kozlov

Field Summary
 
Fields inherited from class org.apache.poi.hslf.record.RecordContainer
_children
 
Fields inherited from class org.apache.poi.hslf.record.Record
logger
 
Constructor Summary
protected FontCollection(byte[] source, int start, int len)
           
 
Method Summary
 int addFont(java.lang.String name)
          Add font with the specified name to the font collection.
 int addFont(java.lang.String name, int charset, int flags, int type, int pitch)
           
 int getFontIndex(java.lang.String name)
           
 java.lang.String getFontWithId(int id)
          Get the name of the font at the given ID, or null if there is no font at that ID.
 int getNumberOfFonts()
           
 long getRecordType()
          Return the type, which is 2005
 void writeOut(java.io.OutputStream out)
          Write the contents of the record back, so it can be written to disk
 
Methods inherited from class org.apache.poi.hslf.record.RecordContainer
addChildAfter, addChildBefore, appendChildRecord, findFirstOfType, getChildRecords, handleParentAwareRecords, isAnAtom, moveChildBefore, moveChildrenAfter, moveChildrenBefore, removeChild, setChildRecord, writeOut
 
Methods inherited from class org.apache.poi.hslf.record.Record
buildRecordAtOffset, createRecordForType, findChildRecords, writeLittleEndian, writeLittleEndian
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FontCollection

protected FontCollection(byte[] source,
                         int start,
                         int len)
Method Detail

getRecordType

public long getRecordType()
Return the type, which is 2005

Specified by:
getRecordType in class Record

writeOut

public void writeOut(java.io.OutputStream out)
              throws java.io.IOException
Write the contents of the record back, so it can be written to disk

Specified by:
writeOut in class Record
Throws:
java.io.IOException

addFont

public int addFont(java.lang.String name)
Add font with the specified name to the font collection. If the font is already present return its index.

Parameters:
name - of the font
Returns:
zero based index of the font in the collection

addFont

public int addFont(java.lang.String name,
                   int charset,
                   int flags,
                   int type,
                   int pitch)

getFontIndex

public int getFontIndex(java.lang.String name)
Returns:
zero based index of the font in the collection or -1 if not found

getNumberOfFonts

public int getNumberOfFonts()

getFontWithId

public java.lang.String getFontWithId(int id)
Get the name of the font at the given ID, or null if there is no font at that ID.

Parameters:
id -


Copyright 2012 The Apache Software Foundation or its licensors, as applicable.