public boolean equals(Object o) { boolean retVal = true; if(((FontTable)o).getStringCount() == _stringCount) { if(((FontTable)o).getExtraDataSz() == _extraDataSz) { Ffn[] fontNamesNew = ((FontTable)o).getFontNames(); for(int i = 0;i<_stringCount; i++) { if(!(_fontNames[i].equals(fontNamesNew[i]))) retVal = false; } } else retVal = false; } else retVal = false; return retVal; }
public String getFontName() { if (_doc.getFontTable() == null) // old word format return null; return _doc.getFontTable().getMainFont(_props.getFtcAscii()); }
@Deprecated public void writeTo( HWPFFileSystem sys ) throws IOException { HWPFOutputStream tableStream = sys.getStream( "1Table" ); writeTo( tableStream ); }
/** * Returns the symbol font, if this is a symbol character run. Might return null, if the font index is not found in the font table. * * @see #isSymbol() * @throws IllegalStateException If this is not a symbol character run: call {@link #isSymbol()} first. */ public Ffn getSymbolFont() { if (isSymbol()) { if (_doc.getFontTable() == null) return null; // Fetch all font names Ffn[] fontNames = _doc.getFontTable().getFontNames(); // Try to find the name of the font for our symbol if (fontNames.length <= _props.getFtcSym()) return null; return fontNames[_props.getFtcSym()]; } else throw new IllegalStateException("Not a symbol CharacterRun"); }
_ft = new FontTable(_tableStream, _fib.getFcSttbfffn(), _fib.getLcbSttbfffn());
/** * Returns the symbol font, if this is a symbol character run. Might return null, if the font index is not found in the font table. * * @see #isSymbol() * @throws IllegalStateException If this is not a symbol character run: call {@link #isSymbol()} first. */ public Ffn getSymbolFont() { if (isSymbol()) { if (_doc.getFontTable() == null) return null; // Fetch all font names Ffn[] fontNames = _doc.getFontTable().getFontNames(); // Try to find the name of the font for our symbol if (fontNames.length <= _props.getFtcSym()) return null; return fontNames[_props.getFtcSym()]; } else throw new IllegalStateException("Not a symbol CharacterRun"); }
_ft = new FontTable(_tableStream, _fib.getFcSttbfffn(), _fib.getLcbSttbfffn());
for( Ffn f : doc.getFontTable().getFontNames() ) { System.out.println("Font: "+f.getMainFontName()+", "+f.getSize()+", "+f.getWeight());
@Deprecated public void writeTo( HWPFFileSystem sys ) throws IOException { ByteArrayOutputStream tableStream = sys.getStream( "1Table" ); writeTo( tableStream ); }
public String getFontName() { if (_doc instanceof HWPFOldDocument) { return ((HWPFOldDocument) _doc).getOldFontTable().getMainFont(_props.getFtcAscii()); } if (_doc.getFontTable() == null) // old word format return null; return _doc.getFontTable().getMainFont(_props.getFtcAscii()); }
for( Ffn f : doc.getFontTable().getFontNames() ) { System.out.println("Font: "+f.getMainFontName()+", "+f.getSize()+", "+f.getWeight());
_ft.writeTo(tableStream); _fib.setLcbSttbfffn(tableStream.size() - tableOffset); tableOffset = tableStream.size();
_ft.writeTo(tableStream); _fib.setLcbSttbfffn(tableStream.getOffset() - tableOffset); tableOffset = tableStream.getOffset();