Class TTFSubFont

java.lang.Object
org.apache.fontbox.ttf.TTFSubFont

public class TTFSubFont extends Object
A font, which is comprised of a subset of characters of a TrueType font. Based on code developed by Wolfgang Glas http://svn.clazzes.org/svn/sketch/trunk/pdf/pdf-entities/src/main/java/org/clazzes/sketch/pdf/entities/impl/TTFSubFont.java
  • Constructor Details

    • TTFSubFont

      public TTFSubFont(TrueTypeFont baseFont, String suffix)
      Constructs a subfont based on the given font using the given suffix.
      Parameters:
      baseFont - the base font of the subfont
      suffix - suffix used for the naming
  • Method Details

    • addCharCode

      public void addCharCode(int charCode)
      Add the given charcode to the subfpont.
      Parameters:
      charCode - the charCode to be added
    • writeToStream

      public void writeToStream(OutputStream os) throws IOException
      Write the subfont to the given output stream.
      Parameters:
      os - the stream used for writing
      Throws:
      IOException - if something went wrong.