Exemplo n.º 1
0
  /** Serializes the given font. */
  protected String serializeFont(PdfFont font) {
    if (font == null) {
      return null;
    }

    String id = font.getId();
    if (id == null) {
      return null;
    }

    List<String> fields = new ArrayList<>();

    // Add feature name.
    fields.add("font");

    // Add id.
    fields.add(id);

    // Add basename
    String basename = font.getBasename();
    fields.add(basename != null ? basename : "");

    fields.add(font.isBold() ? "1" : "0");
    fields.add(font.isItalic() ? "1" : "0");
    fields.add(font.isType3Font() ? "1" : "0");

    return CollectionUtils.join(fields, "\t");
  }