Changeset 715 for trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
- Timestamp:
- 03/23/09 03:20:06 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
r708 r715 36 36 import org.apache.log4j.Logger; 37 37 import org.docx4j.convert.out.xmlPackage.XmlPackage; 38 import org.docx4j.fonts.BestMatchingMapper; 38 39 import org.docx4j.fonts.Mapper; 39 40 import org.docx4j.fonts.FontUtils; … … 257 258 throw new IllegalArgumentException("Font Substituter cannot be null."); 258 259 } 260 fontMapper = fm; 261 org.docx4j.wml.Fonts fonts = null; 262 259 263 // 1. Get a list of all the fonts in the document 260 264 java.util.Map fontsInUse = this.getMainDocumentPart().fontsInUse(); 261 265 262 // 2. For each font, find the closest match on the system (use OO's VCL.xcu to do this) 263 // - do this in a general way, since docx4all needs this as well to display fonts 264 fontMapper = fm; 265 org.docx4j.wml.Fonts fonts = null; 266 FontTablePart fontTablePart= this.getMainDocumentPart().getFontTablePart(); 267 268 if (fontTablePart==null) { 269 log.warn("FontTable missing; creating default part."); 270 fontTablePart= new org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart(); 271 fontTablePart.unmarshalDefaultFonts(); 272 fontTablePart.processEmbeddings(); 273 } 274 275 fonts = (org.docx4j.wml.Fonts)fontTablePart.getJaxbElement(); 266 if ( fm instanceof BestMatchingMapper ) { 267 268 269 // 2. For each font, find the closest match on the system (use OO's VCL.xcu to do this) 270 // - do this in a general way, since docx4all needs this as well to display fonts 271 FontTablePart fontTablePart= this.getMainDocumentPart().getFontTablePart(); 272 273 if (fontTablePart==null) { 274 log.warn("FontTable missing; creating default part."); 275 fontTablePart= new org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart(); 276 fontTablePart.unmarshalDefaultFonts(); 277 fontTablePart.processEmbeddings(); 278 } 279 280 fonts = (org.docx4j.wml.Fonts)fontTablePart.getJaxbElement(); 281 } 282 276 283 fontMapper.populateFontMappings(fontsInUse, fonts); 277 284
Note: See TracChangeset
for help on using the changeset viewer.
