Class FontCollection

  • public final class FontCollection
    extends RecordContainer
    FontCollection ia a container that holds information about all the fonts in the presentation.
    • Method Detail

      • getRecordType

        public long getRecordType()
        Return the type, which is 2005
        Specified by:
        getRecordType in class Record
      • writeOut

        public void writeOut​( out)
        Write the contents of the record back, so it can be written to disk
        Specified by:
        writeOut in class Record
      • addFont

        public HSLFFontInfo addFont​(FontInfo fontInfo)
        Add font with the given FontInfo configuration to the font collection. The returned FontInfo contains the HSLF specific details and the collection uniquely contains fonts based on their typeface, i.e. calling the method with FontInfo objects having the same name results in the same HSLFFontInfo reference.
        fontInfo - the FontInfo configuration, can be a instance of HSLFFontInfo, HSLFFontInfoPredefined or a custom implementation
        the register HSLFFontInfo object
      • getFontInfo

        public HSLFFontInfo getFontInfo​(java.lang.String typeface)
        Lookup a FontInfo object by its typeface
        typeface - the full font name
        the HSLFFontInfo for the given name or null if not found
      • getFontInfo

        public HSLFFontInfo getFontInfo​(int index)
        Lookup a FontInfo object by its internal font index
        index - the internal font index
        the HSLFFontInfo for the given index or null if not found
      • getNumberOfFonts

        public int getNumberOfFonts()
        the number of registered fonts