jeremias 2003/01/08 06:11:29 Modified: src/codegen font-file.xsl code-point-mapping.xsl Log: Adjustments for font refactoring Revision Changes Path 1.12 +29 -15 xml-fop/src/codegen/font-file.xsl Index: font-file.xsl =================================================================== RCS file: /home/cvs/xml-fop/src/codegen/font-file.xsl,v retrieving revision 1.11 retrieving revision 1.12 diff -u -r1.11 -r1.12 --- font-file.xsl 29 Nov 2002 23:18:51 -0000 1.11 +++ font-file.xsl 8 Jan 2003 14:11:29 -0000 1.12 @@ -17,10 +17,11 @@ <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 @@ 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 @@ 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 < arr.length; i++) arr[i] *= size; + //for( int i = 0; i < 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 '#'; + } } } 1.9 +3 -3 xml-fop/src/codegen/code-point-mapping.xsl Index: code-point-mapping.xsl =================================================================== RCS file: /home/cvs/xml-fop/src/codegen/code-point-mapping.xsl,v retrieving revision 1.8 retrieving revision 1.9 diff -u -r1.8 -r1.9 --- code-point-mapping.xsl 17 Sep 2002 09:28:59 -0000 1.8 +++ code-point-mapping.xsl 8 Jan 2003 14:11:29 -0000 1.9 @@ -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 @@ 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);
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]