]> source.dussan.org Git - xmlgraphics-fop.git/commitdiff
Adjustments for font refactoring
authorJeremias Maerki <jeremias@apache.org>
Wed, 8 Jan 2003 14:11:29 +0000 (14:11 +0000)
committerJeremias Maerki <jeremias@apache.org>
Wed, 8 Jan 2003 14:11:29 +0000 (14:11 +0000)
git-svn-id: https://svn.apache.org/repos/asf/xmlgraphics/fop/trunk@195828 13f79535-47bb-0310-9956-ffa450edef68

src/codegen/code-point-mapping.xsl
src/codegen/font-file.xsl

index 32fc7cf9d9594cf21dc044b72342023d9b2954ba..41bc9552739b67357a83a1c98c65ec66b2fede9b 100644 (file)
@@ -5,9 +5,9 @@
                 select="document('glyphlist.xml')/glyphlist-set"/>
 
   <xsl:template match="encoding-set">
-package org.apache.fop.render.pdf;
+package org.apache.fop.fonts;
+
 import java.util.Map;
-import java.util.HashMap;
 import java.util.Collections;
 
 public class CodePointMapping {
@@ -65,7 +65,7 @@ public class CodePointMapping {
 
     private static Map mappings;
     static {
-        mappings = Collections.synchronizedMap(new HashMap());
+        mappings = Collections.synchronizedMap(new java.util.HashMap());
     }
     public static CodePointMapping getMapping(String encoding) {
         CodePointMapping mapping = (CodePointMapping) mappings.get(encoding);
index f1bb6b16050639f698b12f7e8cb4073dcd11972d..94371704dba48dc02db563aeac074a3638fc4f77 100644 (file)
   <xsl:variable name="glyphs" select="document('encodings.xml')/encoding-set/encoding[@id=$encoding]/glyph"/>
 
   <xsl:template match="font-metrics">
-package org.apache.fop.render.pdf.fonts;
+package org.apache.fop.fonts.base14;
 
-import org.apache.fop.render.pdf.Font;
-import org.apache.fop.render.pdf.CodePointMapping;
+import org.apache.fop.fonts.FontType;
+import org.apache.fop.fonts.Font;
+import org.apache.fop.fonts.CodePointMapping;
 
 public class <xsl:value-of select="class-name"/> extends Font {
     private final static String fontName = "<xsl:value-of select="font-name"/>";
@@ -32,20 +33,24 @@ public class <xsl:value-of select="class-name"/> extends Font {
     private final static int firstChar = <xsl:value-of select="first-char"/>;
     private final static int lastChar = <xsl:value-of select="last-char"/>;
     private final static int[] width;
-    private final CodePointMapping mapping
-        CodePointMapping.getMapping("<xsl:value-of select="$encoding"/>");
+    private final CodePointMapping mapping =
+        CodePointMapping.getMapping("<xsl:value-of select="$encoding"/>");
 
     static {
         width = new int[256];
         <xsl:apply-templates select="widths"/>
     }
 
-    public String encoding() {
+    public String getEncoding() {
         return encoding;
     }
 
-    public String fontName() {
-        return fontName;
+    public String getFontName() {
+        return fontName;        
+    }
+    
+    public FontType getFontType() {
+        return FontType.TYPE1;
     }
 
     public int getAscender(int size) {
@@ -72,23 +77,32 @@ public class <xsl:value-of select="class-name"/> extends Font {
         return lastChar;
     }
 
-    public int width(int i,int size) {
+    public int getWidth(int i,int size) {
         return size * width[i];
     }
 
-    public int[] getWidths(int size) {
+    public int[] getWidths() {
         int[] arr = new int[getLastChar()-getFirstChar()+1];
         System.arraycopy(width, getFirstChar(), arr, 0, getLastChar()-getFirstChar()+1);
-        for( int i = 0; i &lt; arr.length; i++) arr[i] *= size;
+        //for( int i = 0; i &lt; arr.length; i++) arr[i] *= size;
         return arr;
     }
-
+    
+    public boolean hasKerningInfo() {
+        return false;
+    }
+        
+    public java.util.Map getKerningInfo() {
+        return java.util.Collections.EMPTY_MAP;
+    }
+    
     public char mapChar(char c) {
         char d = mapping.mapChar(c);
-  if(d != 0)
+        if(d != 0) {
             return d;
-        else
-      return '#';
+        } else {
+            return '#';
+        }
     }
 
 }