Ignore:
Timestamp:
08/23/09 13:26:07 (3 years ago)
Author:
jharrop
Message:

Make it easier to use non-patched fop.jar

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/docx4j/src/main/java/org/docx4j/fonts/PhysicalFont.java

    r712 r876  
    66import org.apache.fop.fonts.EmbedFontInfo; 
    77import org.apache.log4j.Logger; 
    8 import org.docx4j.convert.out.pdf.viaXSLFO.Conversion; 
    98 
    109/** 
     
    3130        PhysicalFont(String name, EmbedFontInfo embedFontInfo) { 
    3231                 
    33                 // Sanity check 
    34                 if (embedFontInfo.getPostScriptName()==null) { 
    35                         log.error("Not set!"); 
    36                         //log.error(((org.apache.fop.fonts.FontTriplet)fontInfo.getFontTriplets().get(0)).getName()); 
     32                try { 
     33                        // Sanity check 
     34                        if (embedFontInfo.getPostScriptName()==null) { 
     35                                log.error("Not set!"); 
     36                                //log.error(((org.apache.fop.fonts.FontTriplet)fontInfo.getFontTriplets().get(0)).getName()); 
     37                        } 
     38                } catch (Exception e1) { 
     39                        // NB getPanose() only exists in our patched FOP 
     40                        if (!loggedWarningAlready) { 
     41                                log.warn("Not using patched FOP; getPostScriptName() method missing."); 
     42                                loggedWarningAlready = true; 
     43                        }                                                        
    3744                } 
    3845                 
     
    4451         
    4552//      setName(fontInfo.getPostScriptName()); 
    46         setEmbeddedFile(embedFontInfo.getEmbedFile()); 
    47         setPanose(embedFontInfo.getPanose());            
     53         
     54                setEmbeddedFile(embedFontInfo.getEmbedFile()); 
     55        try { 
     56                setPanose(embedFontInfo.getPanose());            
     57                } catch (Exception e) { 
     58                        // NB getPanose() only exists in our patched FOP 
     59                        if (!loggedWarningAlready) { 
     60                                log.warn("Not using patched FOP; getPanose() method missing."); 
     61                                loggedWarningAlready = true; 
     62                        }                                                        
     63                } 
    4864        } 
     65         
     66        private static boolean loggedWarningAlready = false; 
    4967         
    5068        // postscript name eg  
     
    8199        } 
    82100         
    83         org.apache.fop.fonts.Panose panose; 
    84         public org.apache.fop.fonts.Panose getPanose() { 
     101        org.foray.font.format.Panose panose; 
     102        public org.foray.font.format.Panose getPanose() { 
    85103                return panose; 
    86104        } 
    87         public void setPanose(org.apache.fop.fonts.Panose panose) { 
     105        public void setPanose(org.foray.font.format.Panose panose) { 
    88106                this.panose = panose; 
    89107        } 
Note: See TracChangeset for help on using the changeset viewer.