diff options
Diffstat (limited to 'src/org/apache/fop')
33 files changed, 579 insertions, 5508 deletions
diff --git a/src/org/apache/fop/apps/CommandLineStarter.java b/src/org/apache/fop/apps/CommandLineStarter.java index 45c01940f..c38e3dd26 100644 --- a/src/org/apache/fop/apps/CommandLineStarter.java +++ b/src/org/apache/fop/apps/CommandLineStarter.java @@ -66,8 +66,10 @@ public class CommandLineStarter extends Starter { BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream( commandLineOptions.getOutputFile())); driver.setOutputStream(bos); - driver.getRenderer().setOptions( + if(driver.getRenderer() != null) { + driver.getRenderer().setOptions( commandLineOptions.getRendererOptions()); + } driver.render(parser, inputHandler.getInputSource()); bos.close(); System.exit(0); diff --git a/src/org/apache/fop/apps/Driver.java b/src/org/apache/fop/apps/Driver.java index 5c4d98c0f..76334399e 100644 --- a/src/org/apache/fop/apps/Driver.java +++ b/src/org/apache/fop/apps/Driver.java @@ -149,6 +149,11 @@ public class Driver { private Renderer _renderer; /** + * the structure handler + */ + private StructureHandler structHandler; + + /** * the source of the FO file */ private InputSource _source; @@ -339,7 +344,7 @@ public class Driver { setRenderer(new org.apache.fop.render.txt.TXTRenderer()); break; case RENDER_MIF: - setRenderer(new org.apache.fop.render.mif.MIFRenderer()); + //structHandler = new org.apache.fop.mif.MIFHandler(_stream); break; case RENDER_XML: setRenderer(new org.apache.fop.render.xml.XMLRenderer()); @@ -453,11 +458,16 @@ public class Driver { * events but isn't a SAX Parser itself. */ public ContentHandler getContentHandler() { - StructureHandler handler = new LayoutHandler(_stream, _renderer, true); - handler.setLogger(getLogger()); + // TODO - do this stuff in a better way + if(_renderer != null) { + structHandler = new LayoutHandler(_stream, _renderer, true); + } else { + structHandler = new org.apache.fop.mif.MIFHandler(_stream); + } + structHandler.setLogger(getLogger()); _treeBuilder.setLogger(getLogger()); _treeBuilder.setUserAgent(getUserAgent()); - _treeBuilder.setStructHandler(handler); + _treeBuilder.setStructHandler(structHandler); return _treeBuilder; } diff --git a/src/org/apache/fop/apps/StructureHandler.java b/src/org/apache/fop/apps/StructureHandler.java index 3eb716331..4efbef2aa 100644 --- a/src/org/apache/fop/apps/StructureHandler.java +++ b/src/org/apache/fop/apps/StructureHandler.java @@ -11,7 +11,9 @@ package org.apache.fop.apps; import java.util.HashSet; import org.apache.avalon.framework.logger.Logger; -import org.apache.fop.fo.pagination.PageSequence; +import org.apache.fop.fo.pagination.*; +import org.apache.fop.fo.flow.*; +import org.apache.fop.fo.*; import org.apache.fop.layout.FontInfo; import org.xml.sax.SAXException; @@ -52,7 +54,7 @@ public class StructureHandler { } - public void startPageSequence() { + public void startPageSequence(PageSequence pageSeq, LayoutMasterSet lms) { } @@ -60,83 +62,87 @@ public class StructureHandler { } - public void setPageInfo() { + public void startFlow(Flow fl) { } - public void startBlock() { + public void endFlow(Flow fl) { } - public void endBlock() { + public void startBlock(Block bl) { + + } + + public void endBlock(Block bl) { } // Tables - public void startTable() { + public void startTable(Table tbl) { } - public void endTable() { + public void endTable(Table tbl) { } - public void startHeader() { + public void startHeader(TableHeader th) { } - public void endHeader() { + public void endHeader(TableHeader th) { } - public void startFooter() { + public void startFooter(TableFooter tf) { } - public void endFooter() { + public void endFooter(TableFooter tf) { } - public void startBody() { + public void startBody(TableBody tb) { } - public void endBody() { + public void endBody(TableBody tb) { } - public void startRow() { + public void startRow(TableRow tr) { } - public void endRow() { + public void endRow(TableRow tr) { } - public void startCell() { + public void startCell(TableCell tc) { } - public void endCell() { + public void endCell(TableCell tc) { } // Lists - public void startList() { + public void startList(ListBlock lb) { } - public void endList() { + public void endList(ListBlock lb) { } - public void startListItem() { + public void startListItem(ListItem li) { } - public void endListItem() { + public void endListItem(ListItem li) { } @@ -185,7 +191,7 @@ public class StructureHandler { } - public void image() { + public void image(ExternalGraphic eg) { } @@ -193,7 +199,7 @@ public class StructureHandler { } - public void foreignObject() { + public void foreignObject(InstreamForeignObject ifo) { } @@ -201,12 +207,12 @@ public class StructureHandler { } - public void leader() { + public void leader(Leader l) { } - public void characters() { + public void characters(char data[], int start, int length) { } diff --git a/src/org/apache/fop/fo/FOText.java b/src/org/apache/fop/fo/FOText.java index 3cf9db50d..3438d7c15 100644 --- a/src/org/apache/fop/fo/FOText.java +++ b/src/org/apache/fop/fo/FOText.java @@ -18,6 +18,7 @@ import org.apache.fop.apps.FOPException; import org.apache.fop.layoutmgr.LayoutManager; import org.apache.fop.layoutmgr.TextLayoutManager; import org.apache.fop.layoutmgr.TextBPLayoutManager; +import org.apache.fop.apps.StructureHandler; import java.util.NoSuchElementException; import java.util.List; @@ -48,6 +49,11 @@ public class FOText extends FObj { textInfo = ti; } + public void setStructHandler(StructureHandler st) { + super.setStructHandler(st); + structHandler.characters(ca, start, length); + } + public boolean willCreateArea() { if (textInfo.whiteSpaceCollapse == WhiteSpaceCollapse.FALSE && length > 0) { diff --git a/src/org/apache/fop/fo/FObjMixed.java b/src/org/apache/fop/fo/FObjMixed.java index 93cad8758..a5c136dd6 100644 --- a/src/org/apache/fop/fo/FObjMixed.java +++ b/src/org/apache/fop/fo/FObjMixed.java @@ -59,6 +59,7 @@ public class FObjMixed extends FObj { FOText ft = new FOText(data, start, length, textInfo); ft.setLogger(log); + ft.setStructHandler(structHandler); addChild(ft); } diff --git a/src/org/apache/fop/fo/flow/Block.java b/src/org/apache/fop/fo/flow/Block.java index 5483ea685..8ac4d199c 100644 --- a/src/org/apache/fop/fo/flow/Block.java +++ b/src/org/apache/fop/fo/flow/Block.java @@ -86,6 +86,8 @@ public class Block extends FObjMixed { this.properties.get("linefeed-treatment").getEnum(); setupID(); + + structHandler.startBlock(this); } public Status layout(Area area) throws FOPException { @@ -404,6 +406,7 @@ public class Block extends FObjMixed { public void end() { handleWhiteSpace(); + structHandler.endBlock(this); } private void handleWhiteSpace() { diff --git a/src/org/apache/fop/fo/flow/Flow.java b/src/org/apache/fop/fo/flow/Flow.java index 77d889a25..b2583c0a8 100644 --- a/src/org/apache/fop/fo/flow/Flow.java +++ b/src/org/apache/fop/fo/flow/Flow.java @@ -83,6 +83,12 @@ public class Flow extends FObj { setFlowName(getProperty("flow-name").getString()); // Now done in addChild of page-sequence //pageSequence.addFlow(this); + + structHandler.startFlow(this); + } + + public void end() { + structHandler.endFlow(this); } protected void setFlowName(String name) throws FOPException { diff --git a/src/org/apache/fop/fo/pagination/LayoutMasterSet.java b/src/org/apache/fop/fo/pagination/LayoutMasterSet.java index 62ac8e795..b35ea1f83 100644 --- a/src/org/apache/fop/fo/pagination/LayoutMasterSet.java +++ b/src/org/apache/fop/fo/pagination/LayoutMasterSet.java @@ -74,7 +74,7 @@ public class LayoutMasterSet extends FObj { * This is used by the page sequence to get a page master for * creating pages. */ - protected SimplePageMaster getSimplePageMaster(String masterName) { + public SimplePageMaster getSimplePageMaster(String masterName) { return (SimplePageMaster)this.simplePageMasters.get(masterName); } @@ -97,7 +97,7 @@ public class LayoutMasterSet extends FObj { * This is used by the page sequence to get a page master for * creating pages. */ - protected PageSequenceMaster getPageSequenceMaster(String masterName) { + public PageSequenceMaster getPageSequenceMaster(String masterName) { return (PageSequenceMaster)this.pageSequenceMasters.get(masterName); } diff --git a/src/org/apache/fop/fo/pagination/PageSequence.java b/src/org/apache/fop/fo/pagination/PageSequence.java index 3b75628cb..e77b11085 100644 --- a/src/org/apache/fop/fo/pagination/PageSequence.java +++ b/src/org/apache/fop/fo/pagination/PageSequence.java @@ -194,6 +194,8 @@ public class PageSequence extends FObj { // this.properties.get("country"); // this.properties.get("language"); setupID(); + + structHandler.startPageSequence(this, layoutMasterSet); } diff --git a/src/org/apache/fop/mif/MIFDocument.java b/src/org/apache/fop/mif/MIFDocument.java deleted file mode 100644 index f0a7f618f..000000000 --- a/src/org/apache/fop/mif/MIFDocument.java +++ /dev/null @@ -1,1127 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -// Author : Seshadri G - -package org.apache.fop.mif; - -// images are the one place that FOP classes outside this package get -// referenced and I'd rather not do it - -import org.apache.fop.image.FopImage; -import org.apache.fop.layout.LinkSet; -import org.apache.fop.datatypes.ColorSpace; - -import org.apache.fop.datatypes.IDReferences; -import org.apache.fop.layout.Page; -import org.apache.fop.layout.FontMetric; -import org.apache.fop.layout.FontDescriptor; -// Java -import java.io.*; -import java.io.PrintWriter; -import java.util.*; -import java.awt.Rectangle; - -/** - * class representing a MIF document. - * - * The document is built up by calling various methods and then finally - * output to given filehandle using output method. - * - */ -public class MIFDocument { - - /** - * the version of MIF supported - */ - - - protected static final String mifVersion = "5.5"; - protected BookComponent bookComponent; - private Flow curFlow; // this is a ref to the current flow which could be a textflow or - // a table - private ID curIDCounter = new ID(); - - class ID { - - private int idCounter = 1; - public int getnewID() { - - return idCounter++; - } - - } - - class FontFormat { - - public FontFormat() {} - - } - - class ParagraphFormat extends FontFormat { - - public ParagraphFormat() {} - - int startIndent; - int endIndent; - - - - } - - class Document { - protected int height; - protected int width; - public Document() {} - - public void output(OutputStream stream) throws IOException { - - String mif = "\n<Document " + "\n<DPageSize " + width / 1000f - + " " + height / 1000f + " >\n>"; - byte buf[] = mif.getBytes(); - - stream.write(buf); - - } - - } - - - class PolyLine { - - public PolyLine() {} - - } - - class ImportObject { - - private String url; - private int x, y, w, h; - - public ImportObject(String url, int x, int y, int w, int h) { - - this.url = url; - this.x = x; - this.y = y; - this.w = w; - this.h = h; - - } - - - public void output(OutputStream stream) throws IOException { - - - String path = this.url; - - // Strip 'file:' - path = path.substring(5); - String result = ""; - int i; - do { // replace all matching '/' - - i = path.indexOf("/"); - if (i != -1) { - result = path.substring(0, i); - result += "<c\\>"; - result += path.substring(i + 1); - path = result; - } - - } while (i != -1); - - String mif = "\n<ImportObject" + "\n<ImportObFixedSize Yes>"; - mif += "\n\t<ImportObFileDI " + "`<c\\>" + path + "'" + " >"; - mif += "\n\t<ShapeRect " + this.x / 1000f + " " + this.y / 1000f - + " " + this.w / 1000f + " " + this.h / 1000f + " >"; - - mif += "\n> #End ImportObj"; - stream.write(mif.getBytes()); - - } - - } - - - class Frame { - - private int ID; - private int x, y, w, h; - Vector content = new Vector(); - public Frame(int x, int y, int w, int h) { - - this.ID = curIDCounter.getnewID(); - this.x = x; - this.y = y; - this.w = w; - this.h = h; - - } - - public void addContent(ImportObject obj) { - - content.addElement(obj); - - } - - public void output(OutputStream stream) throws IOException { - - String mif = "\n<Frame" + "\n\t<ID " + this.ID + " >"; - mif += - "\n\t<Pen 15>\n\t<Fill 7>\n\t<PenWidth 1.0 >\n\t<Separation 0>\n\t<ObColor `Black'>\n\t<DashedPattern \n\t <DashedStyle Solid> \n >"; - - mif += - "\n\t<RunaroundGap 6.0 pt>\n\t<RunaroundType None>\n\t<Angle 360.0>\n\t<Float No>\n\t<NSOffset 0.0>\n\t<BLOffset 0>\n\t<Cropped No>\n\t<FrameType Below>\n\t<AnchorAlign Center>"; - - mif += "\n\t<ShapeRect " + this.x / 1000f + " " + this.y / 1000f - + " " + this.w / 1000f + " " + this.h / 1000f + " >"; - - - stream.write(mif.getBytes()); - - Enumeration e = content.elements(); - while (e.hasMoreElements()) { - - ((ImportObject)e.nextElement()).output(stream); - } - mif = "\n> #End Frame"; - stream.write(mif.getBytes()); - - - - } - - public int getID() { - - return this.ID; - } - - } - - class TextRect { - private int rx, ry, w, h; - private int numCols; - private int curCol = 0; // Current column being processed - private int colGap = 0; - private int textRectID; - public TextRect(int numCols) { - - this.numCols = numCols; - this.curCol = 0; - this.textRectID = curIDCounter.getnewID(); - - } - - - public int getTextRectID() { - - return textRectID; - - } - - - public void setTextRectProp(int left, int top, int width, - int height) { - - if (curCol == 0) { - - // Use the left and top margins - - rx = left; - ry = top; - w = width; // current column width , not the entire span - h = height; - curCol++; - - } else if (curCol == 1) { - // Figure out the column gap and the span of the textrect - colGap = left - rx - width; - // Next the entire width - w = numCols * width + (numCols - 1) * colGap; - curCol++; - - - } - - } - - - public void output(OutputStream stream) throws IOException { - - String mif = "\n<TextRect" + "\n\t<ID " + textRectID + ">" - + "\n\t<ShapeRect " + rx / 1000f + " " + ry / 1000f - + " " + w / 1000f + " " + h / 1000f + ">"; - - if (numCols > 1) { - mif += "\n<TRNumColumns " + numCols + ">"; - mif += "\n<TRColumnGap " + colGap / 1000f + ">"; - } - - mif += "\n> #End TextRect"; - byte buf[] = mif.getBytes(); - stream.write(buf); - } - - } - - class Page { - private String pageType; - private String pageTag; - private String pageBackground; - private Vector textRects; - public Page(String pageType, String pageTag, String pageBackground) { - - this.pageType = pageType; - this.pageTag = pageTag; - this.pageBackground = pageBackground; - this.textRects = new Vector(); - } - - public Page() { - - this.pageType = "BodyPage"; - this.pageBackground = "Default"; - this.textRects = new Vector(); - - } - - - public void addTextRect(int numCols) { - - TextRect textRect = new TextRect(numCols); - this.textRects.addElement(textRect); - } - - public TextRect curTextRect() { - - return (TextRect)textRects.lastElement(); - - } - - - - public void output(OutputStream stream) throws IOException { - - - String mif = "\n<Page" + "\n\t<PageType " + pageType + ">" - + "\n\t<PageBackground " + "`" + pageBackground - + "'" + ">"; - - byte buf[] = mif.getBytes(); - - stream.write(buf); - - Enumeration e = textRects.elements(); - - while (e.hasMoreElements()) { - - ((TextRect)e.nextElement()).output(stream); - - } - mif = "\n> #End Page\n"; - stream.write(mif.getBytes()); - - } - - - } - - abstract class Flow { - - public Flow() {} - - public abstract Para curPara(); - public abstract void startPara(); - } - - - class TextFlow extends Flow { - - Vector paras; - private int ID; // This ID is used within ParaLine, however it is - // logical to keep it unique to a textflow - - public TextFlow() { - - - // The current textrect into which the textflow goes - // is the last created. - - this.ID = - ((bookComponent.curPage()).curTextRect()).getTextRectID(); - this.paras = new Vector(); - - } - - - public int getTextRectID() { - - return ID; - - } - - public Para curPara() { - - return (Para)paras.lastElement(); - } - - public void startPara() { - - this.paras.addElement(new Para(ID)); - } - - public void output(OutputStream stream) throws IOException { - String mif = "\n<TextFlow"; - stream.write(mif.getBytes()); - Enumeration e = paras.elements(); - while (e.hasMoreElements()) { - - ((Para)e.nextElement()).output(stream); - } - mif = "\n> #End TextFlow"; - stream.write(mif.getBytes()); - } - - } - - - class Para { - - Vector paraLines; - int ID; // Same as TextRectID - ParagraphFormat pgf = - null; // This corresponds to to the block properties - public Para() { - - this.ID = 0; - this.paraLines = new Vector(); - } - - - public Para(int ID) { - - this.ID = ID; - this.paraLines = new Vector(); - - } - - public ParaLine curParaLine() { - if (paraLines.isEmpty()) { - return null; - } else { - return (ParaLine)paraLines.lastElement(); - } - } - - void startParaLine() { - - this.paraLines.addElement(new ParaLine(ID)); - - } - - - public void setBlockProp(int startIndent, int endIndent) { - - pgf = new ParagraphFormat(); - pgf.startIndent = startIndent; - pgf.endIndent = endIndent; - - - } - - - public void output(OutputStream stream) throws IOException { - - String mif = "\n<Para"; - // Is there a block property? - - if (pgf != null) { - mif += "\n<Pgf"; - mif += "\n<PgfTag `Body'>"; - mif += "\n<PgfLIndent " + pgf.startIndent / 1000f + ">"; - mif += "\n<PgfRIndent " + pgf.endIndent / 1000f + ">"; - mif += "\n>"; - } - stream.write(mif.getBytes()); - Enumeration e = paraLines.elements(); - while (e.hasMoreElements()) { - - ((ParaLine)e.nextElement()).output(stream); - } - mif = "\n> #End ParaLine"; - stream.write(mif.getBytes()); - - } - - } - - class ParaLine { - Vector content; - int textRectID; - String tableID; - String aFrameID; - public ParaLine(int textRectID) { - - this.textRectID = textRectID; - this.content = new Vector(); - - } - - public ParaLine() { - - this.textRectID = 0; // There is no ID used, in tables - this.content = new Vector(); - } - - public void addContent(Object obj) { - - this.content.addElement(obj); - - } - - public void output(OutputStream stream) throws IOException { - - String mif = "\n<ParaLine"; - - // tables dont need the textrectid - if (textRectID != 0) - mif += "\n\t<TextRectID " + textRectID + ">"; - - stream.write(mif.getBytes()); - Enumeration e = this.content.elements(); - while (e.hasMoreElements()) { - - Object elem = (Object)e.nextElement(); - if (elem instanceof String) { - - // Output newlines as char hard return - - if (elem == "\n") { - - mif = "\n<Char HardReturn>"; - } else { - mif = "\n\t<String `" + elem + "'>"; - } - stream.write(mif.getBytes()); - - } else if (elem instanceof Frame) { - - mif = "\n\t<AFrame " + ((Frame)elem).getID() + " >"; - stream.write(mif.getBytes()); - } else if (elem instanceof Tbl) { - mif = "\n\t<ATbl " + ((Tbl)elem).getID() + " >"; - stream.write(mif.getBytes()); - } - } - mif = "\n> #End ParaLine"; - stream.write(mif.getBytes()); - - } - - } - - class PgfCatalog { - - Vector pgfs; // Paragraph formats - public PgfCatalog() {} - - public void output(OutputStream stream) throws IOException { - String mif = "\n<PgfCatalog" + "\n<Pgf" + "\n<PgfTag `Body'>" - + "\n>" + "\n>"; - stream.write(mif.getBytes()); - } - - } - - class Color { - - public Color() {} - - } - - class ColorCatalog { - - public ColorCatalog() {} - - } - - class Ruling { - - int penWidth; - int pen; - int lines; - public Ruling() { - // Default ruling - penWidth = 1; - pen = 0; - lines = 1; - - - } - - public void output(OutputStream stream) throws IOException { - - String mif = "\n<Ruling \n<RulingTag `Default'>"; - mif += "\n<RulingPenWidth " + penWidth + ">"; - mif += "\n<RulingPen " + pen + ">"; - mif += "\n<RulingLines " + lines + ">"; - mif += "\n>"; - stream.write(mif.getBytes()); - } - - } - - class RulingCatalog { - // Contains multiple rulings - - Vector ruling = new Vector(); - public RulingCatalog() { - - // Add the defualt ruling to the catalog - - ruling.addElement(new Ruling()); - - } - - public void output(OutputStream stream) throws IOException { - - String mif = "\n<RulingCatalog"; - stream.write(mif.getBytes()); - Enumeration e = ruling.elements(); - while (e.hasMoreElements()) { - ((Ruling)e.nextElement()).output(stream); - } - mif = "\n> #End RulingCatalog"; - stream.write(mif.getBytes()); - - } - - } - - class TblFormat { - public TblFormat() {} - - } - - class TblCatalog { - public TblCatalog() {} - - } - - class Tbl extends Flow { - - class TblColumn { - private int width; - public TblColumn(int width) { - - this.width = width; - - } - - public void output(OutputStream stream) throws IOException { - - String mif = "\n\t<TblColumnWidth " + width + " >"; - stream.write(mif.getBytes()); - - } - - - } - - class Row { - - class Cell { - - private int rowSpan, colSpan; - private Vector paras; // Paras - public Cell(int rowSpan, int colSpan) { - - this.rowSpan = rowSpan; - this.colSpan = colSpan; - paras = new Vector(); - - } - - public void startPara() { - - this.paras.addElement(new Para()); - } - - public void output(OutputStream stream) throws IOException { - - String mif = "\n\t\t<Cell" + "\n\t\t<CellContent"; - stream.write(mif.getBytes()); - Enumeration e = paras.elements(); - while (e.hasMoreElements()) { - ((Para)e.nextElement()).output(stream); - } - mif = "\n\t\t> #End CellContent"; - mif += "\n\t> #End Cell"; - stream.write(mif.getBytes()); - } - - } - private Vector cells; - - public void addCell(int rowSpan, int colSpan) { - - cells.addElement(new Cell(rowSpan, colSpan)); - } - - public Row() { - - cells = new Vector(); - - } - - public Cell curCell() { - - return (Cell)this.cells.lastElement(); - } - - public void output(OutputStream stream) throws IOException { - - String mif = "\n\t<Row"; - stream.write(mif.getBytes()); - Enumeration e = cells.elements(); - while (e.hasMoreElements()) { - ((Cell)e.nextElement()).output(stream); - } - mif = "\n\t> #End Row"; - stream.write(mif.getBytes()); - - } - - - } - - private int ID; - private Vector tblColumns = new Vector(); - private Vector tblBody, tblHead, tblFoot; - private Vector current; // is a reference to one of tblHead,tblBody or tblFoot - public void addColumn(int colWidth) { - - tblColumns.addElement(new TblColumn(colWidth)); - - } - - public void setCurrent(String current) { - - if (current == "fo:table-body") { - this.current = this.tblBody; - } else if (current == "tablehead") { - this.current = this.tblHead; - } else if (current == "tablefoot") { - this.current = this.tblFoot; - } - } - - public void startRow() { - - this.current.addElement(new Row()); - } - - public void startCell(int rowSpan, int colSpan) { - - // Add a cell into the current row - - ((Row)this.current.lastElement()).addCell(rowSpan, colSpan); - - } - - public Tbl() { - - this.ID = curIDCounter.getnewID(); - tblBody = new Vector(); - tblHead = new Vector(); - tblFoot = new Vector(); - - } - - public int getID() { - - return this.ID; - } - - public Para curPara() { - - // Return the last para of the current cell - - Row curRow; - curRow = (Row)this.current.lastElement(); - return (Para)curRow.curCell().paras.lastElement(); - - - } - - public void startPara() { - - // start a new para in the current cell - Row curRow; - curRow = (Row)this.current.lastElement(); - curRow.curCell().startPara(); - - } - - public void output(OutputStream stream) throws IOException { - - String mif = "\n<Tbl" + "\n\t<TblID " + ID + " >"; - - // note tbl format to be added in a later release - mif += "\n<TblTag Body>" + "\n<TblFormat"; - mif += "\n<TblColumnRuling `Default'>"; - mif += "\n<TblBodyRowRuling `Default'>"; - mif += "\n<TblLRuling `Default'>"; - mif += "\n<TblBRuling `Default'>"; - mif += "\n<TblRRuling `Default'>"; - mif += "\n<TblTRuling `Default'>"; - - mif += "\n> #End TblFormat"; - ; - mif += "\n\t<TblNumColumns " + tblColumns.size() + " >"; - stream.write(mif.getBytes()); - - if (!tblHead.isEmpty()) { - Enumeration e = tblHead.elements(); - while (e.hasMoreElements()) { - ((Row)e.nextElement()).output(stream); - } - } - if (!tblFoot.isEmpty()) { - Enumeration e = tblFoot.elements(); - while (e.hasMoreElements()) { - ((Row)e.nextElement()).output(stream); - } - } - if (!tblBody.isEmpty()) { - mif = "\n\t<TblBody"; - stream.write(mif.getBytes()); - Enumeration e = tblBody.elements(); - while (e.hasMoreElements()) { - ((Row)e.nextElement()).output(stream); - } - mif = "\n\t> #End tblBody"; - } - mif += "\n> #End Table"; - stream.write(mif.getBytes()); - } - - } - - class XRefFormat { - - public XRefFormat() {} - - } - - class CrossRefInfo { - - public CrossRefInfo() {} - - } - - class XRef { - - public XRef() {} - - } - - class Marker { - - public Marker() {} - - } - - class BookComponent { - - Document document; - ColorCatalog colorCatalog; - RulingCatalog rulingCatalog; - PgfCatalog pgfCatalog; - TblCatalog tblCatalog; - Vector aFrames = new Vector(); - Vector tables = new Vector(); - Vector pages = new Vector(); - Vector textFlows = new Vector(); - - - public BookComponent() { - - document = null; // Initially no values are available - pgfCatalog = new PgfCatalog(); - rulingCatalog = new RulingCatalog(); - } - - - public Frame createFrame(int x, int y, int w, int h) { - - Frame frame = new Frame(x, y, w, h); - aFrames.addElement(frame); - return frame; - - } - - public Frame curFrame() { - - return (Frame)aFrames.lastElement(); - - } - - public TextFlow curTextFlow() { - - return (TextFlow)textFlows.lastElement(); - - } - - public Tbl createTable() { - - Tbl table = new Tbl(); - tables.addElement(table); - return table; - } - - public Tbl curTable() { - - return (Tbl)tables.lastElement(); - } - - public void output(OutputStream stream) throws IOException { - String mif = "<MIFFile 5.00>" + "\n<Units Upt>"; - stream.write(mif.getBytes()); - pgfCatalog.output(stream); - rulingCatalog.output(stream); - document.output(stream); - - if (!aFrames.isEmpty()) { - - mif = "\n<AFrames"; - stream.write(mif.getBytes()); - Enumeration e = aFrames.elements(); - while (e.hasMoreElements()) { - - ((Frame)e.nextElement()).output(stream); - } - - mif = "\n>"; - stream.write(mif.getBytes()); - } - - if (!tables.isEmpty()) { - - mif = "\n<Tbls"; - stream.write(mif.getBytes()); - Enumeration e = tables.elements(); - while (e.hasMoreElements()) { - - ((Tbl)e.nextElement()).output(stream); - } - - mif = "\n>"; - stream.write(mif.getBytes()); - } - - - Enumeration e = pages.elements(); - while (e.hasMoreElements()) { - - ((Page)e.nextElement()).output(stream); - } - - e = textFlows.elements(); - while (e.hasMoreElements()) { - - ((TextFlow)e.nextElement()).output(stream); - - } - } - - private Page curPage() { - return (Page)pages.lastElement(); - } - - } - - class ElementSet { - public ElementSet() {} - - } - - /** - * creates an empty MIF document - */ - public MIFDocument() { - - bookComponent = new BookComponent(); - - } - - public void createPage() { - - bookComponent.pages.addElement(new Page()); - - } - - public void addToStream(String s) { - - // Add this string to the curent flow - - Para para = curFlow.curPara(); - ParaLine paraLine = para.curParaLine(); - paraLine.addContent(s); - - } - - public void output(OutputStream stream) throws IOException { - // Output the contents of bookComponent - - this.bookComponent.output(stream); - - } - - public void setDocumentHeightWidth(int height, int width) { - - if (bookComponent.document == null) { - - bookComponent.document = new Document(); - bookComponent.document.height = height; - bookComponent.document.width = width; - } else if (bookComponent.document.height != height - || bookComponent.document.width != width) { - - //log.warn("FrameMaker doesnt support different page-sizes in a document"); - } - - } - - public void createTextRect(int numCols) { - - // Create a textrect on the bodypage with these dimensions - // This default behaviour will later be changed to reflect on - // the master-page - - - (bookComponent.curPage()).addTextRect(numCols); - - - // Then create a textflow corresponding to this textrect - - curFlow = new TextFlow(); - bookComponent.textFlows.addElement(curFlow); - } - - public void setTextRectProp(int left, int top, int width, int height) { - - (bookComponent.curPage()).curTextRect().setTextRectProp(left, top, - width, height); - - - } - - public void startLine() { - - if (curFlow.curPara().curParaLine() != null) { - this.addToStream("\n"); - curFlow.curPara().startParaLine(); - } else - curFlow.curPara().startParaLine(); - - - } - - public void setBlockProp(int startIndent, int endIndent) { - - - curFlow.startPara(); // Start a para - curFlow.curPara().setBlockProp(startIndent, endIndent); - - } - - public void createFrame(int x, int y, int w, int h) { - - // Create a new anchored frame - - bookComponent.createFrame(x, y, w, h); - - } - - public void addImage(String url, int x, int y, int w, int h) { - - Frame frame = bookComponent.createFrame(x, y, w, h); - ImportObject imageObject = new ImportObject(url, 0, 0, w, h); - frame.addContent(imageObject); - if (curFlow.curPara().curParaLine() == null) { - curFlow.curPara().startParaLine(); - - } - curFlow.curPara().curParaLine().addContent(frame); - - - } - - public void createTable() { - - // First create a table with an ID, then add it to the textflow - - Tbl table = bookComponent.createTable(); - if (curFlow.curPara().curParaLine() == null) { - curFlow.curPara().startParaLine(); - - } - curFlow.curPara().curParaLine().addContent(table); - - /* - * The above would have added the table to the textflow - * But now the flow goes into the table, so ... - */ - - curFlow = table; - - } - - public void setColumnProp(int colWidth) { - - - // Get the current table - - Tbl table = bookComponent.curTable(); - table.addColumn(colWidth); - - - } - - public void setCurrent(String current) { - - // Start the table body or header or footer - Tbl table = bookComponent.curTable(); - table.setCurrent(current); - - } - - public void startRow() { - - Tbl table = bookComponent.curTable(); - table.startRow(); - - - } - - public void startCell(int rowSpan, int colSpan) { - - Tbl table = bookComponent.curTable(); - table.startCell(rowSpan, colSpan); - - } - - public void endTable() { - - // Switch the ref back to the current textflow - - curFlow = bookComponent.curTextFlow(); - - } - -} diff --git a/src/org/apache/fop/mif/MIFElement.java b/src/org/apache/fop/mif/MIFElement.java new file mode 100644 index 000000000..45fe27e99 --- /dev/null +++ b/src/org/apache/fop/mif/MIFElement.java @@ -0,0 +1,95 @@ +/* + * $Id$ + * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * For details on use and redistribution please refer to the + * LICENSE file included with these sources. + */ + +package org.apache.fop.mif; + +// Java +import java.io.*; +import java.util.*; + +/** + * The is the basis for MIF document elements. + * This enables the creation of the element and to write it + * to an output stream including sub-elements or a single value. + */ +public class MIFElement { + protected String name; + protected String valueStr; + protected ArrayList valueElements = null; + + protected boolean started = false; + protected boolean finish = false; + protected boolean finished = false; + + /** + */ + public MIFElement(String n) { + name = n; + } + + public void setValue(String str) { + valueStr = str; + } + + public void addElement(MIFElement el) { + if(valueElements == null) { + valueElements = new ArrayList(); + } + valueElements.add(el); + } + + /** + * Output this element to an output stream. + * This will output only so far as the fisrt unfinished child element. + * This method can be called again to continue from the previous point. + * An element that contains child elements will only be finished when + * the finish method is called. + */ + public boolean output(OutputStream os, int indent) throws IOException { + if(finished) return true; + String indentStr = ""; + for(int c = 0; c < indent; c++) indentStr += " "; + if(!started) { + os.write((indentStr + "<" + name).getBytes()); + if(valueElements != null) + os.write(("\n").getBytes()); + started = true; + } + if(valueElements != null) { + boolean done = true; + for(Iterator iter = valueElements.iterator(); iter.hasNext(); ) { + MIFElement el = (MIFElement)iter.next(); + boolean d = el.output(os, indent + 1); + if(d) { + iter.remove(); + } else { + done = false; + break; + } + } + if(!finish || !done) { + return false; + } + os.write((indentStr + "> # end of " + name + "\n").getBytes()); + } else { + os.write((" " + valueStr + ">\n").getBytes()); + } + finished = true; + return true; + } + + public void finish(boolean deep) { + finish = true; + if(deep && valueElements != null) { + for(Iterator iter = valueElements.iterator(); iter.hasNext(); ) { + MIFElement el = (MIFElement)iter.next(); + el.finish(deep); + } + } + } +} + diff --git a/src/org/apache/fop/mif/MIFFile.java b/src/org/apache/fop/mif/MIFFile.java new file mode 100644 index 000000000..19cbc9cc0 --- /dev/null +++ b/src/org/apache/fop/mif/MIFFile.java @@ -0,0 +1,124 @@ +/* + * $Id$ + * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * For details on use and redistribution please refer to the + * LICENSE file included with these sources. + */ + +package org.apache.fop.mif; + +// Java +import java.io.*; +import java.util.*; + +/** + * The MIF File. + * This organises the MIF File and the corresponding elements. + * The catalog elements are used to setup the resources that + * are referenced. + */ +public class MIFFile extends MIFElement { + + protected MIFElement colorCatalog = null; + protected PGFElement pgfCatalog = null; + protected MIFElement fontCatalog = null; + protected RulingElement rulingCatalog = null; + protected MIFElement tblCatalog = null; + protected MIFElement views = null; + protected MIFElement variableFormats = null; + protected MIFElement xRefFormats = null; + protected MIFElement document = null; + protected MIFElement bookComponent = null; + protected MIFElement initialAutoNums = null; + protected MIFElement aFrames = null; + protected MIFElement tbls = null; + protected ArrayList pages = new ArrayList(); + protected ArrayList textFlows = null; + + + /** + */ + public MIFFile() { + super(""); + valueElements = new ArrayList(); + setup(); + } + + /** + * Do some setup. + * Currently adds some dummy values to the resources. + */ + protected void setup() { + MIFElement unit = new MIFElement("Units"); + unit.setValue("Ucm"); + addElement(unit); + + colorCatalog = new MIFElement("ColorCatalog"); + MIFElement color = new MIFElement("Color"); + MIFElement prop = new MIFElement("ColorTag"); + prop.setValue("`Black'"); + color.addElement(prop); + prop = new MIFElement("ColorCyan"); + prop.setValue("0.000000"); + color.addElement(prop); + + prop = new MIFElement("ColorMagenta"); + prop.setValue("0.000000"); + color.addElement(prop); + prop = new MIFElement("ColorYellow"); + prop.setValue("0.000000"); + color.addElement(prop); + prop = new MIFElement("ColorBlack"); + prop.setValue("100.000000"); + color.addElement(prop); + prop = new MIFElement("ColorAttribute"); + prop.setValue("ColorIsBlack"); + color.addElement(prop); + prop = new MIFElement("ColorAttribute"); + prop.setValue("ColorIsReserved"); + color.addElement(prop); + color.finish(true); + + colorCatalog.addElement(color); + addElement(colorCatalog); + + pgfCatalog = new PGFElement(); + pgfCatalog.lookupElement(null); + addElement(pgfCatalog); + + rulingCatalog = new RulingElement(); + rulingCatalog.lookupElement(null); + addElement(rulingCatalog); + + } + + public void output(OutputStream os) throws IOException { + if(finished) return; + + if(!started) { + os.write(("<MIFFile 5.00> # Generated by FOP\n"/* + getVersion()*/).getBytes()); + started = true; + } + boolean done = true; + + for(Iterator iter = valueElements.iterator(); iter.hasNext(); ) { + MIFElement el = (MIFElement)iter.next(); + boolean d = el.output(os, 0); + if(d) { + iter.remove(); + } else { + done = false; + break; + } + } + if(done && finish) { + os.write(("# end of MIFFile").getBytes()); + } + } + + public void addPage(MIFElement p) { + pages.add(p); + addElement(p); + } +} + diff --git a/src/org/apache/fop/mif/MIFHandler.java b/src/org/apache/fop/mif/MIFHandler.java new file mode 100644 index 000000000..d874c3052 --- /dev/null +++ b/src/org/apache/fop/mif/MIFHandler.java @@ -0,0 +1,169 @@ +/* + * $Id$ + * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * For details on use and redistribution please refer to the + * LICENSE file included with these sources. + */ + +package org.apache.fop.mif; + +import org.apache.fop.apps.StructureHandler; +import org.apache.fop.layout.FontInfo; +import org.apache.fop.fo.pagination.*; +import org.apache.fop.fo.flow.*; +import org.apache.fop.fo.*; +import org.apache.fop.apps.FOPException; + +// Java +import java.io.*; +import java.util.*; + +import org.xml.sax.SAXException; + +// do we really want every method throwing a SAXException + +/** + * The MIF Handler. + * This generates MIF output using the structure events from + * the FO Tree sent to this structure handler. + * This builds an MIF file and writes it to the output. + */ +public class MIFHandler extends StructureHandler { + protected MIFFile mifFile; + protected OutputStream outStream; + private FontInfo fontInfo = new FontInfo(); + + // current state elements + MIFElement textFlow; + MIFElement para; + + /** + */ + public MIFHandler(OutputStream os) { + outStream = os; + // use pdf fonts for now, this is only for resolving names + org.apache.fop.render.pdf.FontSetup.setup(fontInfo); + } + + public FontInfo getFontInfo() { + return fontInfo; + } + + public void startDocument() throws SAXException { + mifFile = new MIFFile(); + try { + mifFile.output(outStream); + } catch(IOException ioe) { + throw new SAXException(ioe); + } + } + + public void endDocument() throws SAXException { + // finish all open elements + mifFile.finish(true); + try { + mifFile.output(outStream); + outStream.flush(); + } catch(IOException ioe) { + throw new SAXException(ioe); + } + } + + /** + * Start the page sequence. + * This creates the pages in the MIF document that will be used + * by the following flows and static areas. + */ + public void startPageSequence(PageSequence pageSeq, LayoutMasterSet lms) { + // get the layout master set + // setup the pages for this sequence + String name = pageSeq.getProperty("master-reference").getString(); + SimplePageMaster spm = lms.getSimplePageMaster(name); + if(spm == null) { + PageSequenceMaster psm = lms.getPageSequenceMaster(name); + } else { + // create simple master with regions + MIFElement prop = new MIFElement("PageType"); + prop.setValue("BodyPage"); + + MIFElement page = new MIFElement("Page"); + page.addElement(prop); + + prop = new MIFElement("PageBackground"); + prop.setValue("'Default'"); + page.addElement(prop); + + // build regions + MIFElement textRect = new MIFElement("TextRect"); + prop = new MIFElement("ID"); + prop.setValue("1"); + textRect.addElement(prop); + prop = new MIFElement("ShapeRect"); + prop.setValue("0.0 841.889 453.543 0.0"); + textRect.addElement(prop); + page.addElement(textRect); + + textRect = new MIFElement("TextRect"); + prop = new MIFElement("ID"); + prop.setValue("2"); + textRect.addElement(prop); + prop = new MIFElement("ShapeRect"); + prop.setValue("0.0 841.889 453.543 187.65"); + textRect.addElement(prop); + page.addElement(textRect); + + + + mifFile.addPage(page); + } + } + + public void endPageSequence(PageSequence pageSeq) throws FOPException { + + } + + public void startFlow(Flow fl) { + // start text flow in body region + textFlow = new MIFElement("TextFlow"); + } + + public void endFlow(Flow fl) { + textFlow.finish(true); + mifFile.addElement(textFlow); + textFlow = null; + } + + public void startBlock(Block bl) { + para = new MIFElement("Para"); + // get font + textFlow.addElement(para); + } + + public void endBlock(Block bl) { + para.finish(true); + para = null; + } + + public void characters(char data[], int start, int length) { + if(para != null) { + String str = new String(data, start, length); + str = str.trim(); + // break into nice length chunks + if(str.length() == 0) { + return; + } + + MIFElement line = new MIFElement("ParaLine"); + MIFElement prop = new MIFElement("TextRectID"); + prop.setValue("2"); + line.addElement(prop); + prop = new MIFElement("String"); + prop.setValue("\"" + str + "\""); + line.addElement(prop); + + para.addElement(line); + } + } + +} + diff --git a/src/org/apache/fop/mif/PGFElement.java b/src/org/apache/fop/mif/PGFElement.java new file mode 100644 index 000000000..e285c9dda --- /dev/null +++ b/src/org/apache/fop/mif/PGFElement.java @@ -0,0 +1,40 @@ +/* + * $Id$ + * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * For details on use and redistribution please refer to the + * LICENSE file included with these sources. + */ + +package org.apache.fop.mif; + +// Java +import java.io.*; +import java.util.*; + +/** + * Font Catalog element. + * This is the reference lookup element for fonts in + * the MIF document. + */ +public class PGFElement extends RefElement { + + /** + */ + public PGFElement() { + super("PgfCatalog"); + } + + public MIFElement lookupElement(Object key) { + if(key == null) { + MIFElement pgf = new MIFElement("Pgf"); + MIFElement prop = new MIFElement("PgfTag"); + prop.setValue("`Body'"); + pgf.addElement(prop); + addElement(pgf); + pgf.finish(true); + return pgf; + } + return null; + } +} + diff --git a/src/org/apache/fop/mif/RefElement.java b/src/org/apache/fop/mif/RefElement.java new file mode 100644 index 000000000..c96d2d7fc --- /dev/null +++ b/src/org/apache/fop/mif/RefElement.java @@ -0,0 +1,35 @@ +/* + * $Id$ + * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * For details on use and redistribution please refer to the + * LICENSE file included with these sources. + */ + +package org.apache.fop.mif; + +// Java +import java.io.*; +import java.util.*; + +/** + * Reference MIF Element. + * This element is a lookup reference set that contains + * a list of resources used in the MIF Document. + * When a lookup is performed it will either create a new + * element or return an existing element that is valid. + * THe key depends on the type of reference, it should be able + * to uniquely identify the element. + */ +public class RefElement extends MIFElement { + + /** + */ + public RefElement(String n) { + super(n); + } + + public MIFElement lookupElement(Object key) { + return null; + } +} + diff --git a/src/org/apache/fop/mif/RulingElement.java b/src/org/apache/fop/mif/RulingElement.java new file mode 100644 index 000000000..3446cc88d --- /dev/null +++ b/src/org/apache/fop/mif/RulingElement.java @@ -0,0 +1,48 @@ +/* + * $Id$ + * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. + * For details on use and redistribution please refer to the + * LICENSE file included with these sources. + */ + +package org.apache.fop.mif; + +// Java +import java.io.*; +import java.util.*; + +/** + * + */ +public class RulingElement extends RefElement { + + /** + */ + public RulingElement() { + super("RulingCatalog"); + } + + public MIFElement lookupElement(Object key) { + if(key == null) { + MIFElement rul = new MIFElement("Ruling"); + MIFElement prop = new MIFElement("RulingTag"); + prop.setValue("`Default'"); + rul.addElement(prop); + prop = new MIFElement("RulingPenWidth"); + prop.setValue("1"); + rul.addElement(prop); + prop = new MIFElement("RulingPen"); + prop.setValue("0"); + rul.addElement(prop); + prop = new MIFElement("RulingLines"); + prop.setValue("1"); + rul.addElement(prop); + + addElement(rul); + rul.finish(true); + return rul; + } + return null; + } +} + diff --git a/src/org/apache/fop/render/mif/Font.java b/src/org/apache/fop/render/mif/Font.java deleted file mode 100644 index d1cbc9e7d..000000000 --- a/src/org/apache/fop/render/mif/Font.java +++ /dev/null @@ -1,30 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif; - -// FOP -import org.apache.fop.layout.FontMetric; - -/** - * base class for PDF font classes - */ -public abstract class Font implements FontMetric { - - /** - * get the encoding of the font - */ - public abstract String encoding(); - - /** - * get the base font name - */ - public abstract String fontName(); -} - - - diff --git a/src/org/apache/fop/render/mif/FontSetup.java b/src/org/apache/fop/render/mif/FontSetup.java deleted file mode 100644 index df06dd06a..000000000 --- a/src/org/apache/fop/render/mif/FontSetup.java +++ /dev/null @@ -1,158 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif; - -// FOP -import org.apache.fop.render.mif.fonts.*; -import org.apache.fop.layout.FontInfo; -import org.apache.fop.layout.FontDescriptor; -import org.apache.fop.mif.MIFDocument; -// import org.apache.fop.pdf.PDFResources; - -// Java -import java.util.Iterator; -import java.util.HashMap; - -/** - * sets up the PDF fonts. - * - * Assigns the font (with metrics) to internal names like "F1" and - * assigns family-style-weight triplets to the fonts - */ -public class FontSetup { - - /** - * sets up the font info object. - * - * adds metrics for basic fonts and useful family-style-weight - * triplets for lookup - * - * @param fontInfo the font info object to set up - */ - public static void setup(FontInfo fontInfo) { - - fontInfo.addMetrics("F1", new Helvetica()); - fontInfo.addMetrics("F2", new HelveticaOblique()); - fontInfo.addMetrics("F3", new HelveticaBold()); - fontInfo.addMetrics("F4", new HelveticaBoldOblique()); - fontInfo.addMetrics("F5", new TimesRoman()); - fontInfo.addMetrics("F6", new TimesItalic()); - fontInfo.addMetrics("F7", new TimesBold()); - fontInfo.addMetrics("F8", new TimesBoldItalic()); - fontInfo.addMetrics("F9", new Courier()); - fontInfo.addMetrics("F10", new CourierOblique()); - fontInfo.addMetrics("F11", new CourierBold()); - fontInfo.addMetrics("F12", new CourierBoldOblique()); - fontInfo.addMetrics("F13", new Symbol()); - fontInfo.addMetrics("F14", new ZapfDingbats()); - - // Custom type 1 fonts step 1/2 - // fontInfo.addMetrics("F15", new OMEP()); - // fontInfo.addMetrics("F16", new GaramondLightCondensed()); - // fontInfo.addMetrics("F17", new BauerBodoniBoldItalic()); - - /* any is treated as serif */ - fontInfo.addFontProperties("F5", "any", "normal", "normal"); - fontInfo.addFontProperties("F6", "any", "italic", "normal"); - fontInfo.addFontProperties("F6", "any", "oblique", "normal"); - fontInfo.addFontProperties("F7", "any", "normal", "bold"); - fontInfo.addFontProperties("F8", "any", "italic", "bold"); - fontInfo.addFontProperties("F8", "any", "oblique", "bold"); - - fontInfo.addFontProperties("F1", "sans-serif", "normal", "normal"); - fontInfo.addFontProperties("F2", "sans-serif", "oblique", "normal"); - fontInfo.addFontProperties("F2", "sans-serif", "italic", "normal"); - fontInfo.addFontProperties("F3", "sans-serif", "normal", "bold"); - fontInfo.addFontProperties("F4", "sans-serif", "oblique", "bold"); - fontInfo.addFontProperties("F4", "sans-serif", "italic", "bold"); - fontInfo.addFontProperties("F5", "serif", "normal", "normal"); - fontInfo.addFontProperties("F6", "serif", "oblique", "normal"); - fontInfo.addFontProperties("F6", "serif", "italic", "normal"); - fontInfo.addFontProperties("F7", "serif", "normal", "bold"); - fontInfo.addFontProperties("F8", "serif", "oblique", "bold"); - fontInfo.addFontProperties("F8", "serif", "italic", "bold"); - fontInfo.addFontProperties("F9", "monospace", "normal", "normal"); - fontInfo.addFontProperties("F10", "monospace", "oblique", "normal"); - fontInfo.addFontProperties("F10", "monospace", "italic", "normal"); - fontInfo.addFontProperties("F11", "monospace", "normal", "bold"); - fontInfo.addFontProperties("F12", "monospace", "oblique", "bold"); - fontInfo.addFontProperties("F12", "monospace", "italic", "bold"); - - fontInfo.addFontProperties("F1", "Helvetica", "normal", "normal"); - fontInfo.addFontProperties("F2", "Helvetica", "oblique", "normal"); - fontInfo.addFontProperties("F2", "Helvetica", "italic", "normal"); - fontInfo.addFontProperties("F3", "Helvetica", "normal", "bold"); - fontInfo.addFontProperties("F4", "Helvetica", "oblique", "bold"); - fontInfo.addFontProperties("F4", "Helvetica", "italic", "bold"); - fontInfo.addFontProperties("F5", "Times", "normal", "normal"); - fontInfo.addFontProperties("F6", "Times", "oblique", "normal"); - fontInfo.addFontProperties("F6", "Times", "italic", "normal"); - fontInfo.addFontProperties("F7", "Times", "normal", "bold"); - fontInfo.addFontProperties("F8", "Times", "oblique", "bold"); - fontInfo.addFontProperties("F8", "Times", "italic", "bold"); - fontInfo.addFontProperties("F9", "Courier", "normal", "normal"); - fontInfo.addFontProperties("F10", "Courier", "oblique", "normal"); - fontInfo.addFontProperties("F10", "Courier", "italic", "normal"); - fontInfo.addFontProperties("F11", "Courier", "normal", "bold"); - fontInfo.addFontProperties("F12", "Courier", "oblique", "bold"); - fontInfo.addFontProperties("F12", "Courier", "italic", "bold"); - fontInfo.addFontProperties("F13", "Symbol", "normal", "normal"); - fontInfo.addFontProperties("F14", "ZapfDingbats", "normal", "normal"); - - // Custom type 1 fonts step 2/2 - // fontInfo.addFontProperties("F15", "OMEP", "normal", "normal"); - // fontInfo.addFontProperties("F16", "Garamond-LightCondensed", "normal", "normal"); - // fontInfo.addFontProperties("F17", "BauerBodoni", "italic", "bold"); - - /* for compatibility with PassiveTex */ - fontInfo.addFontProperties("F5", "Times-Roman", "normal", "normal"); - fontInfo.addFontProperties("F6", "Times-Roman", "oblique", "normal"); - fontInfo.addFontProperties("F6", "Times-Roman", "italic", "normal"); - fontInfo.addFontProperties("F7", "Times-Roman", "normal", "bold"); - fontInfo.addFontProperties("F8", "Times-Roman", "oblique", "bold"); - fontInfo.addFontProperties("F8", "Times-Roman", "italic", "bold"); - fontInfo.addFontProperties("F5", "Times Roman", "normal", "normal"); - fontInfo.addFontProperties("F6", "Times Roman", "oblique", "normal"); - fontInfo.addFontProperties("F6", "Times Roman", "italic", "normal"); - fontInfo.addFontProperties("F7", "Times Roman", "normal", "bold"); - fontInfo.addFontProperties("F8", "Times Roman", "oblique", "bold"); - fontInfo.addFontProperties("F8", "Times Roman", "italic", "bold"); - fontInfo.addFontProperties("F9", "Computer-Modern-Typewriter", - "normal", "normal"); - } - - /** - * add the fonts in the font info to the PDF document - * - * @param doc PDF document to add fonts to - * @param fontInfo font info object to get font information from - */ - public static void addToFontFormat(MIFDocument mifDoc, - FontInfo fontInfo) { - - HashMap fonts = fontInfo.getFonts(); - Iterator e = fonts.keySet().iterator(); - while (e.hasNext()) { - String f = (String)e.next(); - Font font = (Font)fonts.get(f); - FontDescriptor desc = null; - if (font instanceof FontDescriptor) { - desc = (FontDescriptor)font; - } - /* - * mifDoc.makeFont(f,font.fontName(), - * font.encoding(), - * font, - * desc - * ); - */ - - } - } - -} diff --git a/src/org/apache/fop/render/mif/MIFRenderer.java b/src/org/apache/fop/render/mif/MIFRenderer.java deleted file mode 100644 index 1f2cec7bd..000000000 --- a/src/org/apache/fop/render/mif/MIFRenderer.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -// Author : Seshadri G - -package org.apache.fop.render.mif; - -// FOP -import org.apache.fop.render.Renderer; -import org.apache.fop.render.AbstractRenderer; -import org.apache.fop.image.FopImage; -import org.apache.fop.apps.FOPException; -import org.apache.fop.fo.properties.*; -import org.apache.fop.fo.*; -import org.apache.fop.layout.*; -import org.apache.fop.layout.inline.*; -import org.apache.fop.datatypes.*; -import org.apache.fop.svg.*; -import org.apache.fop.mif.*; -import org.apache.fop.layout.*; -import org.apache.fop.image.*; - -import org.w3c.dom.*; -import org.w3c.dom.svg.*; -import org.w3c.dom.css.*; -import org.w3c.dom.svg.SVGLength; - -// Java -import java.io.IOException; -import java.io.OutputStream; -import java.util.Enumeration; -import java.awt.Rectangle; -import java.util.Vector; -import java.util.Hashtable; - -/** - * Renderer that renders areas to MIF - * - */ -public class MIFRenderer extends AbstractRenderer { - - private String currentFontName; - private String currentFontSize; - private int pageHeight; - private int pageWidth; - - /** - * the current vertical position in millipoints from bottom - */ - protected int currentYPosition = 0; - - /** - * the current horizontal position in millipoints from left - */ - protected int currentXPosition = 0; - - /** - * the horizontal position of the current area container - */ - private int currentAreaContainerXPosition = 0; - - - /** - * the MIF Document being created - */ - protected MIFDocument mifDoc; - - - /* is a table currently open? */ - private boolean inTable = false; - - /** - * create the MIF renderer - */ - public MIFRenderer() { - this.mifDoc = new MIFDocument(); - } - - public void startRenderer(OutputStream outputStream) - throws IOException {} - - /** - * set up the given FontInfo - */ - public void setupFontInfo(FontInfo fontInfo) { - - FontSetup.setup(fontInfo); - // FontSetup.addToFontFormat(this.mifDoc, fontInfo); - - } - - /** - * set the producer of the rendering - */ - public void setProducer(String producer) {} - - - /** - */ - public void stopRenderer() - throws IOException { - log.info("writing out MIF"); - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/Courier.java b/src/org/apache/fop/render/mif/fonts/Courier.java deleted file mode 100644 index ec22420a3..000000000 --- a/src/org/apache/fop/render/mif/fonts/Courier.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class Courier extends Font { - private final static String fontName = "Courier"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 562; - private final static int xHeight = 426; - private final static int ascender = 629; - private final static int descender = -157; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 600; - width[0x00C6] = 600; - width[0x00C1] = 600; - width[0x00C2] = 600; - width[0x00C4] = 600; - width[0x00C0] = 600; - width[0x00C5] = 600; - width[0x00C3] = 600; - width[0x0042] = 600; - width[0x0043] = 600; - width[0x00C7] = 600; - width[0x0044] = 600; - width[0x0045] = 600; - width[0x00C9] = 600; - width[0x00CA] = 600; - width[0x00CB] = 600; - width[0x00C8] = 600; - width[0x00D0] = 600; - width[0x0046] = 600; - width[0x0047] = 600; - width[0x0048] = 600; - width[0x0049] = 600; - width[0x00CD] = 600; - width[0x00CE] = 600; - width[0x00CF] = 600; - width[0x00CC] = 600; - width[0x004A] = 600; - width[0x004B] = 600; - width[0x004C] = 600; - width[0x004D] = 600; - width[0x004E] = 600; - width[0x00D1] = 600; - width[0x004F] = 600; - width[0x008C] = 600; - width[0x00D3] = 600; - width[0x00D4] = 600; - width[0x00D6] = 600; - width[0x00D2] = 600; - width[0x00D8] = 600; - width[0x00D5] = 600; - width[0x0050] = 600; - width[0x0051] = 600; - width[0x0052] = 600; - width[0x0053] = 600; - width[0x008A] = 600; - width[0x0054] = 600; - width[0x00DE] = 600; - width[0x0055] = 600; - width[0x00DA] = 600; - width[0x00DB] = 600; - width[0x00DC] = 600; - width[0x00D9] = 600; - width[0x0056] = 600; - width[0x0057] = 600; - width[0x0058] = 600; - width[0x0059] = 600; - width[0x00DD] = 600; - width[0x009F] = 600; - width[0x005A] = 600; - width[0x0061] = 600; - width[0x00E1] = 600; - width[0x00E2] = 600; - width[0x00B4] = 600; - width[0x00E4] = 600; - width[0x00E6] = 600; - width[0x00E0] = 600; - width[0x0026] = 600; - width[0x00E5] = 600; - width[0xAB] = 600; - width[0xAF] = 600; - width[0xAC] = 600; - width[0xAE] = 600; - width[0xAD] = 600; - width[0x005E] = 600; - width[0x007E] = 600; - width[0x002A] = 600; - width[0x0040] = 600; - width[0x00E3] = 600; - width[0x0062] = 600; - width[0x005C] = 600; - width[0x007C] = 600; - width[0x007B] = 600; - width[0x007D] = 600; - width[0x005B] = 600; - width[0x005D] = 600; - width[0x00A6] = 600; - width[0x0095] = 600; - width[0x0063] = 600; - width[0x00E7] = 600; - width[0x00B8] = 600; - width[0x00A2] = 600; - width[0x0088] = 600; - width[0x003A] = 600; - width[0x002C] = 600; - width[0x00A9] = 600; - width[0x00A4] = 600; - width[0x0064] = 600; - width[0x0086] = 600; - width[0x0087] = 600; - width[0x00B0] = 600; - width[0x00A8] = 600; - width[0x00F7] = 600; - width[0x0024] = 600; - width[0x0065] = 600; - width[0x00E9] = 600; - width[0x00EA] = 600; - width[0x00EB] = 600; - width[0x00E8] = 600; - width[0x0038] = 600; - width[0x0085] = 600; - width[0x0097] = 600; - width[0x0096] = 600; - width[0x003D] = 600; - width[0x00F0] = 600; - width[0x0021] = 600; - width[0x00A1] = 600; - width[0x0066] = 600; - width[0x0035] = 600; - width[0x0083] = 600; - width[0x0034] = 600; - width[0xA4] = 600; - width[0x0067] = 600; - width[0x00DF] = 600; - width[0x0060] = 600; - width[0x003E] = 600; - width[0x00AB] = 600; - width[0x00BB] = 600; - width[0x008B] = 600; - width[0x009B] = 600; - width[0x0068] = 600; - width[0x002D] = 600; - width[0x0069] = 600; - width[0x00ED] = 600; - width[0x00EE] = 600; - width[0x00EF] = 600; - width[0x00EC] = 600; - width[0x006A] = 600; - width[0x006B] = 600; - width[0x006C] = 600; - width[0x003C] = 600; - width[0x00AC] = 600; - width[0x006D] = 600; - width[0x00AF] = 600; - width[0x2D] = 600; - width[0x00B5] = 600; - width[0x00D7] = 600; - width[0x006E] = 600; - width[0x0039] = 600; - width[0x00F1] = 600; - width[0x0023] = 600; - width[0x006F] = 600; - width[0x00F3] = 600; - width[0x00F4] = 600; - width[0x00F6] = 600; - width[0x009C] = 600; - width[0x00F2] = 600; - width[0x0031] = 600; - width[0x00BD] = 600; - width[0x00BC] = 600; - width[0x00B9] = 600; - width[0x00AA] = 600; - width[0x00BA] = 600; - width[0x00F8] = 600; - width[0x00F5] = 600; - width[0x0070] = 600; - width[0x00B6] = 600; - width[0x0028] = 600; - width[0x0029] = 600; - width[0x0025] = 600; - width[0x002E] = 600; - width[0x00B7] = 600; - width[0x0089] = 600; - width[0x002B] = 600; - width[0x00B1] = 600; - width[0x0071] = 600; - width[0x003F] = 600; - width[0x00BF] = 600; - width[0x0022] = 600; - width[0x0084] = 600; - width[0x0093] = 600; - width[0x0094] = 600; - width[0x0091] = 600; - width[0x0092] = 600; - width[0x0082] = 600; - width[0x0027] = 600; - width[0x0072] = 600; - width[0x00AE] = 600; - width[0x00B0] = 600; - width[0x0073] = 600; - width[0x009A] = 600; - width[0x00A7] = 600; - width[0x003B] = 600; - width[0x0037] = 600; - width[0x0036] = 600; - width[0x002F] = 600; - width[0x0020] = 600; - width[0x00A0] = 600; - width[0x00A3] = 600; - width[0x0074] = 600; - width[0x00FE] = 600; - width[0x0033] = 600; - width[0x00BE] = 600; - width[0x00B3] = 600; - width[0x0098] = 600; - width[0x0099] = 600; - width[0x0032] = 600; - width[0x00B2] = 600; - width[0x0075] = 600; - width[0x00FA] = 600; - width[0x00FB] = 600; - width[0x00FC] = 600; - width[0x00F9] = 600; - width[0x005F] = 600; - width[0x0076] = 600; - width[0x0077] = 600; - width[0x0078] = 600; - width[0x0079] = 600; - width[0x00FD] = 600; - width[0x00FF] = 600; - width[0x00A5] = 600; - width[0x007A] = 600; - width[0x0030] = 600; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/CourierBold.java b/src/org/apache/fop/render/mif/fonts/CourierBold.java deleted file mode 100644 index 9f5c4a756..000000000 --- a/src/org/apache/fop/render/mif/fonts/CourierBold.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class CourierBold extends Font { - private final static String fontName = "Courier-Bold"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 562; - private final static int xHeight = 439; - private final static int ascender = 626; - private final static int descender = -142; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 600; - width[0x00C6] = 600; - width[0x00C1] = 600; - width[0x00C2] = 600; - width[0x00C4] = 600; - width[0x00C0] = 600; - width[0x00C5] = 600; - width[0x00C3] = 600; - width[0x0042] = 600; - width[0x0043] = 600; - width[0x00C7] = 600; - width[0x0044] = 600; - width[0x0045] = 600; - width[0x00C9] = 600; - width[0x00CA] = 600; - width[0x00CB] = 600; - width[0x00C8] = 600; - width[0x00D0] = 600; - width[0x0046] = 600; - width[0x0047] = 600; - width[0x0048] = 600; - width[0x0049] = 600; - width[0x00CD] = 600; - width[0x00CE] = 600; - width[0x00CF] = 600; - width[0x00CC] = 600; - width[0x004A] = 600; - width[0x004B] = 600; - width[0x004C] = 600; - width[0x004D] = 600; - width[0x004E] = 600; - width[0x00D1] = 600; - width[0x004F] = 600; - width[0x008C] = 600; - width[0x00D3] = 600; - width[0x00D4] = 600; - width[0x00D6] = 600; - width[0x00D2] = 600; - width[0x00D8] = 600; - width[0x00D5] = 600; - width[0x0050] = 600; - width[0x0051] = 600; - width[0x0052] = 600; - width[0x0053] = 600; - width[0x008A] = 600; - width[0x0054] = 600; - width[0x00DE] = 600; - width[0x0055] = 600; - width[0x00DA] = 600; - width[0x00DB] = 600; - width[0x00DC] = 600; - width[0x00D9] = 600; - width[0x0056] = 600; - width[0x0057] = 600; - width[0x0058] = 600; - width[0x0059] = 600; - width[0x00DD] = 600; - width[0x009F] = 600; - width[0x005A] = 600; - width[0x0061] = 600; - width[0x00E1] = 600; - width[0x00E2] = 600; - width[0x00B4] = 600; - width[0x00E4] = 600; - width[0x00E6] = 600; - width[0x00E0] = 600; - width[0x0026] = 600; - width[0x00E5] = 600; - width[0xAB] = 600; - width[0xAF] = 600; - width[0xAC] = 600; - width[0xAE] = 600; - width[0xAD] = 600; - width[0x005E] = 600; - width[0x007E] = 600; - width[0x002A] = 600; - width[0x0040] = 600; - width[0x00E3] = 600; - width[0x0062] = 600; - width[0x005C] = 600; - width[0x007C] = 600; - width[0x007B] = 600; - width[0x007D] = 600; - width[0x005B] = 600; - width[0x005D] = 600; - width[0x00A6] = 600; - width[0x0095] = 600; - width[0x0063] = 600; - width[0x00E7] = 600; - width[0x00B8] = 600; - width[0x00A2] = 600; - width[0x0088] = 600; - width[0x003A] = 600; - width[0x002C] = 600; - width[0x00A9] = 600; - width[0x00A4] = 600; - width[0x0064] = 600; - width[0x0086] = 600; - width[0x0087] = 600; - width[0x00B0] = 600; - width[0x00A8] = 600; - width[0x00F7] = 600; - width[0x0024] = 600; - width[0x0065] = 600; - width[0x00E9] = 600; - width[0x00EA] = 600; - width[0x00EB] = 600; - width[0x00E8] = 600; - width[0x0038] = 600; - width[0x0085] = 600; - width[0x0097] = 600; - width[0x0096] = 600; - width[0x003D] = 600; - width[0x00F0] = 600; - width[0x0021] = 600; - width[0x00A1] = 600; - width[0x0066] = 600; - width[0x0035] = 600; - width[0x0083] = 600; - width[0x0034] = 600; - width[0xA4] = 600; - width[0x0067] = 600; - width[0x00DF] = 600; - width[0x0060] = 600; - width[0x003E] = 600; - width[0x00AB] = 600; - width[0x00BB] = 600; - width[0x008B] = 600; - width[0x009B] = 600; - width[0x0068] = 600; - width[0x002D] = 600; - width[0x0069] = 600; - width[0x00ED] = 600; - width[0x00EE] = 600; - width[0x00EF] = 600; - width[0x00EC] = 600; - width[0x006A] = 600; - width[0x006B] = 600; - width[0x006C] = 600; - width[0x003C] = 600; - width[0x00AC] = 600; - width[0x006D] = 600; - width[0x00AF] = 600; - width[0x2D] = 600; - width[0x00B5] = 600; - width[0x00D7] = 600; - width[0x006E] = 600; - width[0x0039] = 600; - width[0x00F1] = 600; - width[0x0023] = 600; - width[0x006F] = 600; - width[0x00F3] = 600; - width[0x00F4] = 600; - width[0x00F6] = 600; - width[0x009C] = 600; - width[0x00F2] = 600; - width[0x0031] = 600; - width[0x00BD] = 600; - width[0x00BC] = 600; - width[0x00B9] = 600; - width[0x00AA] = 600; - width[0x00BA] = 600; - width[0x00F8] = 600; - width[0x00F5] = 600; - width[0x0070] = 600; - width[0x00B6] = 600; - width[0x0028] = 600; - width[0x0029] = 600; - width[0x0025] = 600; - width[0x002E] = 600; - width[0x00B7] = 600; - width[0x0089] = 600; - width[0x002B] = 600; - width[0x00B1] = 600; - width[0x0071] = 600; - width[0x003F] = 600; - width[0x00BF] = 600; - width[0x0022] = 600; - width[0x0084] = 600; - width[0x0093] = 600; - width[0x0094] = 600; - width[0x0091] = 600; - width[0x0092] = 600; - width[0x0082] = 600; - width[0x0027] = 600; - width[0x0072] = 600; - width[0x00AE] = 600; - width[0x00B0] = 600; - width[0x0073] = 600; - width[0x009A] = 600; - width[0x00A7] = 600; - width[0x003B] = 600; - width[0x0037] = 600; - width[0x0036] = 600; - width[0x002F] = 600; - width[0x0020] = 600; - width[0x00A0] = 600; - width[0x00A3] = 600; - width[0x0074] = 600; - width[0x00FE] = 600; - width[0x0033] = 600; - width[0x00BE] = 600; - width[0x00B3] = 600; - width[0x0098] = 600; - width[0x0099] = 600; - width[0x0032] = 600; - width[0x00B2] = 600; - width[0x0075] = 600; - width[0x00FA] = 600; - width[0x00FB] = 600; - width[0x00FC] = 600; - width[0x00F9] = 600; - width[0x005F] = 600; - width[0x0076] = 600; - width[0x0077] = 600; - width[0x0078] = 600; - width[0x0079] = 600; - width[0x00FD] = 600; - width[0x00FF] = 600; - width[0x00A5] = 600; - width[0x007A] = 600; - width[0x0030] = 600; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/CourierBoldOblique.java b/src/org/apache/fop/render/mif/fonts/CourierBoldOblique.java deleted file mode 100644 index 89483df6b..000000000 --- a/src/org/apache/fop/render/mif/fonts/CourierBoldOblique.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class CourierBoldOblique extends Font { - private final static String fontName = "Courier-BoldOblique"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 562; - private final static int xHeight = 439; - private final static int ascender = 626; - private final static int descender = -142; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 600; - width[0x00C6] = 600; - width[0x00C1] = 600; - width[0x00C2] = 600; - width[0x00C4] = 600; - width[0x00C0] = 600; - width[0x00C5] = 600; - width[0x00C3] = 600; - width[0x0042] = 600; - width[0x0043] = 600; - width[0x00C7] = 600; - width[0x0044] = 600; - width[0x0045] = 600; - width[0x00C9] = 600; - width[0x00CA] = 600; - width[0x00CB] = 600; - width[0x00C8] = 600; - width[0x00D0] = 600; - width[0x0046] = 600; - width[0x0047] = 600; - width[0x0048] = 600; - width[0x0049] = 600; - width[0x00CD] = 600; - width[0x00CE] = 600; - width[0x00CF] = 600; - width[0x00CC] = 600; - width[0x004A] = 600; - width[0x004B] = 600; - width[0x004C] = 600; - width[0x004D] = 600; - width[0x004E] = 600; - width[0x00D1] = 600; - width[0x004F] = 600; - width[0x008C] = 600; - width[0x00D3] = 600; - width[0x00D4] = 600; - width[0x00D6] = 600; - width[0x00D2] = 600; - width[0x00D8] = 600; - width[0x00D5] = 600; - width[0x0050] = 600; - width[0x0051] = 600; - width[0x0052] = 600; - width[0x0053] = 600; - width[0x008A] = 600; - width[0x0054] = 600; - width[0x00DE] = 600; - width[0x0055] = 600; - width[0x00DA] = 600; - width[0x00DB] = 600; - width[0x00DC] = 600; - width[0x00D9] = 600; - width[0x0056] = 600; - width[0x0057] = 600; - width[0x0058] = 600; - width[0x0059] = 600; - width[0x00DD] = 600; - width[0x009F] = 600; - width[0x005A] = 600; - width[0x0061] = 600; - width[0x00E1] = 600; - width[0x00E2] = 600; - width[0x00B4] = 600; - width[0x00E4] = 600; - width[0x00E6] = 600; - width[0x00E0] = 600; - width[0x0026] = 600; - width[0x00E5] = 600; - width[0xAB] = 600; - width[0xAF] = 600; - width[0xAC] = 600; - width[0xAE] = 600; - width[0xAD] = 600; - width[0x005E] = 600; - width[0x007E] = 600; - width[0x002A] = 600; - width[0x0040] = 600; - width[0x00E3] = 600; - width[0x0062] = 600; - width[0x005C] = 600; - width[0x007C] = 600; - width[0x007B] = 600; - width[0x007D] = 600; - width[0x005B] = 600; - width[0x005D] = 600; - width[0x00A6] = 600; - width[0x0095] = 600; - width[0x0063] = 600; - width[0x00E7] = 600; - width[0x00B8] = 600; - width[0x00A2] = 600; - width[0x0088] = 600; - width[0x003A] = 600; - width[0x002C] = 600; - width[0x00A9] = 600; - width[0x00A4] = 600; - width[0x0064] = 600; - width[0x0086] = 600; - width[0x0087] = 600; - width[0x00B0] = 600; - width[0x00A8] = 600; - width[0x00F7] = 600; - width[0x0024] = 600; - width[0x0065] = 600; - width[0x00E9] = 600; - width[0x00EA] = 600; - width[0x00EB] = 600; - width[0x00E8] = 600; - width[0x0038] = 600; - width[0x0085] = 600; - width[0x0097] = 600; - width[0x0096] = 600; - width[0x003D] = 600; - width[0x00F0] = 600; - width[0x0021] = 600; - width[0x00A1] = 600; - width[0x0066] = 600; - width[0x0035] = 600; - width[0x0083] = 600; - width[0x0034] = 600; - width[0xA4] = 600; - width[0x0067] = 600; - width[0x00DF] = 600; - width[0x0060] = 600; - width[0x003E] = 600; - width[0x00AB] = 600; - width[0x00BB] = 600; - width[0x008B] = 600; - width[0x009B] = 600; - width[0x0068] = 600; - width[0x002D] = 600; - width[0x0069] = 600; - width[0x00ED] = 600; - width[0x00EE] = 600; - width[0x00EF] = 600; - width[0x00EC] = 600; - width[0x006A] = 600; - width[0x006B] = 600; - width[0x006C] = 600; - width[0x003C] = 600; - width[0x00AC] = 600; - width[0x006D] = 600; - width[0x00AF] = 600; - width[0x2D] = 600; - width[0x00B5] = 600; - width[0x00D7] = 600; - width[0x006E] = 600; - width[0x0039] = 600; - width[0x00F1] = 600; - width[0x0023] = 600; - width[0x006F] = 600; - width[0x00F3] = 600; - width[0x00F4] = 600; - width[0x00F6] = 600; - width[0x009C] = 600; - width[0x00F2] = 600; - width[0x0031] = 600; - width[0x00BD] = 600; - width[0x00BC] = 600; - width[0x00B9] = 600; - width[0x00AA] = 600; - width[0x00BA] = 600; - width[0x00F8] = 600; - width[0x00F5] = 600; - width[0x0070] = 600; - width[0x00B6] = 600; - width[0x0028] = 600; - width[0x0029] = 600; - width[0x0025] = 600; - width[0x002E] = 600; - width[0x00B7] = 600; - width[0x0089] = 600; - width[0x002B] = 600; - width[0x00B1] = 600; - width[0x0071] = 600; - width[0x003F] = 600; - width[0x00BF] = 600; - width[0x0022] = 600; - width[0x0084] = 600; - width[0x0093] = 600; - width[0x0094] = 600; - width[0x0091] = 600; - width[0x0092] = 600; - width[0x0082] = 600; - width[0x0027] = 600; - width[0x0072] = 600; - width[0x00AE] = 600; - width[0x00B0] = 600; - width[0x0073] = 600; - width[0x009A] = 600; - width[0x00A7] = 600; - width[0x003B] = 600; - width[0x0037] = 600; - width[0x0036] = 600; - width[0x002F] = 600; - width[0x0020] = 600; - width[0x00A0] = 600; - width[0x00A3] = 600; - width[0x0074] = 600; - width[0x00FE] = 600; - width[0x0033] = 600; - width[0x00BE] = 600; - width[0x00B3] = 600; - width[0x0098] = 600; - width[0x0099] = 600; - width[0x0032] = 600; - width[0x00B2] = 600; - width[0x0075] = 600; - width[0x00FA] = 600; - width[0x00FB] = 600; - width[0x00FC] = 600; - width[0x00F9] = 600; - width[0x005F] = 600; - width[0x0076] = 600; - width[0x0077] = 600; - width[0x0078] = 600; - width[0x0079] = 600; - width[0x00FD] = 600; - width[0x00FF] = 600; - width[0x00A5] = 600; - width[0x007A] = 600; - width[0x0030] = 600; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/CourierOblique.java b/src/org/apache/fop/render/mif/fonts/CourierOblique.java deleted file mode 100644 index e5c19f20d..000000000 --- a/src/org/apache/fop/render/mif/fonts/CourierOblique.java +++ /dev/null @@ -1,296 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class CourierOblique extends Font { - private final static String fontName = "Courier-Oblique"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 562; - private final static int xHeight = 426; - private final static int ascender = 629; - private final static int descender = -157; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 600; - width[0x00C6] = 600; - width[0x00C1] = 600; - width[0x00C2] = 600; - width[0x00C4] = 600; - width[0x00C0] = 600; - width[0x00C5] = 600; - width[0x00C3] = 600; - width[0x0042] = 600; - width[0x0043] = 600; - width[0x00C7] = 600; - width[0x0044] = 600; - width[0x0045] = 600; - width[0x00C9] = 600; - width[0x00CA] = 600; - width[0x00CB] = 600; - width[0x00C8] = 600; - width[0x00D0] = 600; - width[0x0046] = 600; - width[0x0047] = 600; - width[0x0048] = 600; - width[0x0049] = 600; - width[0x00CD] = 600; - width[0x00CE] = 600; - width[0x00CF] = 600; - width[0x00CC] = 600; - width[0x004A] = 600; - width[0x004B] = 600; - width[0x004C] = 600; - width[0x004D] = 600; - width[0x004E] = 600; - width[0x00D1] = 600; - width[0x004F] = 600; - width[0x008C] = 600; - width[0x00D3] = 600; - width[0x00D4] = 600; - width[0x00D6] = 600; - width[0x00D2] = 600; - width[0x00D8] = 600; - width[0x00D5] = 600; - width[0x0050] = 600; - width[0x0051] = 600; - width[0x0052] = 600; - width[0x0053] = 600; - width[0x008A] = 600; - width[0x0054] = 600; - width[0x00DE] = 600; - width[0x0055] = 600; - width[0x00DA] = 600; - width[0x00DB] = 600; - width[0x00DC] = 600; - width[0x00D9] = 600; - width[0x0056] = 600; - width[0x0057] = 600; - width[0x0058] = 600; - width[0x0059] = 600; - width[0x00DD] = 600; - width[0x009F] = 600; - width[0x005A] = 600; - width[0x0061] = 600; - width[0x00E1] = 600; - width[0x00E2] = 600; - width[0x00B4] = 600; - width[0x00E4] = 600; - width[0x00E6] = 600; - width[0x00E0] = 600; - width[0x0026] = 600; - width[0x00E5] = 600; - width[0xAB] = 600; - width[0xAF] = 600; - width[0xAC] = 600; - width[0xAE] = 600; - width[0xAD] = 600; - width[0x005E] = 600; - width[0x007E] = 600; - width[0x002A] = 600; - width[0x0040] = 600; - width[0x00E3] = 600; - width[0x0062] = 600; - width[0x005C] = 600; - width[0x007C] = 600; - width[0x007B] = 600; - width[0x007D] = 600; - width[0x005B] = 600; - width[0x005D] = 600; - width[0x00A6] = 600; - width[0x0095] = 600; - width[0x0063] = 600; - width[0x00E7] = 600; - width[0x00B8] = 600; - width[0x00A2] = 600; - width[0x0088] = 600; - width[0x003A] = 600; - width[0x002C] = 600; - width[0x00A9] = 600; - width[0x00A4] = 600; - width[0x0064] = 600; - width[0x0086] = 600; - width[0x0087] = 600; - width[0x00B0] = 600; - width[0x00A8] = 600; - width[0x00F7] = 600; - width[0x0024] = 600; - width[0x0065] = 600; - width[0x00E9] = 600; - width[0x00EA] = 600; - width[0x00EB] = 600; - width[0x00E8] = 600; - width[0x0038] = 600; - width[0x0085] = 600; - width[0x0097] = 600; - width[0x0096] = 600; - width[0x003D] = 600; - width[0x00F0] = 600; - width[0x0021] = 600; - width[0x00A1] = 600; - width[0x0066] = 600; - width[0x0035] = 600; - width[0x0083] = 600; - width[0x0034] = 600; - width[0xA4] = 600; - width[0x0067] = 600; - width[0x00DF] = 600; - width[0x0060] = 600; - width[0x003E] = 600; - width[0x00AB] = 600; - width[0x00BB] = 600; - width[0x008B] = 600; - width[0x009B] = 600; - width[0x0068] = 600; - width[0x002D] = 600; - width[0x0069] = 600; - width[0x00ED] = 600; - width[0x00EE] = 600; - width[0x00EF] = 600; - width[0x00EC] = 600; - width[0x006A] = 600; - width[0x006B] = 600; - width[0x006C] = 600; - width[0x003C] = 600; - width[0x00AC] = 600; - width[0x006D] = 600; - width[0x00AF] = 600; - width[0x2D] = 600; - width[0x00B5] = 600; - width[0x00D7] = 600; - width[0x006E] = 600; - width[0x0039] = 600; - width[0x00F1] = 600; - width[0x0023] = 600; - width[0x006F] = 600; - width[0x00F3] = 600; - width[0x00F4] = 600; - width[0x00F6] = 600; - width[0x009C] = 600; - width[0x00F2] = 600; - width[0x0031] = 600; - width[0x00BD] = 600; - width[0x00BC] = 600; - width[0x00B9] = 600; - width[0x00AA] = 600; - width[0x00BA] = 600; - width[0x00F8] = 600; - width[0x00F5] = 600; - width[0x0070] = 600; - width[0x00B6] = 600; - width[0x0028] = 600; - width[0x0029] = 600; - width[0x0025] = 600; - width[0x002E] = 600; - width[0x00B7] = 600; - width[0x0089] = 600; - width[0x002B] = 600; - width[0x00B1] = 600; - width[0x0071] = 600; - width[0x003F] = 600; - width[0x00BF] = 600; - width[0x0022] = 600; - width[0x0084] = 600; - width[0x0093] = 600; - width[0x0094] = 600; - width[0x0091] = 600; - width[0x0092] = 600; - width[0x0082] = 600; - width[0x0027] = 600; - width[0x0072] = 600; - width[0x00AE] = 600; - width[0x00B0] = 600; - width[0x0073] = 600; - width[0x009A] = 600; - width[0x00A7] = 600; - width[0x003B] = 600; - width[0x0037] = 600; - width[0x0036] = 600; - width[0x002F] = 600; - width[0x0020] = 600; - width[0x00A0] = 600; - width[0x00A3] = 600; - width[0x0074] = 600; - width[0x00FE] = 600; - width[0x0033] = 600; - width[0x00BE] = 600; - width[0x00B3] = 600; - width[0x0098] = 600; - width[0x0099] = 600; - width[0x0032] = 600; - width[0x00B2] = 600; - width[0x0075] = 600; - width[0x00FA] = 600; - width[0x00FB] = 600; - width[0x00FC] = 600; - width[0x00F9] = 600; - width[0x005F] = 600; - width[0x0076] = 600; - width[0x0077] = 600; - width[0x0078] = 600; - width[0x0079] = 600; - width[0x00FD] = 600; - width[0x00FF] = 600; - width[0x00A5] = 600; - width[0x007A] = 600; - width[0x0030] = 600; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/Helvetica.java b/src/org/apache/fop/render/mif/fonts/Helvetica.java deleted file mode 100644 index f6722774f..000000000 --- a/src/org/apache/fop/render/mif/fonts/Helvetica.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class Helvetica extends Font { - private final static String fontName = "Helvetica"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 718; - private final static int xHeight = 523; - private final static int ascender = 718; - private final static int descender = -207; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 667; - width[0x00C6] = 1000; - width[0x00C1] = 667; - width[0x00C2] = 667; - width[0x00C4] = 667; - width[0x00C0] = 667; - width[0x00C5] = 667; - width[0x00C3] = 667; - width[0x0042] = 667; - width[0x0043] = 722; - width[0x00C7] = 722; - width[0x0044] = 722; - width[0x0045] = 667; - width[0x00C9] = 667; - width[0x00CA] = 667; - width[0x00CB] = 667; - width[0x00C8] = 667; - width[0x00D0] = 722; - width[0x0046] = 611; - width[0x0047] = 778; - width[0x0048] = 722; - width[0x0049] = 278; - width[0x00CD] = 278; - width[0x00CE] = 278; - width[0x00CF] = 278; - width[0x00CC] = 278; - width[0x004A] = 500; - width[0x004B] = 667; - width[0x004C] = 556; - width[0x004D] = 833; - width[0x004E] = 722; - width[0x00D1] = 722; - width[0x004F] = 778; - width[0x008C] = 1000; - width[0x00D3] = 778; - width[0x00D4] = 778; - width[0x00D6] = 778; - width[0x00D2] = 778; - width[0x00D8] = 778; - width[0x00D5] = 778; - width[0x0050] = 667; - width[0x0051] = 778; - width[0x0052] = 722; - width[0x0053] = 667; - width[0x008A] = 667; - width[0x0054] = 611; - width[0x00DE] = 667; - width[0x0055] = 722; - width[0x00DA] = 722; - width[0x00DB] = 722; - width[0x00DC] = 722; - width[0x00D9] = 722; - width[0x0056] = 667; - width[0x0057] = 944; - width[0x0058] = 667; - width[0x0059] = 667; - width[0x00DD] = 667; - width[0x009F] = 667; - width[0x005A] = 611; - width[0x0061] = 556; - width[0x00E1] = 556; - width[0x00E2] = 556; - width[0x00B4] = 333; - width[0x00E4] = 556; - width[0x00E6] = 889; - width[0x00E0] = 556; - width[0x0026] = 667; - width[0x00E5] = 556; - width[0x005E] = 469; - width[0x007E] = 584; - width[0x002A] = 389; - width[0x0040] = 1015; - width[0x00E3] = 556; - width[0x0062] = 556; - width[0x005C] = 278; - width[0x007C] = 260; - width[0x007B] = 334; - width[0x007D] = 334; - width[0x005B] = 278; - width[0x005D] = 278; - width[0x00A6] = 260; - width[0x0095] = 350; - width[0x0063] = 500; - width[0x00E7] = 500; - width[0x00B8] = 333; - width[0x00A2] = 556; - width[0x0088] = 333; - width[0x003A] = 278; - width[0x002C] = 278; - width[0x00A9] = 737; - width[0x00A4] = 556; - width[0x0064] = 556; - width[0x0086] = 556; - width[0x0087] = 556; - width[0x00B0] = 400; - width[0x00A8] = 333; - width[0x00F7] = 584; - width[0x0024] = 556; - width[0x0065] = 556; - width[0x00E9] = 556; - width[0x00EA] = 556; - width[0x00EB] = 556; - width[0x00E8] = 556; - width[0x0038] = 556; - width[0x0085] = 1000; - width[0x0097] = 1000; - width[0x0096] = 556; - width[0x003D] = 584; - width[0x00F0] = 556; - width[0x0021] = 278; - width[0x00A1] = 333; - width[0x0066] = 278; - width[0x0035] = 556; - width[0x0083] = 556; - width[0x0034] = 556; - width[0xA4] = 167; - width[0x0067] = 556; - width[0x00DF] = 611; - width[0x0060] = 333; - width[0x003E] = 584; - width[0x00AB] = 556; - width[0x00BB] = 556; - width[0x008B] = 333; - width[0x009B] = 333; - width[0x0068] = 556; - width[0x002D] = 333; - width[0x0069] = 222; - width[0x00ED] = 278; - width[0x00EE] = 278; - width[0x00EF] = 278; - width[0x00EC] = 278; - width[0x006A] = 222; - width[0x006B] = 500; - width[0x006C] = 222; - width[0x003C] = 584; - width[0x00AC] = 584; - width[0x006D] = 833; - width[0x00AF] = 333; - width[0x2D] = 324; - width[0x00B5] = 556; - width[0x00D7] = 584; - width[0x006E] = 556; - width[0x0039] = 556; - width[0x00F1] = 556; - width[0x0023] = 556; - width[0x006F] = 556; - width[0x00F3] = 556; - width[0x00F4] = 556; - width[0x00F6] = 556; - width[0x009C] = 944; - width[0x00F2] = 556; - width[0x0031] = 556; - width[0x00BD] = 834; - width[0x00BC] = 834; - width[0x00B9] = 333; - width[0x00AA] = 370; - width[0x00BA] = 365; - width[0x00F8] = 611; - width[0x00F5] = 556; - width[0x0070] = 556; - width[0x00B6] = 537; - width[0x0028] = 333; - width[0x0029] = 333; - width[0x0025] = 889; - width[0x002E] = 278; - width[0x00B7] = 278; - width[0x0089] = 1000; - width[0x002B] = 584; - width[0x00B1] = 584; - width[0x0071] = 556; - width[0x003F] = 556; - width[0x00BF] = 611; - width[0x0022] = 355; - width[0x0084] = 333; - width[0x0093] = 333; - width[0x0094] = 333; - width[0x0091] = 222; - width[0x0092] = 222; - width[0x0082] = 222; - width[0x0027] = 191; - width[0x0072] = 333; - width[0x00AE] = 737; - width[0x00B0] = 333; - width[0x0073] = 500; - width[0x009A] = 500; - width[0x00A7] = 556; - width[0x003B] = 278; - width[0x0037] = 556; - width[0x0036] = 556; - width[0x002F] = 278; - width[0x0020] = 278; - width[0x00A0] = 278; - width[0x00A3] = 556; - width[0x0074] = 278; - width[0x00FE] = 556; - width[0x0033] = 556; - width[0x00BE] = 834; - width[0x00B3] = 333; - width[0x0098] = 333; - width[0x0099] = 1000; - width[0x0032] = 556; - width[0x00B2] = 333; - width[0x0075] = 556; - width[0x00FA] = 556; - width[0x00FB] = 556; - width[0x00FC] = 556; - width[0x00F9] = 556; - width[0x005F] = 556; - width[0x0076] = 500; - width[0x0077] = 722; - width[0x0078] = 500; - width[0x0079] = 500; - width[0x00FD] = 500; - width[0x00FF] = 500; - width[0x00A5] = 556; - width[0x007A] = 500; - width[0x0030] = 556; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/HelveticaBold.java b/src/org/apache/fop/render/mif/fonts/HelveticaBold.java deleted file mode 100644 index fd66a1fc6..000000000 --- a/src/org/apache/fop/render/mif/fonts/HelveticaBold.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class HelveticaBold extends Font { - private final static String fontName = "Helvetica-Bold"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 718; - private final static int xHeight = 532; - private final static int ascender = 718; - private final static int descender = -207; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 722; - width[0x00C6] = 1000; - width[0x00C1] = 722; - width[0x00C2] = 722; - width[0x00C4] = 722; - width[0x00C0] = 722; - width[0x00C5] = 722; - width[0x00C3] = 722; - width[0x0042] = 722; - width[0x0043] = 722; - width[0x00C7] = 722; - width[0x0044] = 722; - width[0x0045] = 667; - width[0x00C9] = 667; - width[0x00CA] = 667; - width[0x00CB] = 667; - width[0x00C8] = 667; - width[0x00D0] = 722; - width[0x0046] = 611; - width[0x0047] = 778; - width[0x0048] = 722; - width[0x0049] = 278; - width[0x00CD] = 278; - width[0x00CE] = 278; - width[0x00CF] = 278; - width[0x00CC] = 278; - width[0x004A] = 556; - width[0x004B] = 722; - width[0x004C] = 611; - width[0x004D] = 833; - width[0x004E] = 722; - width[0x00D1] = 722; - width[0x004F] = 778; - width[0x008C] = 1000; - width[0x00D3] = 778; - width[0x00D4] = 778; - width[0x00D6] = 778; - width[0x00D2] = 778; - width[0x00D8] = 778; - width[0x00D5] = 778; - width[0x0050] = 667; - width[0x0051] = 778; - width[0x0052] = 722; - width[0x0053] = 667; - width[0x008A] = 667; - width[0x0054] = 611; - width[0x00DE] = 667; - width[0x0055] = 722; - width[0x00DA] = 722; - width[0x00DB] = 722; - width[0x00DC] = 722; - width[0x00D9] = 722; - width[0x0056] = 667; - width[0x0057] = 944; - width[0x0058] = 667; - width[0x0059] = 667; - width[0x00DD] = 667; - width[0x009F] = 667; - width[0x005A] = 611; - width[0x0061] = 556; - width[0x00E1] = 556; - width[0x00E2] = 556; - width[0x00B4] = 333; - width[0x00E4] = 556; - width[0x00E6] = 889; - width[0x00E0] = 556; - width[0x0026] = 722; - width[0x00E5] = 556; - width[0x005E] = 584; - width[0x007E] = 584; - width[0x002A] = 389; - width[0x0040] = 975; - width[0x00E3] = 556; - width[0x0062] = 611; - width[0x005C] = 278; - width[0x007C] = 280; - width[0x007B] = 389; - width[0x007D] = 389; - width[0x005B] = 333; - width[0x005D] = 333; - width[0x00A6] = 280; - width[0x0095] = 350; - width[0x0063] = 556; - width[0x00E7] = 556; - width[0x00B8] = 333; - width[0x00A2] = 556; - width[0x0088] = 333; - width[0x003A] = 333; - width[0x002C] = 278; - width[0x00A9] = 737; - width[0x00A4] = 556; - width[0x0064] = 611; - width[0x0086] = 556; - width[0x0087] = 556; - width[0x00B0] = 400; - width[0x00A8] = 333; - width[0x00F7] = 584; - width[0x0024] = 556; - width[0x0065] = 556; - width[0x00E9] = 556; - width[0x00EA] = 556; - width[0x00EB] = 556; - width[0x00E8] = 556; - width[0x0038] = 556; - width[0x0085] = 1000; - width[0x0097] = 1000; - width[0x0096] = 556; - width[0x003D] = 584; - width[0x00F0] = 611; - width[0x0021] = 333; - width[0x00A1] = 333; - width[0x0066] = 333; - width[0x0035] = 556; - width[0x0083] = 556; - width[0x0034] = 556; - width[0xA4] = 167; - width[0x0067] = 611; - width[0x00DF] = 611; - width[0x0060] = 333; - width[0x003E] = 584; - width[0x00AB] = 556; - width[0x00BB] = 556; - width[0x008B] = 333; - width[0x009B] = 333; - width[0x0068] = 611; - width[0x002D] = 333; - width[0x0069] = 278; - width[0x00ED] = 278; - width[0x00EE] = 278; - width[0x00EF] = 278; - width[0x00EC] = 278; - width[0x006A] = 278; - width[0x006B] = 556; - width[0x006C] = 278; - width[0x003C] = 584; - width[0x00AC] = 584; - width[0x006D] = 889; - width[0x00AF] = 333; - width[0x2D] = 584; - width[0x00B5] = 611; - width[0x00D7] = 584; - width[0x006E] = 611; - width[0x0039] = 556; - width[0x00F1] = 611; - width[0x0023] = 556; - width[0x006F] = 611; - width[0x00F3] = 611; - width[0x00F4] = 611; - width[0x00F6] = 611; - width[0x009C] = 944; - width[0x00F2] = 611; - width[0x0031] = 556; - width[0x00BD] = 834; - width[0x00BC] = 834; - width[0x00B9] = 333; - width[0x00AA] = 370; - width[0x00BA] = 365; - width[0x00F8] = 611; - width[0x00F5] = 611; - width[0x0070] = 611; - width[0x00B6] = 556; - width[0x0028] = 333; - width[0x0029] = 333; - width[0x0025] = 889; - width[0x002E] = 278; - width[0x00B7] = 278; - width[0x0089] = 1000; - width[0x002B] = 584; - width[0x00B1] = 584; - width[0x0071] = 611; - width[0x003F] = 611; - width[0x00BF] = 611; - width[0x0022] = 474; - width[0x0084] = 500; - width[0x0093] = 500; - width[0x0094] = 500; - width[0x0091] = 278; - width[0x0092] = 278; - width[0x0082] = 278; - width[0x0027] = 238; - width[0x0072] = 389; - width[0x00AE] = 737; - width[0x00B0] = 333; - width[0x0073] = 556; - width[0x009A] = 556; - width[0x00A7] = 556; - width[0x003B] = 333; - width[0x0037] = 556; - width[0x0036] = 556; - width[0x002F] = 278; - width[0x0020] = 278; - width[0x00A0] = 278; - width[0x00A3] = 556; - width[0x0074] = 333; - width[0x00FE] = 611; - width[0x0033] = 556; - width[0x00BE] = 834; - width[0x00B3] = 333; - width[0x0098] = 333; - width[0x0099] = 1000; - width[0x0032] = 556; - width[0x00B2] = 333; - width[0x0075] = 611; - width[0x00FA] = 611; - width[0x00FB] = 611; - width[0x00FC] = 611; - width[0x00F9] = 611; - width[0x005F] = 556; - width[0x0076] = 556; - width[0x0077] = 778; - width[0x0078] = 556; - width[0x0079] = 556; - width[0x00FD] = 556; - width[0x00FF] = 556; - width[0x00A5] = 556; - width[0x007A] = 500; - width[0x0030] = 556; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/HelveticaBoldOblique.java b/src/org/apache/fop/render/mif/fonts/HelveticaBoldOblique.java deleted file mode 100644 index dd21f6677..000000000 --- a/src/org/apache/fop/render/mif/fonts/HelveticaBoldOblique.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class HelveticaBoldOblique extends Font { - private final static String fontName = "Helvetica-BoldOblique"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 718; - private final static int xHeight = 532; - private final static int ascender = 718; - private final static int descender = -207; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 722; - width[0x00C6] = 1000; - width[0x00C1] = 722; - width[0x00C2] = 722; - width[0x00C4] = 722; - width[0x00C0] = 722; - width[0x00C5] = 722; - width[0x00C3] = 722; - width[0x0042] = 722; - width[0x0043] = 722; - width[0x00C7] = 722; - width[0x0044] = 722; - width[0x0045] = 667; - width[0x00C9] = 667; - width[0x00CA] = 667; - width[0x00CB] = 667; - width[0x00C8] = 667; - width[0x00D0] = 722; - width[0x0046] = 611; - width[0x0047] = 778; - width[0x0048] = 722; - width[0x0049] = 278; - width[0x00CD] = 278; - width[0x00CE] = 278; - width[0x00CF] = 278; - width[0x00CC] = 278; - width[0x004A] = 556; - width[0x004B] = 722; - width[0x004C] = 611; - width[0x004D] = 833; - width[0x004E] = 722; - width[0x00D1] = 722; - width[0x004F] = 778; - width[0x008C] = 1000; - width[0x00D3] = 778; - width[0x00D4] = 778; - width[0x00D6] = 778; - width[0x00D2] = 778; - width[0x00D8] = 778; - width[0x00D5] = 778; - width[0x0050] = 667; - width[0x0051] = 778; - width[0x0052] = 722; - width[0x0053] = 667; - width[0x008A] = 667; - width[0x0054] = 611; - width[0x00DE] = 667; - width[0x0055] = 722; - width[0x00DA] = 722; - width[0x00DB] = 722; - width[0x00DC] = 722; - width[0x00D9] = 722; - width[0x0056] = 667; - width[0x0057] = 944; - width[0x0058] = 667; - width[0x0059] = 667; - width[0x00DD] = 667; - width[0x009F] = 667; - width[0x005A] = 611; - width[0x0061] = 556; - width[0x00E1] = 556; - width[0x00E2] = 556; - width[0x00B4] = 333; - width[0x00E4] = 556; - width[0x00E6] = 889; - width[0x00E0] = 556; - width[0x0026] = 722; - width[0x00E5] = 556; - width[0x005E] = 584; - width[0x007E] = 584; - width[0x002A] = 389; - width[0x0040] = 975; - width[0x00E3] = 556; - width[0x0062] = 611; - width[0x005C] = 278; - width[0x007C] = 280; - width[0x007B] = 389; - width[0x007D] = 389; - width[0x005B] = 333; - width[0x005D] = 333; - width[0x00A6] = 280; - width[0x0095] = 350; - width[0x0063] = 556; - width[0x00E7] = 556; - width[0x00B8] = 333; - width[0x00A2] = 556; - width[0x0088] = 333; - width[0x003A] = 333; - width[0x002C] = 278; - width[0x00A9] = 737; - width[0x00A4] = 556; - width[0x0064] = 611; - width[0x0086] = 556; - width[0x0087] = 556; - width[0x00B0] = 400; - width[0x00A8] = 333; - width[0x00F7] = 584; - width[0x0024] = 556; - width[0x0065] = 556; - width[0x00E9] = 556; - width[0x00EA] = 556; - width[0x00EB] = 556; - width[0x00E8] = 556; - width[0x0038] = 556; - width[0x0085] = 1000; - width[0x0097] = 1000; - width[0x0096] = 556; - width[0x003D] = 584; - width[0x00F0] = 611; - width[0x0021] = 333; - width[0x00A1] = 333; - width[0x0066] = 333; - width[0x0035] = 556; - width[0x0083] = 556; - width[0x0034] = 556; - width[0xA4] = 167; - width[0x0067] = 611; - width[0x00DF] = 611; - width[0x0060] = 333; - width[0x003E] = 584; - width[0x00AB] = 556; - width[0x00BB] = 556; - width[0x008B] = 333; - width[0x009B] = 333; - width[0x0068] = 611; - width[0x002D] = 333; - width[0x0069] = 278; - width[0x00ED] = 278; - width[0x00EE] = 278; - width[0x00EF] = 278; - width[0x00EC] = 278; - width[0x006A] = 278; - width[0x006B] = 556; - width[0x006C] = 278; - width[0x003C] = 584; - width[0x00AC] = 584; - width[0x006D] = 889; - width[0x00AF] = 333; - width[0x2D] = 584; - width[0x00B5] = 611; - width[0x00D7] = 584; - width[0x006E] = 611; - width[0x0039] = 556; - width[0x00F1] = 611; - width[0x0023] = 556; - width[0x006F] = 611; - width[0x00F3] = 611; - width[0x00F4] = 611; - width[0x00F6] = 611; - width[0x009C] = 944; - width[0x00F2] = 611; - width[0x0031] = 556; - width[0x00BD] = 834; - width[0x00BC] = 834; - width[0x00B9] = 333; - width[0x00AA] = 370; - width[0x00BA] = 365; - width[0x00F8] = 611; - width[0x00F5] = 611; - width[0x0070] = 611; - width[0x00B6] = 556; - width[0x0028] = 333; - width[0x0029] = 333; - width[0x0025] = 889; - width[0x002E] = 278; - width[0x00B7] = 278; - width[0x0089] = 1000; - width[0x002B] = 584; - width[0x00B1] = 584; - width[0x0071] = 611; - width[0x003F] = 611; - width[0x00BF] = 611; - width[0x0022] = 474; - width[0x0084] = 500; - width[0x0093] = 500; - width[0x0094] = 500; - width[0x0091] = 278; - width[0x0092] = 278; - width[0x0082] = 278; - width[0x0027] = 238; - width[0x0072] = 389; - width[0x00AE] = 737; - width[0x00B0] = 333; - width[0x0073] = 556; - width[0x009A] = 556; - width[0x00A7] = 556; - width[0x003B] = 333; - width[0x0037] = 556; - width[0x0036] = 556; - width[0x002F] = 278; - width[0x0020] = 278; - width[0x00A0] = 278; - width[0x00A3] = 556; - width[0x0074] = 333; - width[0x00FE] = 611; - width[0x0033] = 556; - width[0x00BE] = 834; - width[0x00B3] = 333; - width[0x0098] = 333; - width[0x0099] = 1000; - width[0x0032] = 556; - width[0x00B2] = 333; - width[0x0075] = 611; - width[0x00FA] = 611; - width[0x00FB] = 611; - width[0x00FC] = 611; - width[0x00F9] = 611; - width[0x005F] = 556; - width[0x0076] = 556; - width[0x0077] = 778; - width[0x0078] = 556; - width[0x0079] = 556; - width[0x00FD] = 556; - width[0x00FF] = 556; - width[0x00A5] = 556; - width[0x007A] = 500; - width[0x0030] = 556; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/HelveticaOblique.java b/src/org/apache/fop/render/mif/fonts/HelveticaOblique.java deleted file mode 100644 index 81aae1bc6..000000000 --- a/src/org/apache/fop/render/mif/fonts/HelveticaOblique.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class HelveticaOblique extends Font { - private final static String fontName = "Helvetica-Oblique"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 718; - private final static int xHeight = 523; - private final static int ascender = 718; - private final static int descender = -207; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 667; - width[0x00C6] = 1000; - width[0x00C1] = 667; - width[0x00C2] = 667; - width[0x00C4] = 667; - width[0x00C0] = 667; - width[0x00C5] = 667; - width[0x00C3] = 667; - width[0x0042] = 667; - width[0x0043] = 722; - width[0x00C7] = 722; - width[0x0044] = 722; - width[0x0045] = 667; - width[0x00C9] = 667; - width[0x00CA] = 667; - width[0x00CB] = 667; - width[0x00C8] = 667; - width[0x00D0] = 722; - width[0x0046] = 611; - width[0x0047] = 778; - width[0x0048] = 722; - width[0x0049] = 278; - width[0x00CD] = 278; - width[0x00CE] = 278; - width[0x00CF] = 278; - width[0x00CC] = 278; - width[0x004A] = 500; - width[0x004B] = 667; - width[0x004C] = 556; - width[0x004D] = 833; - width[0x004E] = 722; - width[0x00D1] = 722; - width[0x004F] = 778; - width[0x008C] = 1000; - width[0x00D3] = 778; - width[0x00D4] = 778; - width[0x00D6] = 778; - width[0x00D2] = 778; - width[0x00D8] = 778; - width[0x00D5] = 778; - width[0x0050] = 667; - width[0x0051] = 778; - width[0x0052] = 722; - width[0x0053] = 667; - width[0x008A] = 667; - width[0x0054] = 611; - width[0x00DE] = 667; - width[0x0055] = 722; - width[0x00DA] = 722; - width[0x00DB] = 722; - width[0x00DC] = 722; - width[0x00D9] = 722; - width[0x0056] = 667; - width[0x0057] = 944; - width[0x0058] = 667; - width[0x0059] = 667; - width[0x00DD] = 667; - width[0x009F] = 667; - width[0x005A] = 611; - width[0x0061] = 556; - width[0x00E1] = 556; - width[0x00E2] = 556; - width[0x00B4] = 333; - width[0x00E4] = 556; - width[0x00E6] = 889; - width[0x00E0] = 556; - width[0x0026] = 667; - width[0x00E5] = 556; - width[0x005E] = 469; - width[0x007E] = 584; - width[0x002A] = 389; - width[0x0040] = 1015; - width[0x00E3] = 556; - width[0x0062] = 556; - width[0x005C] = 278; - width[0x007C] = 260; - width[0x007B] = 334; - width[0x007D] = 334; - width[0x005B] = 278; - width[0x005D] = 278; - width[0x00A6] = 260; - width[0x0095] = 350; - width[0x0063] = 500; - width[0x00E7] = 500; - width[0x00B8] = 333; - width[0x00A2] = 556; - width[0x0088] = 333; - width[0x003A] = 278; - width[0x002C] = 278; - width[0x00A9] = 737; - width[0x00A4] = 556; - width[0x0064] = 556; - width[0x0086] = 556; - width[0x0087] = 556; - width[0x00B0] = 400; - width[0x00A8] = 333; - width[0x00F7] = 584; - width[0x0024] = 556; - width[0x0065] = 556; - width[0x00E9] = 556; - width[0x00EA] = 556; - width[0x00EB] = 556; - width[0x00E8] = 556; - width[0x0038] = 556; - width[0x0085] = 1000; - width[0x0097] = 1000; - width[0x0096] = 556; - width[0x003D] = 584; - width[0x00F0] = 556; - width[0x0021] = 278; - width[0x00A1] = 333; - width[0x0066] = 278; - width[0x0035] = 556; - width[0x0083] = 556; - width[0x0034] = 556; - width[0xA4] = 167; - width[0x0067] = 556; - width[0x00DF] = 611; - width[0x0060] = 333; - width[0x003E] = 584; - width[0x00AB] = 556; - width[0x00BB] = 556; - width[0x008B] = 333; - width[0x009B] = 333; - width[0x0068] = 556; - width[0x002D] = 333; - width[0x0069] = 222; - width[0x00ED] = 278; - width[0x00EE] = 278; - width[0x00EF] = 278; - width[0x00EC] = 278; - width[0x006A] = 222; - width[0x006B] = 500; - width[0x006C] = 222; - width[0x003C] = 584; - width[0x00AC] = 584; - width[0x006D] = 833; - width[0x00AF] = 333; - width[0x2D] = 584; - width[0x00B5] = 556; - width[0x00D7] = 584; - width[0x006E] = 556; - width[0x0039] = 556; - width[0x00F1] = 556; - width[0x0023] = 556; - width[0x006F] = 556; - width[0x00F3] = 556; - width[0x00F4] = 556; - width[0x00F6] = 556; - width[0x009C] = 944; - width[0x00F2] = 556; - width[0x0031] = 556; - width[0x00BD] = 834; - width[0x00BC] = 834; - width[0x00B9] = 333; - width[0x00AA] = 370; - width[0x00BA] = 365; - width[0x00F8] = 611; - width[0x00F5] = 556; - width[0x0070] = 556; - width[0x00B6] = 537; - width[0x0028] = 333; - width[0x0029] = 333; - width[0x0025] = 889; - width[0x002E] = 278; - width[0x00B7] = 278; - width[0x0089] = 1000; - width[0x002B] = 584; - width[0x00B1] = 584; - width[0x0071] = 556; - width[0x003F] = 556; - width[0x00BF] = 611; - width[0x0022] = 355; - width[0x0084] = 333; - width[0x0093] = 333; - width[0x0094] = 333; - width[0x0091] = 222; - width[0x0092] = 222; - width[0x0082] = 222; - width[0x0027] = 191; - width[0x0072] = 333; - width[0x00AE] = 737; - width[0x00B0] = 333; - width[0x0073] = 500; - width[0x009A] = 500; - width[0x00A7] = 556; - width[0x003B] = 278; - width[0x0037] = 556; - width[0x0036] = 556; - width[0x002F] = 278; - width[0x0020] = 278; - width[0x00A0] = 278; - width[0x00A3] = 556; - width[0x0074] = 278; - width[0x00FE] = 556; - width[0x0033] = 556; - width[0x00BE] = 834; - width[0x00B3] = 333; - width[0x0098] = 333; - width[0x0099] = 1000; - width[0x0032] = 556; - width[0x00B2] = 333; - width[0x0075] = 556; - width[0x00FA] = 556; - width[0x00FB] = 556; - width[0x00FC] = 556; - width[0x00F9] = 556; - width[0x005F] = 556; - width[0x0076] = 500; - width[0x0077] = 722; - width[0x0078] = 500; - width[0x0079] = 500; - width[0x00FD] = 500; - width[0x00FF] = 500; - width[0x00A5] = 556; - width[0x007A] = 500; - width[0x0030] = 556; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/Symbol.java b/src/org/apache/fop/render/mif/fonts/Symbol.java deleted file mode 100644 index 3ccfcb0a3..000000000 --- a/src/org/apache/fop/render/mif/fonts/Symbol.java +++ /dev/null @@ -1,263 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class Symbol extends Font { - private final static String fontName = "Symbol"; - private final static String encoding = "StandardEncoding"; - private final static int capHeight = 1010; - private final static int xHeight = 520; - private final static int ascender = 1010; - private final static int descender = -293; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0020] = 250; - width[0x0021] = 333; - width[0x22] = 713; - width[0x0023] = 500; - width[0x24] = 549; - width[0x0025] = 833; - width[0x0026] = 778; - width[0x27] = 439; - width[0x0028] = 333; - width[0x0029] = 333; - width[0x2A] = 500; - width[0x002B] = 549; - width[0x002C] = 250; - width[0x2D] = 549; - width[0x002E] = 250; - width[0x002F] = 278; - width[0x0030] = 500; - width[0x0031] = 500; - width[0x0032] = 500; - width[0x0033] = 500; - width[0x0034] = 500; - width[0x0035] = 500; - width[0x0036] = 500; - width[0x0037] = 500; - width[0x0038] = 500; - width[0x0039] = 500; - width[0x003A] = 278; - width[0x003B] = 278; - width[0x003C] = 549; - width[0x003D] = 549; - width[0x003E] = 549; - width[0x003F] = 444; - width[0x40] = 549; - width[0x41] = 722; - width[0x42] = 667; - width[0x43] = 722; - width[0x44] = 612; - width[0x45] = 611; - width[0x46] = 763; - width[0x47] = 603; - width[0x48] = 722; - width[0x49] = 333; - width[0x4A] = 631; - width[0x4B] = 722; - width[0x4C] = 686; - width[0x4D] = 889; - width[0x4E] = 722; - width[0x4F] = 722; - width[0x50] = 768; - width[0x51] = 741; - width[0x52] = 556; - width[0x53] = 592; - width[0x54] = 611; - width[0x55] = 690; - width[0x56] = 439; - width[0x57] = 768; - width[0x58] = 645; - width[0x59] = 795; - width[0x5A] = 611; - width[0x005B] = 333; - width[0x5C] = 863; - width[0x005D] = 333; - width[0x5E] = 658; - width[0x005F] = 500; - width[0x60] = 500; - width[0x61] = 631; - width[0x62] = 549; - width[0x63] = 549; - width[0x64] = 494; - width[0x65] = 439; - width[0x66] = 521; - width[0x67] = 411; - width[0x68] = 603; - width[0x69] = 329; - width[0x6A] = 603; - width[0x6B] = 549; - width[0x6C] = 549; - width[0x006D] = 576; - width[0x00B5] = 576; - width[0x6E] = 521; - width[0x6F] = 549; - width[0x70] = 549; - width[0x71] = 521; - width[0x72] = 549; - width[0x73] = 603; - width[0x74] = 439; - width[0x75] = 576; - width[0x76] = 713; - width[0x77] = 686; - width[0x78] = 493; - width[0x79] = 686; - width[0x7A] = 494; - width[0x007B] = 480; - width[0x007C] = 200; - width[0x007D] = 480; - width[0x7E] = 549; - width[0xA1] = 620; - width[0xA2] = 247; - width[0xA3] = 549; - width[0xA4] = 167; - width[0xA5] = 713; - width[0x0083] = 500; - width[0xA7] = 753; - width[0xA8] = 753; - width[0xA9] = 753; - width[0xAA] = 753; - width[0xAB] = 1042; - width[0xAC] = 987; - width[0xAD] = 603; - width[0xAE] = 987; - width[0xAF] = 603; - width[0x00B0] = 400; - width[0x00B1] = 549; - width[0xB2] = 411; - width[0xB3] = 549; - width[0x00D7] = 549; - width[0xB5] = 713; - width[0xB6] = 494; - width[0x0095] = 460; - width[0x00F7] = 549; - width[0xB9] = 549; - width[0xBA] = 549; - width[0xBB] = 549; - width[0x0085] = 1000; - width[0xBD] = 603; - width[0xBE] = 1000; - width[0xBF] = 658; - width[0xC0] = 823; - width[0xC1] = 686; - width[0xC2] = 795; - width[0xC3] = 987; - width[0xC4] = 768; - width[0xC5] = 768; - width[0xC6] = 823; - width[0xC7] = 768; - width[0xC8] = 768; - width[0xC9] = 713; - width[0xCA] = 713; - width[0xCB] = 713; - width[0xCC] = 713; - width[0xCD] = 713; - width[0xCE] = 713; - width[0xCF] = 713; - width[0xD0] = 768; - width[0xD1] = 713; - width[0xD2] = 790; - width[0xD3] = 790; - width[0xD4] = 890; - width[0xD5] = 823; - width[0xD6] = 549; - width[0xD7] = 250; - width[0x00AC] = 713; - width[0xD9] = 603; - width[0xDA] = 603; - width[0xDB] = 1042; - width[0xDC] = 987; - width[0xDD] = 603; - width[0xDE] = 987; - width[0xDF] = 603; - width[0xE0] = 494; - width[0xE1] = 329; - width[0xE2] = 790; - width[0xE3] = 790; - width[0xE4] = 786; - width[0xE5] = 713; - width[0xE6] = 384; - width[0xE7] = 384; - width[0xE8] = 384; - width[0xE9] = 384; - width[0xEA] = 384; - width[0xEB] = 384; - width[0xEC] = 494; - width[0xED] = 494; - width[0xEE] = 494; - width[0xEF] = 494; - width[0xF1] = 329; - width[0xF2] = 274; - width[0xF3] = 686; - width[0xF4] = 686; - width[0xF5] = 686; - width[0xF6] = 384; - width[0xF7] = 384; - width[0xF8] = 384; - width[0xF9] = 384; - width[0xFA] = 384; - width[0xFB] = 384; - width[0xFC] = 494; - width[0xFD] = 494; - width[0xFE] = 494; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/TimesBold.java b/src/org/apache/fop/render/mif/fonts/TimesBold.java deleted file mode 100644 index 8a3eab830..000000000 --- a/src/org/apache/fop/render/mif/fonts/TimesBold.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class TimesBold extends Font { - private final static String fontName = "Times-Bold"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 676; - private final static int xHeight = 461; - private final static int ascender = 676; - private final static int descender = -205; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 722; - width[0x00C6] = 1000; - width[0x00C1] = 722; - width[0x00C2] = 722; - width[0x00C4] = 722; - width[0x00C0] = 722; - width[0x00C5] = 722; - width[0x00C3] = 722; - width[0x0042] = 667; - width[0x0043] = 722; - width[0x00C7] = 722; - width[0x0044] = 722; - width[0x0045] = 667; - width[0x00C9] = 667; - width[0x00CA] = 667; - width[0x00CB] = 667; - width[0x00C8] = 667; - width[0x00D0] = 722; - width[0x0046] = 611; - width[0x0047] = 778; - width[0x0048] = 778; - width[0x0049] = 389; - width[0x00CD] = 389; - width[0x00CE] = 389; - width[0x00CF] = 389; - width[0x00CC] = 389; - width[0x004A] = 500; - width[0x004B] = 778; - width[0x004C] = 667; - width[0x004D] = 944; - width[0x004E] = 722; - width[0x00D1] = 722; - width[0x004F] = 778; - width[0x008C] = 1000; - width[0x00D3] = 778; - width[0x00D4] = 778; - width[0x00D6] = 778; - width[0x00D2] = 778; - width[0x00D8] = 778; - width[0x00D5] = 778; - width[0x0050] = 611; - width[0x0051] = 778; - width[0x0052] = 722; - width[0x0053] = 556; - width[0x008A] = 556; - width[0x0054] = 667; - width[0x00DE] = 611; - width[0x0055] = 722; - width[0x00DA] = 722; - width[0x00DB] = 722; - width[0x00DC] = 722; - width[0x00D9] = 722; - width[0x0056] = 722; - width[0x0057] = 1000; - width[0x0058] = 722; - width[0x0059] = 722; - width[0x00DD] = 722; - width[0x009F] = 722; - width[0x005A] = 667; - width[0x0061] = 500; - width[0x00E1] = 500; - width[0x00E2] = 500; - width[0x00B4] = 333; - width[0x00E4] = 500; - width[0x00E6] = 722; - width[0x00E0] = 500; - width[0x0026] = 833; - width[0x00E5] = 500; - width[0x005E] = 581; - width[0x007E] = 520; - width[0x002A] = 500; - width[0x0040] = 930; - width[0x00E3] = 500; - width[0x0062] = 556; - width[0x005C] = 278; - width[0x007C] = 220; - width[0x007B] = 394; - width[0x007D] = 394; - width[0x005B] = 333; - width[0x005D] = 333; - width[0x00A6] = 220; - width[0x0095] = 350; - width[0x0063] = 444; - width[0x00E7] = 444; - width[0x00B8] = 333; - width[0x00A2] = 500; - width[0x0088] = 333; - width[0x003A] = 333; - width[0x002C] = 250; - width[0x00A9] = 747; - width[0x00A4] = 500; - width[0x0064] = 556; - width[0x0086] = 500; - width[0x0087] = 500; - width[0x00B0] = 400; - width[0x00A8] = 333; - width[0x00F7] = 570; - width[0x0024] = 500; - width[0x0065] = 444; - width[0x00E9] = 444; - width[0x00EA] = 444; - width[0x00EB] = 444; - width[0x00E8] = 444; - width[0x0038] = 500; - width[0x0085] = 1000; - width[0x0097] = 1000; - width[0x0096] = 500; - width[0x003D] = 570; - width[0x00F0] = 500; - width[0x0021] = 333; - width[0x00A1] = 333; - width[0x0066] = 333; - width[0x0035] = 500; - width[0x0083] = 500; - width[0x0034] = 500; - width[0xA4] = 167; - width[0x0067] = 500; - width[0x00DF] = 556; - width[0x0060] = 333; - width[0x003E] = 570; - width[0x00AB] = 500; - width[0x00BB] = 500; - width[0x008B] = 333; - width[0x009B] = 333; - width[0x0068] = 556; - width[0x002D] = 333; - width[0x0069] = 278; - width[0x00ED] = 278; - width[0x00EE] = 278; - width[0x00EF] = 278; - width[0x00EC] = 278; - width[0x006A] = 333; - width[0x006B] = 556; - width[0x006C] = 278; - width[0x003C] = 570; - width[0x00AC] = 570; - width[0x006D] = 833; - width[0x00AF] = 333; - width[0x2D] = 570; - width[0x00B5] = 556; - width[0x00D7] = 570; - width[0x006E] = 556; - width[0x0039] = 500; - width[0x00F1] = 556; - width[0x0023] = 500; - width[0x006F] = 500; - width[0x00F3] = 500; - width[0x00F4] = 500; - width[0x00F6] = 500; - width[0x009C] = 722; - width[0x00F2] = 500; - width[0x0031] = 500; - width[0x00BD] = 750; - width[0x00BC] = 750; - width[0x00B9] = 300; - width[0x00AA] = 300; - width[0x00BA] = 330; - width[0x00F8] = 500; - width[0x00F5] = 500; - width[0x0070] = 556; - width[0x00B6] = 540; - width[0x0028] = 333; - width[0x0029] = 333; - width[0x0025] = 1000; - width[0x002E] = 250; - width[0x00B7] = 250; - width[0x0089] = 1000; - width[0x002B] = 570; - width[0x00B1] = 570; - width[0x0071] = 556; - width[0x003F] = 500; - width[0x00BF] = 500; - width[0x0022] = 555; - width[0x0084] = 500; - width[0x0093] = 500; - width[0x0094] = 500; - width[0x0091] = 333; - width[0x0092] = 333; - width[0x0082] = 333; - width[0x0027] = 278; - width[0x0072] = 444; - width[0x00AE] = 747; - width[0x00B0] = 333; - width[0x0073] = 389; - width[0x009A] = 389; - width[0x00A7] = 500; - width[0x003B] = 333; - width[0x0037] = 500; - width[0x0036] = 500; - width[0x002F] = 278; - width[0x0020] = 250; - width[0x00A0] = 250; - width[0x00A3] = 500; - width[0x0074] = 333; - width[0x00FE] = 556; - width[0x0033] = 500; - width[0x00BE] = 750; - width[0x00B3] = 300; - width[0x0098] = 333; - width[0x0099] = 1000; - width[0x0032] = 500; - width[0x00B2] = 300; - width[0x0075] = 556; - width[0x00FA] = 556; - width[0x00FB] = 556; - width[0x00FC] = 556; - width[0x00F9] = 556; - width[0x005F] = 500; - width[0x0076] = 500; - width[0x0077] = 722; - width[0x0078] = 500; - width[0x0079] = 500; - width[0x00FD] = 500; - width[0x00FF] = 500; - width[0x00A5] = 500; - width[0x007A] = 444; - width[0x0030] = 500; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/TimesBoldItalic.java b/src/org/apache/fop/render/mif/fonts/TimesBoldItalic.java deleted file mode 100644 index 938979887..000000000 --- a/src/org/apache/fop/render/mif/fonts/TimesBoldItalic.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class TimesBoldItalic extends Font { - private final static String fontName = "Times-BoldItalic"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 669; - private final static int xHeight = 462; - private final static int ascender = 699; - private final static int descender = -205; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 667; - width[0x00C6] = 944; - width[0x00C1] = 667; - width[0x00C2] = 667; - width[0x00C4] = 667; - width[0x00C0] = 667; - width[0x00C5] = 667; - width[0x00C3] = 667; - width[0x0042] = 667; - width[0x0043] = 667; - width[0x00C7] = 667; - width[0x0044] = 722; - width[0x0045] = 667; - width[0x00C9] = 667; - width[0x00CA] = 667; - width[0x00CB] = 667; - width[0x00C8] = 667; - width[0x00D0] = 722; - width[0x0046] = 667; - width[0x0047] = 722; - width[0x0048] = 778; - width[0x0049] = 389; - width[0x00CD] = 389; - width[0x00CE] = 389; - width[0x00CF] = 389; - width[0x00CC] = 389; - width[0x004A] = 500; - width[0x004B] = 667; - width[0x004C] = 611; - width[0x004D] = 889; - width[0x004E] = 722; - width[0x00D1] = 722; - width[0x004F] = 722; - width[0x008C] = 944; - width[0x00D3] = 722; - width[0x00D4] = 722; - width[0x00D6] = 722; - width[0x00D2] = 722; - width[0x00D8] = 722; - width[0x00D5] = 722; - width[0x0050] = 611; - width[0x0051] = 722; - width[0x0052] = 667; - width[0x0053] = 556; - width[0x008A] = 556; - width[0x0054] = 611; - width[0x00DE] = 611; - width[0x0055] = 722; - width[0x00DA] = 722; - width[0x00DB] = 722; - width[0x00DC] = 722; - width[0x00D9] = 722; - width[0x0056] = 667; - width[0x0057] = 889; - width[0x0058] = 667; - width[0x0059] = 611; - width[0x00DD] = 611; - width[0x009F] = 611; - width[0x005A] = 611; - width[0x0061] = 500; - width[0x00E1] = 500; - width[0x00E2] = 500; - width[0x00B4] = 333; - width[0x00E4] = 500; - width[0x00E6] = 722; - width[0x00E0] = 500; - width[0x0026] = 778; - width[0x00E5] = 500; - width[0x005E] = 570; - width[0x007E] = 570; - width[0x002A] = 500; - width[0x0040] = 832; - width[0x00E3] = 500; - width[0x0062] = 500; - width[0x005C] = 278; - width[0x007C] = 220; - width[0x007B] = 348; - width[0x007D] = 348; - width[0x005B] = 333; - width[0x005D] = 333; - width[0x00A6] = 220; - width[0x0095] = 350; - width[0x0063] = 444; - width[0x00E7] = 444; - width[0x00B8] = 333; - width[0x00A2] = 500; - width[0x0088] = 333; - width[0x003A] = 333; - width[0x002C] = 250; - width[0x00A9] = 747; - width[0x00A4] = 500; - width[0x0064] = 500; - width[0x0086] = 500; - width[0x0087] = 500; - width[0x00B0] = 400; - width[0x00A8] = 333; - width[0x00F7] = 570; - width[0x0024] = 500; - width[0x0065] = 444; - width[0x00E9] = 444; - width[0x00EA] = 444; - width[0x00EB] = 444; - width[0x00E8] = 444; - width[0x0038] = 500; - width[0x0085] = 1000; - width[0x0097] = 1000; - width[0x0096] = 500; - width[0x003D] = 570; - width[0x00F0] = 500; - width[0x0021] = 389; - width[0x00A1] = 389; - width[0x0066] = 333; - width[0x0035] = 500; - width[0x0083] = 500; - width[0x0034] = 500; - width[0xA4] = 167; - width[0x0067] = 500; - width[0x00DF] = 500; - width[0x0060] = 333; - width[0x003E] = 570; - width[0x00AB] = 500; - width[0x00BB] = 500; - width[0x008B] = 333; - width[0x009B] = 333; - width[0x0068] = 556; - width[0x002D] = 333; - width[0x0069] = 278; - width[0x00ED] = 278; - width[0x00EE] = 278; - width[0x00EF] = 278; - width[0x00EC] = 278; - width[0x006A] = 278; - width[0x006B] = 500; - width[0x006C] = 278; - width[0x003C] = 570; - width[0x00AC] = 606; - width[0x006D] = 778; - width[0x00AF] = 333; - width[0x2D] = 606; - width[0x00B5] = 576; - width[0x00D7] = 570; - width[0x006E] = 556; - width[0x0039] = 500; - width[0x00F1] = 556; - width[0x0023] = 500; - width[0x006F] = 500; - width[0x00F3] = 500; - width[0x00F4] = 500; - width[0x00F6] = 500; - width[0x009C] = 722; - width[0x00F2] = 500; - width[0x0031] = 500; - width[0x00BD] = 750; - width[0x00BC] = 750; - width[0x00B9] = 300; - width[0x00AA] = 266; - width[0x00BA] = 300; - width[0x00F8] = 500; - width[0x00F5] = 500; - width[0x0070] = 500; - width[0x00B6] = 500; - width[0x0028] = 333; - width[0x0029] = 333; - width[0x0025] = 833; - width[0x002E] = 250; - width[0x00B7] = 250; - width[0x0089] = 1000; - width[0x002B] = 570; - width[0x00B1] = 570; - width[0x0071] = 500; - width[0x003F] = 500; - width[0x00BF] = 500; - width[0x0022] = 555; - width[0x0084] = 500; - width[0x0093] = 500; - width[0x0094] = 500; - width[0x0091] = 333; - width[0x0092] = 333; - width[0x0082] = 333; - width[0x0027] = 278; - width[0x0072] = 389; - width[0x00AE] = 747; - width[0x00B0] = 333; - width[0x0073] = 389; - width[0x009A] = 389; - width[0x00A7] = 500; - width[0x003B] = 333; - width[0x0037] = 500; - width[0x0036] = 500; - width[0x002F] = 278; - width[0x0020] = 250; - width[0x00A0] = 250; - width[0x00A3] = 500; - width[0x0074] = 278; - width[0x00FE] = 500; - width[0x0033] = 500; - width[0x00BE] = 750; - width[0x00B3] = 300; - width[0x0098] = 333; - width[0x0099] = 1000; - width[0x0032] = 500; - width[0x00B2] = 300; - width[0x0075] = 556; - width[0x00FA] = 556; - width[0x00FB] = 556; - width[0x00FC] = 556; - width[0x00F9] = 556; - width[0x005F] = 500; - width[0x0076] = 444; - width[0x0077] = 667; - width[0x0078] = 500; - width[0x0079] = 444; - width[0x00FD] = 444; - width[0x00FF] = 444; - width[0x00A5] = 500; - width[0x007A] = 389; - width[0x0030] = 500; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/TimesItalic.java b/src/org/apache/fop/render/mif/fonts/TimesItalic.java deleted file mode 100644 index cc4bfb08b..000000000 --- a/src/org/apache/fop/render/mif/fonts/TimesItalic.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class TimesItalic extends Font { - private final static String fontName = "Times-Italic"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 653; - private final static int xHeight = 441; - private final static int ascender = 683; - private final static int descender = -205; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 611; - width[0x00C6] = 889; - width[0x00C1] = 611; - width[0x00C2] = 611; - width[0x00C4] = 611; - width[0x00C0] = 611; - width[0x00C5] = 611; - width[0x00C3] = 611; - width[0x0042] = 611; - width[0x0043] = 667; - width[0x00C7] = 667; - width[0x0044] = 722; - width[0x0045] = 611; - width[0x00C9] = 611; - width[0x00CA] = 611; - width[0x00CB] = 611; - width[0x00C8] = 611; - width[0x00D0] = 722; - width[0x0046] = 611; - width[0x0047] = 722; - width[0x0048] = 722; - width[0x0049] = 333; - width[0x00CD] = 333; - width[0x00CE] = 333; - width[0x00CF] = 333; - width[0x00CC] = 333; - width[0x004A] = 444; - width[0x004B] = 667; - width[0x004C] = 556; - width[0x004D] = 833; - width[0x004E] = 667; - width[0x00D1] = 667; - width[0x004F] = 722; - width[0x008C] = 944; - width[0x00D3] = 722; - width[0x00D4] = 722; - width[0x00D6] = 722; - width[0x00D2] = 722; - width[0x00D8] = 722; - width[0x00D5] = 722; - width[0x0050] = 611; - width[0x0051] = 722; - width[0x0052] = 611; - width[0x0053] = 500; - width[0x008A] = 500; - width[0x0054] = 556; - width[0x00DE] = 611; - width[0x0055] = 722; - width[0x00DA] = 722; - width[0x00DB] = 722; - width[0x00DC] = 722; - width[0x00D9] = 722; - width[0x0056] = 611; - width[0x0057] = 833; - width[0x0058] = 611; - width[0x0059] = 556; - width[0x00DD] = 556; - width[0x009F] = 556; - width[0x005A] = 556; - width[0x0061] = 500; - width[0x00E1] = 500; - width[0x00E2] = 500; - width[0x00B4] = 333; - width[0x00E4] = 500; - width[0x00E6] = 667; - width[0x00E0] = 500; - width[0x0026] = 778; - width[0x00E5] = 500; - width[0x005E] = 422; - width[0x007E] = 541; - width[0x002A] = 500; - width[0x0040] = 920; - width[0x00E3] = 500; - width[0x0062] = 500; - width[0x005C] = 278; - width[0x007C] = 275; - width[0x007B] = 400; - width[0x007D] = 400; - width[0x005B] = 389; - width[0x005D] = 389; - width[0x00A6] = 275; - width[0x0095] = 350; - width[0x0063] = 444; - width[0x00E7] = 444; - width[0x00B8] = 333; - width[0x00A2] = 500; - width[0x0088] = 333; - width[0x003A] = 333; - width[0x002C] = 250; - width[0x00A9] = 760; - width[0x00A4] = 500; - width[0x0064] = 500; - width[0x0086] = 500; - width[0x0087] = 500; - width[0x00B0] = 400; - width[0x00A8] = 333; - width[0x00F7] = 675; - width[0x0024] = 500; - width[0x0065] = 444; - width[0x00E9] = 444; - width[0x00EA] = 444; - width[0x00EB] = 444; - width[0x00E8] = 444; - width[0x0038] = 500; - width[0x0085] = 889; - width[0x0097] = 889; - width[0x0096] = 500; - width[0x003D] = 675; - width[0x00F0] = 500; - width[0x0021] = 333; - width[0x00A1] = 389; - width[0x0066] = 278; - width[0x0035] = 500; - width[0x0083] = 500; - width[0x0034] = 500; - width[0xA4] = 167; - width[0x0067] = 500; - width[0x00DF] = 500; - width[0x0060] = 333; - width[0x003E] = 675; - width[0x00AB] = 500; - width[0x00BB] = 500; - width[0x008B] = 333; - width[0x009B] = 333; - width[0x0068] = 500; - width[0x002D] = 333; - width[0x0069] = 278; - width[0x00ED] = 278; - width[0x00EE] = 278; - width[0x00EF] = 278; - width[0x00EC] = 278; - width[0x006A] = 278; - width[0x006B] = 444; - width[0x006C] = 278; - width[0x003C] = 675; - width[0x00AC] = 675; - width[0x006D] = 722; - width[0x00AF] = 333; - width[0x2D] = 675; - width[0x00B5] = 500; - width[0x00D7] = 675; - width[0x006E] = 500; - width[0x0039] = 500; - width[0x00F1] = 500; - width[0x0023] = 500; - width[0x006F] = 500; - width[0x00F3] = 500; - width[0x00F4] = 500; - width[0x00F6] = 500; - width[0x009C] = 667; - width[0x00F2] = 500; - width[0x0031] = 500; - width[0x00BD] = 750; - width[0x00BC] = 750; - width[0x00B9] = 300; - width[0x00AA] = 276; - width[0x00BA] = 310; - width[0x00F8] = 500; - width[0x00F5] = 500; - width[0x0070] = 500; - width[0x00B6] = 523; - width[0x0028] = 333; - width[0x0029] = 333; - width[0x0025] = 833; - width[0x002E] = 250; - width[0x00B7] = 250; - width[0x0089] = 1000; - width[0x002B] = 675; - width[0x00B1] = 675; - width[0x0071] = 500; - width[0x003F] = 500; - width[0x00BF] = 500; - width[0x0022] = 420; - width[0x0084] = 556; - width[0x0093] = 556; - width[0x0094] = 556; - width[0x0091] = 333; - width[0x0092] = 333; - width[0x0082] = 333; - width[0x0027] = 214; - width[0x0072] = 389; - width[0x00AE] = 760; - width[0x00B0] = 333; - width[0x0073] = 389; - width[0x009A] = 389; - width[0x00A7] = 500; - width[0x003B] = 333; - width[0x0037] = 500; - width[0x0036] = 500; - width[0x002F] = 278; - width[0x0020] = 250; - width[0x00A0] = 250; - width[0x00A3] = 500; - width[0x0074] = 278; - width[0x00FE] = 500; - width[0x0033] = 500; - width[0x00BE] = 750; - width[0x00B3] = 300; - width[0x0098] = 333; - width[0x0099] = 980; - width[0x0032] = 500; - width[0x00B2] = 300; - width[0x0075] = 500; - width[0x00FA] = 500; - width[0x00FB] = 500; - width[0x00FC] = 500; - width[0x00F9] = 500; - width[0x005F] = 500; - width[0x0076] = 444; - width[0x0077] = 667; - width[0x0078] = 444; - width[0x0079] = 444; - width[0x00FD] = 444; - width[0x00FF] = 444; - width[0x00A5] = 500; - width[0x007A] = 389; - width[0x0030] = 500; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/TimesRoman.java b/src/org/apache/fop/render/mif/fonts/TimesRoman.java deleted file mode 100644 index ae0416cd0..000000000 --- a/src/org/apache/fop/render/mif/fonts/TimesRoman.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class TimesRoman extends Font { - private final static String fontName = "Times-Roman"; - private final static String encoding = "WinAnsiEncoding"; - private final static int capHeight = 662; - private final static int xHeight = 450; - private final static int ascender = 683; - private final static int descender = -217; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0041] = 722; - width[0x00C6] = 889; - width[0x00C1] = 722; - width[0x00C2] = 722; - width[0x00C4] = 722; - width[0x00C0] = 722; - width[0x00C5] = 722; - width[0x00C3] = 722; - width[0x0042] = 667; - width[0x0043] = 667; - width[0x00C7] = 667; - width[0x0044] = 722; - width[0x0045] = 611; - width[0x00C9] = 611; - width[0x00CA] = 611; - width[0x00CB] = 611; - width[0x00C8] = 611; - width[0x00D0] = 722; - width[0x0046] = 556; - width[0x0047] = 722; - width[0x0048] = 722; - width[0x0049] = 333; - width[0x00CD] = 333; - width[0x00CE] = 333; - width[0x00CF] = 333; - width[0x00CC] = 333; - width[0x004A] = 389; - width[0x004B] = 722; - width[0x004C] = 611; - width[0x004D] = 889; - width[0x004E] = 722; - width[0x00D1] = 722; - width[0x004F] = 722; - width[0x008C] = 889; - width[0x00D3] = 722; - width[0x00D4] = 722; - width[0x00D6] = 722; - width[0x00D2] = 722; - width[0x00D8] = 722; - width[0x00D5] = 722; - width[0x0050] = 556; - width[0x0051] = 722; - width[0x0052] = 667; - width[0x0053] = 556; - width[0x008A] = 556; - width[0x0054] = 611; - width[0x00DE] = 556; - width[0x0055] = 722; - width[0x00DA] = 722; - width[0x00DB] = 722; - width[0x00DC] = 722; - width[0x00D9] = 722; - width[0x0056] = 722; - width[0x0057] = 944; - width[0x0058] = 722; - width[0x0059] = 722; - width[0x00DD] = 722; - width[0x009F] = 722; - width[0x005A] = 611; - width[0x0061] = 444; - width[0x00E1] = 444; - width[0x00E2] = 444; - width[0x00B4] = 333; - width[0x00E4] = 444; - width[0x00E6] = 667; - width[0x00E0] = 444; - width[0x0026] = 778; - width[0x00E5] = 444; - width[0x005E] = 469; - width[0x007E] = 541; - width[0x002A] = 500; - width[0x0040] = 921; - width[0x00E3] = 444; - width[0x0062] = 500; - width[0x005C] = 278; - width[0x007C] = 200; - width[0x007B] = 480; - width[0x007D] = 480; - width[0x005B] = 333; - width[0x005D] = 333; - width[0x00A6] = 200; - width[0x0095] = 350; - width[0x0063] = 444; - width[0x00E7] = 444; - width[0x00B8] = 333; - width[0x00A2] = 500; - width[0x0088] = 333; - width[0x003A] = 278; - width[0x002C] = 250; - width[0x00A9] = 760; - width[0x00A4] = 500; - width[0x0064] = 500; - width[0x0086] = 500; - width[0x0087] = 500; - width[0x00B0] = 400; - width[0x00A8] = 333; - width[0x00F7] = 564; - width[0x0024] = 500; - width[0x0065] = 444; - width[0x00E9] = 444; - width[0x00EA] = 444; - width[0x00EB] = 444; - width[0x00E8] = 444; - width[0x0038] = 500; - width[0x0085] = 1000; - width[0x0097] = 1000; - width[0x0096] = 500; - width[0x003D] = 564; - width[0x00F0] = 500; - width[0x0021] = 333; - width[0x00A1] = 333; - width[0x0066] = 333; - width[0x0035] = 500; - width[0x0083] = 500; - width[0x0034] = 500; - width[0xA4] = 167; - width[0x0067] = 500; - width[0x00DF] = 500; - width[0x0060] = 333; - width[0x003E] = 564; - width[0x00AB] = 500; - width[0x00BB] = 500; - width[0x008B] = 333; - width[0x009B] = 333; - width[0x0068] = 500; - width[0x002D] = 333; - width[0x0069] = 278; - width[0x00ED] = 278; - width[0x00EE] = 278; - width[0x00EF] = 278; - width[0x00EC] = 278; - width[0x006A] = 278; - width[0x006B] = 500; - width[0x006C] = 278; - width[0x003C] = 564; - width[0x00AC] = 564; - width[0x006D] = 778; - width[0x00AF] = 333; - width[0x2D] = 324; - width[0x00B5] = 500; - width[0x00D7] = 564; - width[0x006E] = 500; - width[0x0039] = 500; - width[0x00F1] = 500; - width[0x0023] = 500; - width[0x006F] = 500; - width[0x00F3] = 500; - width[0x00F4] = 500; - width[0x00F6] = 500; - width[0x009C] = 722; - width[0x00F2] = 500; - width[0x0031] = 500; - width[0x00BD] = 750; - width[0x00BC] = 750; - width[0x00B9] = 300; - width[0x00AA] = 276; - width[0x00BA] = 310; - width[0x00F8] = 500; - width[0x00F5] = 500; - width[0x0070] = 500; - width[0x00B6] = 453; - width[0x0028] = 333; - width[0x0029] = 333; - width[0x0025] = 833; - width[0x002E] = 250; - width[0x00B7] = 250; - width[0x0089] = 1000; - width[0x002B] = 564; - width[0x00B1] = 564; - width[0x0071] = 500; - width[0x003F] = 444; - width[0x00BF] = 444; - width[0x0022] = 408; - width[0x0084] = 444; - width[0x0093] = 444; - width[0x0094] = 444; - width[0x0091] = 333; - width[0x0092] = 333; - width[0x0082] = 333; - width[0x0027] = 180; - width[0x0072] = 333; - width[0x00AE] = 760; - width[0x00B0] = 333; - width[0x0073] = 389; - width[0x009A] = 389; - width[0x00A7] = 500; - width[0x003B] = 278; - width[0x0037] = 500; - width[0x0036] = 500; - width[0x002F] = 278; - width[0x0020] = 250; - width[0x00A0] = 250; - width[0x00A3] = 500; - width[0x0074] = 278; - width[0x00FE] = 500; - width[0x0033] = 500; - width[0x00BE] = 750; - width[0x00B3] = 300; - width[0x0098] = 333; - width[0x0099] = 980; - width[0x0032] = 500; - width[0x00B2] = 300; - width[0x0075] = 500; - width[0x00FA] = 500; - width[0x00FB] = 500; - width[0x00FC] = 500; - width[0x00F9] = 500; - width[0x005F] = 500; - width[0x0076] = 500; - width[0x0077] = 722; - width[0x0078] = 500; - width[0x0079] = 500; - width[0x00FD] = 500; - width[0x00FF] = 500; - width[0x00A5] = 500; - width[0x007A] = 444; - width[0x0030] = 500; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - diff --git a/src/org/apache/fop/render/mif/fonts/ZapfDingbats.java b/src/org/apache/fop/render/mif/fonts/ZapfDingbats.java deleted file mode 100644 index bc0b81c8b..000000000 --- a/src/org/apache/fop/render/mif/fonts/ZapfDingbats.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * $Id$ - * Copyright (C) 2001 The Apache Software Foundation. All rights reserved. - * For details on use and redistribution please refer to the - * LICENSE file included with these sources. - */ - -package org.apache.fop.render.mif.fonts; - -import org.apache.fop.render.mif.Font; - -public class ZapfDingbats extends Font { - private final static String fontName = "ZapfDingbats"; - private final static String encoding = "StandardEncoding"; - private final static int capHeight = 820; - private final static int xHeight = 426; - private final static int ascender = 820; - private final static int descender = -143; - private final static int firstChar = 32; - private final static int lastChar = 255; - private final static int[] width; - - static { - width = new int[256]; - width[0x0020] = 278; - width[0x0021] = 974; - width[0x0022] = 961; - width[0x0023] = 974; - width[0x0024] = 980; - width[0x0025] = 719; - width[0x0026] = 789; - width[0x0027] = 790; - width[0x0028] = 791; - width[0x0029] = 690; - width[0x002A] = 960; - width[0x002B] = 939; - width[0x002C] = 549; - width[0x002D] = 855; - width[0x002E] = 911; - width[0x002F] = 933; - width[0x0030] = 911; - width[0x0031] = 945; - width[0x0032] = 974; - width[0x0033] = 755; - width[0x0034] = 846; - width[0x0035] = 762; - width[0x0036] = 761; - width[0x0037] = 571; - width[0x0038] = 677; - width[0x0039] = 763; - width[0x003A] = 760; - width[0x003B] = 759; - width[0x003C] = 754; - width[0x003D] = 494; - width[0x003E] = 552; - width[0x003F] = 537; - width[0x0040] = 577; - width[0x0041] = 692; - width[0x0042] = 786; - width[0x0043] = 788; - width[0x0044] = 788; - width[0x0045] = 790; - width[0x0046] = 793; - width[0x0047] = 794; - width[0x0048] = 816; - width[0x0049] = 823; - width[0x004A] = 789; - width[0x004B] = 841; - width[0x004C] = 823; - width[0x004D] = 833; - width[0x004E] = 816; - width[0x004F] = 831; - width[0x0050] = 923; - width[0x0051] = 744; - width[0x0052] = 723; - width[0x0053] = 749; - width[0x0054] = 790; - width[0x0055] = 792; - width[0x0056] = 695; - width[0x0057] = 776; - width[0x0058] = 768; - width[0x0059] = 792; - width[0x005A] = 759; - width[0x005B] = 707; - width[0x005C] = 708; - width[0x005D] = 682; - width[0x005E] = 701; - width[0x005F] = 826; - width[0x0060] = 815; - width[0x0061] = 789; - width[0x0062] = 789; - width[0x0063] = 707; - width[0x0064] = 687; - width[0x0065] = 696; - width[0x0066] = 689; - width[0x0067] = 786; - width[0x0068] = 787; - width[0x0069] = 713; - width[0x006A] = 791; - width[0x006B] = 785; - width[0x006C] = 791; - width[0x006D] = 873; - width[0x006E] = 761; - width[0x006F] = 762; - width[0x0070] = 762; - width[0x0071] = 759; - width[0x0072] = 759; - width[0x0073] = 892; - width[0x0074] = 892; - width[0x0075] = 788; - width[0x0076] = 784; - width[0x0077] = 438; - width[0x0078] = 138; - width[0x0079] = 277; - width[0x007A] = 415; - width[0x007B] = 392; - width[0x007C] = 392; - width[0x007D] = 668; - width[0x007E] = 668; - width[0x00A1] = 732; - width[0x00A2] = 544; - width[0x00A3] = 544; - width[0x00A4] = 910; - width[0x00A5] = 667; - width[0x00A6] = 760; - width[0x00A7] = 760; - width[0x00A8] = 776; - width[0x00A9] = 595; - width[0x00AA] = 694; - width[0x00AB] = 626; - width[0x00AC] = 788; - width[0x00AD] = 788; - width[0x00AE] = 788; - width[0x00AF] = 788; - width[0x00B0] = 788; - width[0x00B1] = 788; - width[0x00B2] = 788; - width[0x00B3] = 788; - width[0x00B4] = 788; - width[0x00B5] = 788; - width[0x00B6] = 788; - width[0x00B7] = 788; - width[0x00B8] = 788; - width[0x00B9] = 788; - width[0x00BA] = 788; - width[0x00BB] = 788; - width[0x00BC] = 788; - width[0x00BD] = 788; - width[0x00BE] = 788; - width[0x00BF] = 788; - width[0x00C0] = 788; - width[0x00C1] = 788; - width[0x00C2] = 788; - width[0x00C3] = 788; - width[0x00C4] = 788; - width[0x00C5] = 788; - width[0x00C6] = 788; - width[0x00C7] = 788; - width[0x00C8] = 788; - width[0x00C9] = 788; - width[0x00CA] = 788; - width[0x00CB] = 788; - width[0x00CC] = 788; - width[0x00CD] = 788; - width[0x00CE] = 788; - width[0x00CF] = 788; - width[0x00D0] = 788; - width[0x00D1] = 788; - width[0x00D2] = 788; - width[0x00D3] = 788; - width[0x00D4] = 894; - width[0x00D5] = 838; - width[0x00D6] = 1016; - width[0x00D7] = 458; - width[0x00D8] = 748; - width[0x00D9] = 924; - width[0x00DA] = 748; - width[0x00DB] = 918; - width[0x00DC] = 927; - width[0x00DD] = 928; - width[0x00DE] = 928; - width[0x00DF] = 834; - width[0x00E0] = 873; - width[0x00E1] = 828; - width[0x00E2] = 924; - width[0x00E3] = 924; - width[0x00E4] = 917; - width[0x00E5] = 930; - width[0x00E6] = 931; - width[0x00E7] = 463; - width[0x00E8] = 883; - width[0x00E9] = 836; - width[0x00EA] = 836; - width[0x00EB] = 867; - width[0x00EC] = 867; - width[0x00ED] = 696; - width[0x00EE] = 696; - width[0x00EF] = 874; - width[0x00F1] = 874; - width[0x00F2] = 760; - width[0x00F3] = 946; - width[0x00F4] = 771; - width[0x00F5] = 865; - width[0x00F6] = 771; - width[0x00F7] = 888; - width[0x00F8] = 967; - width[0x00F9] = 888; - width[0x00FA] = 831; - width[0x00FB] = 873; - width[0x00FC] = 927; - width[0x00FD] = 970; - width[0x00FE] = 918; - width[0x0089] = 410; - width[0x0087] = 509; - width[0x008C] = 334; - width[0x0086] = 509; - width[0x0080] = 390; - width[0x008A] = 234; - width[0x0084] = 276; - width[0x0081] = 390; - width[0x0088] = 410; - width[0x0083] = 317; - width[0x0082] = 317; - width[0x0085] = 276; - width[0x008D] = 334; - width[0x008B] = 234; - - } - - public String encoding() { - return encoding; - } - - public String fontName() { - return fontName; - } - - public int getAscender(int size) { - return size * ascender; - } - - public int getCapHeight(int size) { - return size * capHeight; - } - - public int getDescender(int size) { - return size * descender; - } - - public int getXHeight(int size) { - return size * xHeight; - } - - public int getFirstChar() { - return firstChar; - } - - public int getLastChar() { - return lastChar; - } - - public int width(int i, int size) { - return size * width[i]; - } - - public int[] getWidths(int size) { - 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; - return arr; - } - -} - |