1 51 package org.apache.fop.configuration; 52 53 import java.net.URL ; 55 import java.util.List ; 56 57 import org.apache.fop.apps.FOPException; 59 import org.apache.fop.tools.URLBuilder; 60 61 64 65 public class FontInfo { 66 67 private String metricsFile, embedFile, name; 68 private boolean kerning; 69 private List fontTriplets; 70 71 public FontInfo(String name, String metricsFile, boolean kerning, 72 List fontTriplets, String embedFile) { 73 this.name = name; 74 this.metricsFile = metricsFile; 75 this.embedFile = embedFile; 76 this.kerning = kerning; 77 this.fontTriplets = fontTriplets; 78 } 79 80 83 public URL getMetricsFile() throws FOPException { 84 try { 85 return URLBuilder.buildURL(Configuration.getFontBaseURL(), metricsFile); 86 } catch (Exception e) { 87 throw new FOPException("Invalid font metrics file: " + metricsFile 88 + " (" + e.getMessage() + ")"); 89 } 90 } 91 92 95 public URL getEmbedFile() throws FOPException { 96 if (embedFile == null) return null; 98 try { 99 return URLBuilder.buildURL(Configuration.getFontBaseURL(), embedFile); 100 } catch (Exception e) { 101 throw new FOPException("Invalid font file (embedFile): " + embedFile 102 + " (" + e.getMessage() + ")"); 103 } 104 } 105 106 public boolean getKerning() { 107 return kerning; 108 } 109 110 public List getFontTriplets() { 111 return fontTriplets; 112 } 113 114 } 115 116 | Popular Tags |