- Timestamp:
- 08/23/09 13:26:07 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/docx4j/src/main/java/org/docx4j/fonts/PhysicalFonts.java
r731 r876 9 9 10 10 import org.apache.fop.fonts.EmbedFontInfo; 11 import org.apache.fop.fonts.EncodingMode;12 11 import org.apache.fop.fonts.FontCache; 13 12 import org.apache.fop.fonts.FontResolver; … … 19 18 import org.docx4j.fonts.microsoft.MicrosoftFonts; 20 19 import org.docx4j.fonts.microsoft.MicrosoftFontsRegistry; 21 import org.docx4j.openpackaging.packages.WordprocessingMLPackage;22 import org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart;23 20 import org.docx4j.openpackaging.parts.WordprocessingML.ObfuscatedFontPart; 24 21 25 import com.lowagie.text.DocumentException;26 22 import com.lowagie.text.pdf.BaseFont; 27 23 … … 146 142 } 147 143 144 private static boolean loggedWarningAlready = false; 145 148 146 /** 149 147 * Add a physical font's EmbedFontInfo object. … … 155 153 //List<EmbedFontInfo> embedFontInfoList = fontInfoFinder.find(fontUrl, fontResolver, fontCache); 156 154 EmbedFontInfo[] embedFontInfoList = fontInfoFinder.find(fontUrl, fontResolver, fontCache); 155 /* FOP r644208 (Bugzilla #44737) 3/04/08 made this an array, 156 // so if you are using non-patched FOP, it needs to be at least this revision 157 // (but doesn't seem to be in FOP 0.95 binary?!) */ 157 158 158 159 if (embedFontInfoList==null) { … … 206 207 207 208 debug.append("------- \n"); 208 debug.append(fontInfo.getPostScriptName() + "\n" ); 209 210 if (!fontInfo.isEmbeddable() ) { 211 // log.info(tokens[x] + " is not embeddable; skipping."); 212 213 // NB isEmbeddable() only exists in our patched FOP 214 215 /* 216 * No point looking at this font, since if we tried to use it, 217 * later, we'd get: 218 * 219 * com.lowagie.text.DocumentException: file:/usr/share/fonts/truetype/ttf-tamil-fonts/lohit_ta.ttf cannot be embedded due to licensing restrictions. 220 at com.lowagie.text.pdf.TrueTypeFont.<init>(TrueTypeFont.java:364) 221 at com.lowagie.text.pdf.TrueTypeFont.<init>(TrueTypeFont.java:335) 222 at com.lowagie.text.pdf.BaseFont.createFont(BaseFont.java:399) 223 at com.lowagie.text.pdf.BaseFont.createFont(BaseFont.java:345) 224 at org.xhtmlrenderer.pdf.ITextFontResolver.addFont(ITextFontResolver.java:164) 225 226 will be thrown if os_2.fsType == 2 227 228 */ 229 log.warn(fontInfo.getEmbedFile() + " is not embeddable; ignoring this font."); 230 231 //return; 232 continue; 233 } 209 210 try { 211 debug.append(fontInfo.getPostScriptName() + "\n" ); 212 if (!fontInfo.isEmbeddable() ) { 213 // log.info(tokens[x] + " is not embeddable; skipping."); 214 215 /* 216 * No point looking at this font, since if we tried to use it, 217 * later, we'd get: 218 * 219 * com.lowagie.text.DocumentException: file:/usr/share/fonts/truetype/ttf-tamil-fonts/lohit_ta.ttf cannot be embedded due to licensing restrictions. 220 at com.lowagie.text.pdf.TrueTypeFont.<init>(TrueTypeFont.java:364) 221 at com.lowagie.text.pdf.TrueTypeFont.<init>(TrueTypeFont.java:335) 222 at com.lowagie.text.pdf.BaseFont.createFont(BaseFont.java:399) 223 at com.lowagie.text.pdf.BaseFont.createFont(BaseFont.java:345) 224 at org.xhtmlrenderer.pdf.ITextFontResolver.addFont(ITextFontResolver.java:164) 225 226 will be thrown if os_2.fsType == 2 227 228 */ 229 log.warn(fontInfo.getEmbedFile() + " is not embeddable; ignoring this font."); 230 231 //return; 232 continue; 233 } 234 } catch (Exception e1) { 235 // NB isEmbeddable() only exists in our patched FOP 236 if (!loggedWarningAlready) { 237 log.warn("Not using patched FOP; isEmbeddable() method missing."); 238 loggedWarningAlready = true; 239 } 240 } 234 241 235 242 PhysicalFont pf;
Note: See TracChangeset
for help on using the changeset viewer.
