code: void writeFont(PdfWriter writer, PdfIndirectReference ref, Object params[]) throws DocumentException, IOException {
          int firstChar = ((Integer)params[0]).intValue();
          int lastChar = ((Integer)params[1]).intValue();
          byte shortTag[] = (byte[])params[2];
          boolean subsetp = ((Boolean)params[3]).booleanValue() && subset;
          if (!subsetp) {
              firstChar = 0;
              lastChar = shortTag.length - 1;
              for (int k = 0; k < shortTag.length; ++k)
                  shortTag[k] = 1;
          }
          PdfIndirectReference ind_font = null;
          PdfObject pobj = null;
          PdfIndirectObject obj = null;
          pobj = getFullFontStream();
          if (pobj != null){
              obj = writer.addToBody(pobj);
              ind_font = obj.getIndirectReference();
          }
          pobj = getFontDescriptor(ind_font);
          if (pobj != null){
              obj = writer.addToBody(pobj);
              ind_font = obj.getIndirectReference();
          }
          pobj = getFontBaseType(ind_font, firstChar, lastChar, shortTag);
          writer.addToBody(pobj, ref);
      }
docs: Outputs to the writer the font dictionaries and streams.
  @param writer the writer for this document
  @param ref the font indirect reference
  @param params several parameters that depend on the font type
  @throws IOException on error
  @throws DocumentException error in generating the object