Package org.apache.poi.hslf.record

Examples of org.apache.poi.hslf.record.FontCollection


   * @param font
   *            the font to add
   * @return 0-based index of the font
   */
  public int addFont(PPFont font) {
    FontCollection fonts = getDocumentRecord().getEnvironment().getFontCollection();
    int idx = fonts.getFontIndex(font.getFontName());
    if (idx == -1) {
      idx = fonts.addFont(font.getFontName(), font.getCharSet(), font.getFontFlags(), font
          .getFontType(), font.getPitchAndFamily());
    }
    return idx;
  }
View Full Code Here


   *            0-based index of the font
   * @return of an instance of <code>PPFont</code> or <code>null</code> if not
   *         found
   */
  public PPFont getFont(int idx) {
    FontCollection fonts = getDocumentRecord().getEnvironment().getFontCollection();
    for (Record ch : fonts.getChildRecords()) {
      if (ch instanceof FontEntityAtom) {
        FontEntityAtom atom = (FontEntityAtom) ch;
        if (atom.getFontIndex() == idx) {
          return new PPFont(atom);
        }
View Full Code Here

TOP

Related Classes of org.apache.poi.hslf.record.FontCollection

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.