vmote 2003/08/14 07:59:56 Modified: src/java/org/apache/fop/fonts CustomFont.java FontReader.java LazyFont.java src/java/org/apache/fop/layout FontState.java src/java/org/apache/fop/pdf PDFFactory.java src/java/org/apache/fop/render/pdf FontSetup.java PDFRenderer.java src/java/org/apache/fop/render/ps PSProcSets.java PSRenderer.java src/java/org/apache/fop/svg PDFGraphics2D.java Added: src/java/org/apache/fop/fonts Typeface.java Removed: src/java/org/apache/fop/fonts Font.java Log: move fonts.Font to fonts.Typeface (in preparation for moving layout.FontState to fonts.Font) Revision Changes Path 1.3 +1 -1 xml-fop/src/java/org/apache/fop/fonts/CustomFont.java Index: CustomFont.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fonts/CustomFont.java,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- CustomFont.java 25 Apr 2003 07:06:42 -0000 1.2 +++ CustomFont.java 14 Aug 2003 14:59:56 -0000 1.3 @@ -56,7 +56,7 @@ /** * Abstract base class for custom fonts loaded from files, for example. */ -public abstract class CustomFont extends Font +public abstract class CustomFont extends Typeface implements FontDescriptor, MutableFont { private String fontName = null; 1.2 +2 -2 xml-fop/src/java/org/apache/fop/fonts/FontReader.java Index: FontReader.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fonts/FontReader.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FontReader.java 12 Aug 2003 18:27:35 -0000 1.1 +++ FontReader.java 14 Aug 2003 14:59:56 -0000 1.2 @@ -148,7 +148,7 @@ * Get the generated font object * @return the font */ - public Font getFont() { + public Typeface getFont() { return returnFont; } 1.4 +3 -3 xml-fop/src/java/org/apache/fop/fonts/LazyFont.java Index: LazyFont.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/fonts/LazyFont.java,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- LazyFont.java 12 Aug 2003 18:27:35 -0000 1.3 +++ LazyFont.java 14 Aug 2003 14:59:56 -0000 1.4 @@ -59,14 +59,14 @@ /** * This class is used to defer the loading of a font until it is really used. */ -public class LazyFont extends Font implements FontDescriptor { +public class LazyFont extends Typeface implements FontDescriptor { private String metricsFileName = null; private String fontEmbedPath = null; private boolean useKerning = false; private boolean isMetricsLoaded = false; - private Font realFont = null; + private Typeface realFont = null; private FontDescriptor realFontDescriptor = null; /** @@ -109,7 +109,7 @@ * Gets the real font. * @return the real font */ - public Font getRealFont() { + public Typeface getRealFont() { load(); return realFont; } 1.1 xml-fop/src/java/org/apache/fop/fonts/Typeface.java Index: Typeface.java =================================================================== /* * $Id: Typeface.java,v 1.1 2003/08/14 14:59:56 vmote Exp $ * ============================================================================ * The Apache Software License, Version 1.1 * ============================================================================ * * Copyright (C) 1999-2003 The Apache Software Foundation. All rights reserved. * * Redistribution and use in source and binary forms, with or without modifica- * tion, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * 3. The end-user documentation included with the redistribution, if any, must * include the following acknowledgment: "This product includes software * developed by the Apache Software Foundation (http://www.apache.org/)." * Alternately, this acknowledgment may appear in the software itself, if * and wherever such third-party acknowledgments normally appear. * * 4. The names "FOP" and "Apache Software Foundation" must not be used to * endorse or promote products derived from this software without prior * written permission. For written permission, please contact * [EMAIL PROTECTED] * * 5. Products derived from this software may not be called "Apache", nor may * "Apache" appear in their name, without prior written permission of the * Apache Software Foundation. * * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU- * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ============================================================================ * * This software consists of voluntary contributions made by many individuals * on behalf of the Apache Software Foundation and was originally created by * James Tauber <[EMAIL PROTECTED]>. For more information on the Apache * Software Foundation, please see <http://www.apache.org/>. */ package org.apache.fop.fonts; // FOP /** * Base class for PDF font classes */ public abstract class Typeface implements FontMetrics { /** * Get the encoding of the font. * @return the encoding */ public abstract String getEncoding(); /** * Map a Unicode character to a code point in the font. * @param c character to map * @return the mapped character */ public abstract char mapChar(char c); /** * Determines whether the font is a multibyte font. * @return True if it is multibyte */ public boolean isMultiByte() { return false; } } 1.2 +2 -2 xml-fop/src/java/org/apache/fop/layout/FontState.java Index: FontState.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/layout/FontState.java,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- FontState.java 11 Mar 2003 13:05:14 -0000 1.1 +++ FontState.java 14 Aug 2003 14:59:56 -0000 1.2 @@ -165,8 +165,8 @@ */ public char mapChar(char c) { - if (metric instanceof org.apache.fop.fonts.Font) { - return ((org.apache.fop.fonts.Font)metric).mapChar(c); + if (metric instanceof org.apache.fop.fonts.Typeface) { + return ((org.apache.fop.fonts.Typeface)metric).mapChar(c); } // Use default CodePointMapping 1.5 +3 -3 xml-fop/src/java/org/apache/fop/pdf/PDFFactory.java Index: PDFFactory.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/pdf/PDFFactory.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PDFFactory.java 4 Jul 2003 19:45:06 -0000 1.4 +++ PDFFactory.java 14 Aug 2003 14:59:56 -0000 1.5 @@ -64,7 +64,7 @@ // FOP import org.apache.fop.fonts.CIDFont; import org.apache.fop.fonts.CustomFont; -import org.apache.fop.fonts.Font; +import org.apache.fop.fonts.Typeface; import org.apache.fop.fonts.FontDescriptor; import org.apache.fop.fonts.FontMetrics; import org.apache.fop.fonts.FontType; @@ -1102,11 +1102,11 @@ + desc.getFontType()); } - Font tempFont; + Typeface tempFont; if (desc instanceof LazyFont) { tempFont = ((LazyFont)desc).getRealFont(); } else { - tempFont = (Font)desc; + tempFont = (Typeface)desc; } if (!(tempFont instanceof CustomFont)) { throw new IllegalArgumentException( 1.6 +2 -2 xml-fop/src/java/org/apache/fop/render/pdf/FontSetup.java Index: FontSetup.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/FontSetup.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- FontSetup.java 14 Aug 2003 07:42:58 -0000 1.5 +++ FontSetup.java 14 Aug 2003 14:59:56 -0000 1.6 @@ -53,7 +53,7 @@ // FOP import org.apache.avalon.framework.configuration.Configuration; import org.apache.avalon.framework.configuration.ConfigurationException; -import org.apache.fop.fonts.Font; +import org.apache.fop.fonts.Typeface; import org.apache.fop.fonts.FontDescriptor; import org.apache.fop.fonts.FontUtil; import org.apache.fop.fonts.LazyFont; @@ -253,7 +253,7 @@ Iterator e = fonts.keySet().iterator(); while (e.hasNext()) { String f = (String)e.next(); - Font font = (Font)fonts.get(f); + Typeface font = (Typeface)fonts.get(f); FontDescriptor desc = null; if (font instanceof FontDescriptor) { desc = (FontDescriptor)font; 1.7 +2 -2 xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java Index: PDFRenderer.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/pdf/PDFRenderer.java,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- PDFRenderer.java 14 Aug 2003 07:42:58 -0000 1.6 +++ PDFRenderer.java 14 Aug 2003 14:59:56 -0000 1.7 @@ -77,7 +77,7 @@ import org.apache.fop.apps.Version; import org.apache.fop.fo.properties.RuleStyle; import org.apache.fop.fo.properties.BackgroundRepeat; -import org.apache.fop.fonts.Font; +import org.apache.fop.fonts.Typeface; import org.apache.fop.fonts.FontMetrics; import org.apache.fop.pdf.PDFEncryptionManager; import org.apache.fop.pdf.PDFFilterList; @@ -867,7 +867,7 @@ int size = ((Integer) word.getTrait(Trait.FONT_SIZE)).intValue(); // This assumes that *all* CIDFonts use a /ToUnicode mapping - Font f = (Font) fontInfo.getFonts().get(name); + Typeface f = (Typeface) fontInfo.getFonts().get(name); boolean useMultiByte = f.isMultiByte(); // String startText = useMultiByte ? "<FEFF" : "("; 1.5 +3 -3 xml-fop/src/java/org/apache/fop/render/ps/PSProcSets.java Index: PSProcSets.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/ps/PSProcSets.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- PSProcSets.java 14 Aug 2003 07:42:58 -0000 1.4 +++ PSProcSets.java 14 Aug 2003 14:59:56 -0000 1.5 @@ -54,7 +54,7 @@ import java.util.Iterator; import java.util.Map; -import org.apache.fop.fonts.Font; +import org.apache.fop.fonts.Typeface; import org.apache.fop.fonts.Glyphs; import org.apache.fop.control.Document; @@ -221,7 +221,7 @@ Iterator enum = fonts.keySet().iterator(); while (enum.hasNext()) { String key = (String)enum.next(); - Font fm = (Font)fonts.get(key); + Typeface fm = (Typeface)fonts.get(key); gen.writeln("/" + key + " /" + fm.getFontName() + " def"); } gen.writeln("end def"); @@ -232,7 +232,7 @@ enum = fonts.keySet().iterator(); while (enum.hasNext()) { String key = (String)enum.next(); - Font fm = (Font)fonts.get(key); + Typeface fm = (Typeface)fonts.get(key); if (null == fm.getEncoding()) { //ignore (ZapfDingbats and Symbol run through here //TODO: ZapfDingbats and Symbol should get getEncoding() fixed! 1.8 +3 -3 xml-fop/src/java/org/apache/fop/render/ps/PSRenderer.java Index: PSRenderer.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/render/ps/PSRenderer.java,v retrieving revision 1.7 retrieving revision 1.8 diff -u -r1.7 -r1.8 --- PSRenderer.java 14 Aug 2003 07:42:58 -0000 1.7 +++ PSRenderer.java 14 Aug 2003 14:59:56 -0000 1.8 @@ -72,7 +72,7 @@ import org.apache.fop.area.inline.Word; import org.apache.fop.datatypes.ColorType; import org.apache.fop.fo.FOUserAgent; -import org.apache.fop.fonts.Font; +import org.apache.fop.fonts.Typeface; import org.apache.fop.control.Document; import org.apache.fop.render.AbstractRenderer; import org.apache.fop.render.RendererContext; @@ -445,7 +445,7 @@ * @param text Text to paint * @param font Font to use */ - protected void paintText(int rx, int bl, String text, Font font) { + protected void paintText(int rx, int bl, String text, Typeface font) { saveGraphicsState(); writeln("1 0 0 -1 " + rx + " " + bl + " Tm"); @@ -471,7 +471,7 @@ int fontsize = area.getTraitAsInteger(Trait.FONT_SIZE); // This assumes that *all* CIDFonts use a /ToUnicode mapping - Font f = (Font)fontInfo.getFonts().get(fontname); + Typeface f = (Typeface)fontInfo.getFonts().get(fontname); //Determine position int rx = currentBlockIPPosition; 1.6 +2 -2 xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java Index: PDFGraphics2D.java =================================================================== RCS file: /home/cvs/xml-fop/src/java/org/apache/fop/svg/PDFGraphics2D.java,v retrieving revision 1.5 retrieving revision 1.6 diff -u -r1.5 -r1.6 --- PDFGraphics2D.java 14 Aug 2003 07:42:58 -0000 1.5 +++ PDFGraphics2D.java 14 Aug 2003 14:59:56 -0000 1.6 @@ -1259,8 +1259,8 @@ // This assumes that *all* CIDFonts use a /ToUnicode mapping boolean useMultiByte = false; - org.apache.fop.fonts.Font f = - (org.apache.fop.fonts.Font)fontInfo.getFonts().get(name); + org.apache.fop.fonts.Typeface f = + (org.apache.fop.fonts.Typeface)fontInfo.getFonts().get(name); if (f instanceof LazyFont) { if (((LazyFont) f).getRealFont() instanceof CIDFont) { useMultiByte = true;
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]