fop 1.1

## org.apache.fop.fonts.truetype
Class TTFSubSetFile

    java.lang.Object
      org.apache.fop.fonts.truetype.TTFFile
          org.apache.fop.fonts.truetype.TTFSubSetFile

    public class TTFSubSetFile

extends TTFFile

Reads a TrueType file and generates a subset that can be used to embed a TrueType CID font. TrueType tables needed for embedded CID fonts are: "head", "hhea", "loca", "maxp", "cvt ", "prep", "glyf", "hmtx" and "fpgm". The TrueType spec can be found at the Microsoft Typography site: http://www.microsoft.com/truetype/

Nested Class Summary

Nested classes/interfaces inherited from class org.apache.fop.fonts.truetype.TTFFile
`TTFFile.PostScriptVersion`

Field Summary

Fields inherited from class org.apache.fop.fonts.truetype.TTFFile
`dirTabs, fontFile, lastLoca, log, mtxTab, TRACE_ENABLED`

Constructor Summary
`TTFSubSetFile()` Default Constructor
`TTFSubSetFile(boolean useKerning, boolean useAdvanced)` Constructor

Method Summary
`byte[]` `getFontSubset()` Returns a subset of the fonts (readFont() MUST be called first in order to create the subset).
`void` `readFont(FontFileReader in, java.lang.String name, java.util.Map<java.lang.Integer,java.lang.Integer> glyphs)` Reads a font and creates a subset of the font.
`void` `stream(TTFOutputStream ttfOut)` Streams a font.

Methods inherited from class org.apache.fop.fonts.truetype.TTFFile

`checkTTC, convertTTFUnit2PDFUnit, getAnsiKerning, getCapHeight, getCharSetName, getCharWidth, getCMaps, getDirectoryEntry, getFamilyNames, getFirstChar, getFlags, getFontBBox, getFullName, getGDEF, getGPOS, getGSUB, getItalicAngle, getKerning, getLastChar, getLowerCaseAscent, getLowerCaseDescent, getNumGlyphs, getPadSize, getPostScriptName, getStemV, getSubFamilyName, getTTCnames, getWeightClass, getWidths, getXHeight, hasAdvancedTable, isCFF, isEmbeddable, main, printStuff, readDirTabs, readFont, readFont, readFontHeader, readHorizontalHeader, readHorizontalMetrics, readIndexToLocation, seekTab`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TTFSubSetFile

    public TTFSubSetFile()

  Default Constructor

### TTFSubSetFile

    public TTFSubSetFile(boolean useKerning,
                         boolean useAdvanced)

  Constructor

  Parameters:
    `useKerning` - true if kerning data should be loaded
    `useAdvanced` - true if advanced typographic tables should be loaded

Method Detail

### readFont

    public void readFont(FontFileReader in,
                         java.lang.String name,
                         java.util.Map<java.lang.Integer,java.lang.Integer> glyphs)
                  throws java.io.IOException

  Reads a font and creates a subset of the font.

  Overrides:
    `readFont` in class `TTFFile`
  Parameters:
    `in` - FontFileReader to read from
    `name` - Name to be checked for in the font file
    `glyphs` - Map of glyphs (glyphs has old index as (Integer) key and new index as (Integer) value)
  Throws:
    `java.io.IOException` - in case of an I/O problem

### getFontSubset

    public byte[] getFontSubset()

  Returns a subset of the fonts (readFont() MUST be called first in order to create the subset).

  Returns:
    byte array

### stream

    public void stream(TTFOutputStream ttfOut)
                throws java.io.IOException

  Description copied from class: `TTFFile`
  Streams a font.

  Overrides:
    `stream` in class `TTFFile`
  Parameters:
    `ttfOut` - The interface for streaming TrueType tables.
  Throws:
    `java.io.IOException` - file write error

fop 1.1

Copyright 1999-2012 The Apache Software Foundation. All Rights Reserved.