/** * get the number of fonts in the presentation * * @return number of fonts */ public int getNumberOfFonts() { return getDocumentRecord().getEnvironment().getFontCollection().getNumberOfFonts(); }
/** * Add a font in this presentation * * @param fontInfo the font to add * @return the registered HSLFFontInfo - the font info object is unique based on the typeface */ public HSLFFontInfo addFont(FontInfo fontInfo) { return getDocumentRecord().getEnvironment().getFontCollection().addFont(fontInfo); }
/** * Get a font by index * * @param idx * 0-based index of the font * @return of an instance of <code>PPFont</code> or <code>null</code> if not * found */ public HSLFFontInfo getFont(int idx) { return getDocumentRecord().getEnvironment().getFontCollection().getFontInfo(idx); }
/** * get the number of fonts in the presentation * * @return number of fonts */ public int getNumberOfFonts() { return getDocumentRecord().getEnvironment().getFontCollection().getNumberOfFonts(); }
_fonts = _documentRecord.getEnvironment().getFontCollection();
_fonts = _documentRecord.getEnvironment().getFontCollection();
/** * Get a font by index * * @param idx * 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) { PPFont font = null; FontCollection fonts = getDocumentRecord().getEnvironment().getFontCollection(); Record[] ch = fonts.getChildRecords(); for (int i = 0; i < ch.length; i++) { if (ch[i] instanceof FontEntityAtom) { FontEntityAtom atom = (FontEntityAtom) ch[i]; if (atom.getFontIndex() == idx) { font = new PPFont(atom); break; } } } return font; }
/** * Assign SlideShow for this slide master. * (Used interanlly) */ public void setSlideShow(SlideShow ss) { super.setSlideShow(ss); //after the slide show is assigned collect all available style records if (_txmaster == null) { _txmaster = new TxMasterStyleAtom[9]; TxMasterStyleAtom txdoc = getSlideShow().getDocumentRecord().getEnvironment().getTxMasterStyleAtom(); _txmaster[txdoc.getTextType()] = txdoc; TxMasterStyleAtom[] txrec = ((MainMaster)getSheetContainer()).getTxMasterStyleAtoms(); for (int i = 0; i < txrec.length; i++) { int txType = txrec[i].getTextType(); if(_txmaster[txType] == null) _txmaster[txType] = txrec[i]; } } }
/** * Add a font in this presentation * * @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; }
_txmaster = new TxMasterStyleAtom[9]; TxMasterStyleAtom txdoc = getSlideShow().getDocumentRecord().getEnvironment().getTxMasterStyleAtom(); _txmaster[txdoc.getTextType()] = txdoc;