Changeset 186 for trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
- Timestamp:
- 03/13/08 04:52:50 (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/openpackaging/packages/WordprocessingMLPackage.java
r184 r186 22 22 23 23 import java.io.OutputStream; 24 25 24 import java.util.Iterator; 26 25 import java.util.Map; … … 29 28 import javax.xml.bind.Marshaller; 30 29 31 import org.apache.fop.fonts.EmbedFontInfo;32 30 import org.apache.log4j.Logger; 33 31 import org.docx4j.fonts.Substituter; 34 32 import org.docx4j.jaxb.Context; 33 import org.docx4j.openpackaging.contenttype.ContentType; 34 import org.docx4j.openpackaging.contenttype.ContentTypeManager; 35 import org.docx4j.openpackaging.contenttype.ContentTypes; 36 import org.docx4j.openpackaging.exceptions.Docx4JException; 37 import org.docx4j.openpackaging.exceptions.InvalidFormatException; 38 import org.docx4j.openpackaging.io.LoadFromZipFile; 39 import org.docx4j.openpackaging.io.SaveToZipFile; 35 40 import org.docx4j.openpackaging.parts.DocPropsCorePart; 36 41 import org.docx4j.openpackaging.parts.DocPropsCustomPart; … … 41 46 import org.docx4j.openpackaging.parts.WordprocessingML.MainDocumentPart; 42 47 import org.docx4j.openpackaging.parts.relationships.Namespaces; 43 44 import org.docx4j.openpackaging.contenttype.ContentType;45 import org.docx4j.openpackaging.contenttype.ContentTypeManager;46 import org.docx4j.openpackaging.contenttype.ContentTypes;47 import org.docx4j.openpackaging.exceptions.Docx4JException;48 import org.docx4j.openpackaging.exceptions.InvalidFormatException;49 import org.docx4j.openpackaging.io.LoadFromZipFile;50 import org.docx4j.openpackaging.io.SaveToZipFile;51 import org.xhtmlrenderer.pdf.ITextRenderer;52 53 import com.lowagie.text.DocumentException;54 48 55 49 … … 293 287 // possibly via an extension function in the XSLT 294 288 if (fontSubstituter==null) { 295 setFontSubstituter( );289 setFontSubstituter(new Substituter()); 296 290 } 297 291 xformer.setParameter("substituterInstance", fontSubstituter); … … 309 303 } 310 304 311 public void setFontSubstituter() throws Exception { 312 305 public void setFontSubstituter(Substituter fs) throws Exception { 306 if (fs == null) { 307 throw new IllegalArgumentException("Font Substituter cannot be null."); 308 } 313 309 // 1. Get a list of all the fonts in the document 314 310 java.util.Map fontsInUse = this.getMainDocumentPart().fontsInUse(); … … 316 312 // 2. For each font, find the closest match on the system (use OO's VCL.xcu to do this) 317 313 // - do this in a general way, since docx4all needs this as well to display fonts 318 fontSubstituter = new Substituter();314 fontSubstituter = fs; 319 315 org.docx4j.wml.Fonts fonts = null; 320 316 FontTablePart fontTablePart= this.getMainDocumentPart().getFontTablePart(); … … 323 319 log.warn("FontTable missing; creating default part."); 324 320 fontTablePart= new org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart(); 325 fontTablePart.unmarshalDefaultFonts(); 321 fontTablePart.unmarshalDefaultFonts(); 322 fontTablePart.processEmbeddings(); 326 323 } 327 324
Note: See TracChangeset
for help on using the changeset viewer.
