import org.apache.fop.fonts.*;
import org.apache.fop.render.pdf.FontSetup;
import org.apache.fop.layout.*;
-import org.apache.fop.apps.FOPException;
import java.awt.Graphics;
import java.awt.Font;
int width;
int height;
- FontInfo fontInfo = null;
-
/**
* Create a new PDFDocumentGraphics2D.
* This is used to create a new pdf document, the height,
if(!textAsShapes) {
fontInfo = new FontInfo();
FontSetup.setup(fontInfo);
- try {
- fontState = new FontState(fontInfo, "Helvetica", "normal",
- "normal", 12, 0);
- } catch (FOPException e) {}
+ //FontState fontState = new FontState("Helvetica", "normal",
+ // FontInfo.NORMAL, 12, 0);
}
standalone = true;
setupDocument(stream, width, height);
}
- public FontState getFontState() {
- return fontState;
+ public FontInfo getFontInfo() {
+ return fontInfo;
}
public PDFDocument getPDFDocument() {
* This will then write the results to the output stream.
*/
public void finish() throws IOException {
+ // restorePDFState();
+
pdfStream.add(getString());
this.pdfDoc.addStream(pdfStream);
currentPage.setContents(pdfStream);
* the current state of the pdf graphics
*/
PDFState graphicsState;
+ int baseLevel = 0;
- protected FontState fontState;
+ protected FontInfo fontInfo;
protected FontState ovFontState = null;
/**
* This is used to create a Graphics object for use inside an already
* existing document.
*/
- public PDFGraphics2D(boolean textAsShapes, FontState fs, PDFDocument doc,
+ public PDFGraphics2D(boolean textAsShapes, FontInfo fi, PDFDocument doc,
PDFResourceContext page, String pref, String font, float size, int xpos, int ypos) {
super(textAsShapes);
pdfDoc = doc;
currentFontSize = size;
currentYPosition = ypos;
currentXPosition = xpos;
- fontState = fs;
+ fontInfo = fi;
pageRef = pref;
graphicsState = new PDFState();
}
public void setPDFState(PDFState state) {
graphicsState = state;
+ baseLevel = graphicsState.getStackLevel();
}
public void setOutputStream(OutputStream os) {
return new PDFGraphics2D(this);
}
+ public void restorePDFState() {
+ for(int count = graphicsState.getStackLevel(); count > baseLevel; count--) {
+ currentStream.write("Q\n");
+ }
+ graphicsState.restoreLevel(baseLevel);
+ }
+
/**
* This is a pdf specific method used to add a link to the
* pdf document.
currentStream.write("q\n");
Shape imclip = getClip();
writeClip(imclip);
- currentStream.write("" + matrix[0] + " " + matrix[1] + " "
- + matrix[2] + " " + matrix[3] + " "
- + matrix[4] + " " + matrix[5] + " cm\n");
+ if(!at.isIdentity()) {
+ currentStream.write("" + matrix[0] + " " + matrix[1] + " "
+ + matrix[2] + " " + matrix[3] + " "
+ + matrix[4] + " " + matrix[5] + " cm\n");
+ }
currentStream.write("" + width + " 0 0 "
+ (-height) + " "
currentStream.write("q\n");
Shape imclip = getClip();
writeClip(imclip);
- currentStream.write("" + matrix[0] + " " + matrix[1] + " "
- + matrix[2] + " " + matrix[3] + " "
- + matrix[4] + " " + matrix[5] + " cm\n");
+ if(!at.isIdentity()) {
+ currentStream.write("" + matrix[0] + " " + matrix[1] + " "
+ + matrix[2] + " " + matrix[3] + " "
+ + matrix[4] + " " + matrix[5] + " cm\n");
+ }
currentStream.write("" + width + " 0 0 " + (-height) + " " + x
+ " " + (y + height) + " cm\n" + "/Im"
+ imageInfo.getXNumber() + " Do\nQ\n");
public void dispose() {
// System.out.println("dispose");
pdfDoc = null;
- fontState = null;
+ fontInfo = null;
currentStream = null;
currentFontName = null;
}
}
}
+/*
+ // in theory we could set the clip using these methods
+ // it doesn't seem to improve the file sizes much
+ // and makes everything more complicated
+
+ Shape lastClip = null;
+
+ public void clip(Shape cl) {
+ super.clip(cl);
+ Shape newClip = getClip();
+ if(newClip == null || lastClip == null || !(new Area(newClip).equals(new Area(lastClip)))) {
+ graphicsState.setClip(newClip);
+ writeClip(newClip);
+ }
+
+ lastClip = newClip;
+ }
+
+ public void setClip(Shape cl) {
+ super.setClip(cl);
+ Shape newClip = getClip();
+ if(newClip == null || lastClip == null || !(new Area(newClip).equals(new Area(lastClip)))) {
+ for(int count = graphicsState.getStackLevel(); count > baseLevel; count--) {
+ currentStream.write("Q\n");
+ }
+ graphicsState.restoreLevel(baseLevel);
+ currentStream.write("q\n");
+ graphicsState.push();
+ if(newClip != null) {
+ graphicsState.setClip(newClip);
+ }
+ writeClip(newClip);
+ }
+
+ lastClip = newClip;
+ }
+*/
protected void writeClip(Shape s) {
if (s == null) {
return;
FontInfo fi = new FontInfo();
FontSetup.setup(fi);
- FontState fs = null;
- try {
- fs = new FontState(fi, "sans-serif", "normal",
- "normal", 1, 0);
- } catch (org.apache.fop.apps.FOPException fope) {
- fope.printStackTrace();
- }
+
PDFResources res = pdfDoc.makeResources();
PDFResourceContext context = new PDFResourceContext(0, pdfDoc, res);
- PDFGraphics2D pattGraphic = new PDFGraphics2D(textAsShapes, fs,
+ PDFGraphics2D pattGraphic = new PDFGraphics2D(textAsShapes, fi,
pdfDoc, context, pageRef,
currentFontName, currentFontSize,
currentYPosition, currentXPosition);
public void drawString(String s, float x, float y) {
// System.out.println("drawString(String)");
+ FontState fontState;
if(ovFontState == null) {
Font gFont = getFont();
String n = gFont.getFamily();
}
int siz = gFont.getSize();
String style = gFont.isItalic() ? "italic" : "normal";
- String weight = gFont.isBold() ? "bold" : "normal";
- try {
- fontState = new FontState(fontState.getFontInfo(), n, style,
- weight, siz * 1000, 0);
- } catch (org.apache.fop.apps.FOPException fope) {
- fope.printStackTrace();
- }
+ int weight = gFont.isBold() ? FontInfo.BOLD : FontInfo.NORMAL;
+ String fname = fontInfo.fontLookup(n, style, weight);
+ FontMetric metrics = fontInfo.getMetricsFor(fname);
+ fontState = new FontState(fname, metrics, siz * 1000);
} else {
fontState = ovFontState;
ovFontState = null;
applyColor(c, true);
int salpha = c.getAlpha();
- c = getBackground();
- applyColor(c, false);
- if(salpha != 255/* || c.getAlpha() != 255*/) {
+ if(salpha != 255) {
HashMap vals = new HashMap();
vals.put(PDFGState.ca, new Float(salpha / 255f));
- //vals.put(PDFGState.CA, new Float(c.getAlpha() / 255f));
PDFGState gstate = pdfDoc.makeGState(vals, graphicsState.getGState());
resourceContext.addGState(gstate);
currentStream.write("/" + gstate.getName() + " gs\n");
// This assumes that *all* CIDFonts use a /ToUnicode mapping
boolean useMultiByte = false;
org.apache.fop.render.pdf.Font f =
- (org.apache.fop.render.pdf.Font)fontState.getFontInfo().getFonts().get(name);
+ (org.apache.fop.render.pdf.Font)fontInfo.getFonts().get(name);
if (f instanceof LazyFont){
if(((LazyFont) f).getRealFont() instanceof CIDFont){
useMultiByte = true;
float y) {
System.err.println("drawString(AttributedCharacterIterator)");
+ FontState fontState = null;
+
Shape imclip = getClip();
writeClip(imclip);
Color c = getColor();
applyColor(c, true);
- c = getBackground();
- applyColor(c, false);
+
+ boolean fill = true;
+ boolean stroke = false;
+ if(true) {
+ Stroke currentStroke = getStroke();
+ stroke = true;
+ applyStroke(currentStroke);
+ applyColor(c, false);
+ }
currentStream.write("BT\n");
+ // set text rendering mode:
+ // 0 - fill, 1 - stroke, 2 - fill then stroke
+ int textr = 0;
+ if(fill && stroke) {
+ textr = 2;
+ } else if(stroke) {
+ textr = 1;
+ }
+ currentStream.write(textr + " Tr\n");
+
AffineTransform trans = getTransform();
trans.translate(x, y);
double[] vals = new double[6];
return new PDFGraphicsConfiguration();
}
- /**
- * Our implementation of the class that returns information about
- * roughly what we can handle and want to see (alpha for example).
- */
- static class PDFGraphicsConfiguration extends GraphicsConfiguration {
- // We use this to get a good colormodel..
- static BufferedImage BIWithAlpha = new BufferedImage(1, 1,
- BufferedImage.TYPE_INT_ARGB);
- // We use this to get a good colormodel..
- static BufferedImage BIWithOutAlpha = new BufferedImage(1, 1,
- BufferedImage.TYPE_INT_RGB);
-
- /**
- * Construct a buffered image with an alpha channel, unless
- * transparencty is OPAQUE (no alpha at all).
- */
- public BufferedImage createCompatibleImage(int width, int height,
- int transparency) {
- if (transparency == Transparency.OPAQUE)
- return new BufferedImage(width, height,
- BufferedImage.TYPE_INT_RGB);
- else
- return new BufferedImage(width, height,
- BufferedImage.TYPE_INT_ARGB);
- }
-
- /**
- * Construct a buffered image with an alpha channel.
- */
- public BufferedImage createCompatibleImage(int width, int height) {
- return new BufferedImage(width, height,
- BufferedImage.TYPE_INT_ARGB);
- }
-
- /**
- * FIXX ME: This should return the page bounds in Pts,
- * I couldn't figure out how to get this for the current
- * page from the PDFDocument (this still works for now,
- * but it should be fixed...).
- */
- public Rectangle getBounds() {
-System.out.println("getting getBounds");
- return null;
- }
-
- /**
- * Return a good default color model for this 'device'.
- */
- public ColorModel getColorModel() {
- return BIWithAlpha.getColorModel();
- }
-
- /**
- * Return a good color model given <tt>transparency</tt>
- */
- public ColorModel getColorModel(int transparency) {
- if (transparency == Transparency.OPAQUE)
- return BIWithOutAlpha.getColorModel();
- else
- return BIWithAlpha.getColorModel();
- }
-
- /**
- * The default transform (1:1).
- */
- public AffineTransform getDefaultTransform() {
-System.out.println("getting getDefaultTransform");
- return new AffineTransform();
- }
-
- /**
- * The normalizing transform (1:1) (since we currently
- * render images at 72dpi, which we might want to change
- * in the future).
- */
- public AffineTransform getNormalizingTransform() {
-System.out.println("getting getNormalizingTransform");
- return new AffineTransform(2, 0, 0, 2, 0, 0);
- }
-
- /**
- * Return our dummy instance of GraphicsDevice
- */
- public GraphicsDevice getDevice() {
- return new PDFGraphicsDevice(this);
- }
-
-/*
-// for jdk1.4
-public java.awt.image.VolatileImage createCompatibleVolatileImage(int width, int height) {
-return null;
-}
-*/
- }
-
- /**
- * This implements the GraphicsDevice interface as appropriate for
- * a PDFGraphics2D. This is quite simple since we only have one
- * GraphicsConfiguration for now (this might change in the future
- * I suppose).
- */
- static class PDFGraphicsDevice extends GraphicsDevice {
-
- /**
- * The Graphics Config that created us...
- */
- GraphicsConfiguration gc;
-
- /**
- * @param The gc we should reference
- */
- PDFGraphicsDevice(PDFGraphicsConfiguration gc) {
- this.gc = gc;
- }
-
- /**
- * Ignore template and return the only config we have
- */
- public GraphicsConfiguration getBestConfiguration(GraphicsConfigTemplate gct) {
- return gc;
- }
-
- /**
- * Return an array of our one GraphicsConfig
- */
- public GraphicsConfiguration[] getConfigurations() {
- return new GraphicsConfiguration[] {
- gc
- };
- }
-
- /**
- * Return out sole GraphicsConfig.
- */
- public GraphicsConfiguration getDefaultConfiguration() {
- return gc;
- }
-
- /**
- * Generate an IdString..
- */
- public String getIDstring() {
- return toString();
- }
-
- /**
- * Let the caller know that we are "a printer"
- */
- public int getType() {
- return GraphicsDevice.TYPE_PRINTER;
- }
-
- }
-
/**
* Used to create proper font metrics
*/
--- /dev/null
+/*
+ * $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.svg;
+
+import java.awt.*;
+import java.awt.Font;
+import java.awt.Image;
+import java.awt.image.*;
+import java.awt.font.*;
+import java.awt.geom.*;
+import java.awt.color.ColorSpace;
+import java.awt.image.renderable.*;
+
+/**
+ * Our implementation of the class that returns information about
+ * roughly what we can handle and want to see (alpha for example).
+ */
+class PDFGraphicsConfiguration extends GraphicsConfiguration {
+ // We use this to get a good colormodel..
+ static BufferedImage BIWithAlpha =
+ new BufferedImage(1, 1, BufferedImage.TYPE_INT_ARGB);
+ // We use this to get a good colormodel..
+ static BufferedImage BIWithOutAlpha =
+ new BufferedImage(1, 1, BufferedImage.TYPE_INT_RGB);
+
+ /**
+ * Construct a buffered image with an alpha channel, unless
+ * transparencty is OPAQUE (no alpha at all).
+ */
+ public BufferedImage createCompatibleImage(int width, int height,
+ int transparency) {
+ if (transparency == Transparency.OPAQUE)
+ return new BufferedImage(width, height,
+ BufferedImage.TYPE_INT_RGB);
+ else
+ return new BufferedImage(width, height,
+ BufferedImage.TYPE_INT_ARGB);
+ }
+
+ /**
+ * Construct a buffered image with an alpha channel.
+ */
+ public BufferedImage createCompatibleImage(int width, int height) {
+ return new BufferedImage(width, height,
+ BufferedImage.TYPE_INT_ARGB);
+ }
+
+ /**
+ * FIXX ME: This should return the page bounds in Pts,
+ * I couldn't figure out how to get this for the current
+ * page from the PDFDocument (this still works for now,
+ * but it should be fixed...).
+ */
+ public Rectangle getBounds() {
+ System.out.println("getting getBounds");
+ return null;
+ }
+
+ /**
+ * Return a good default color model for this 'device'.
+ */
+ public ColorModel getColorModel() {
+ return BIWithAlpha.getColorModel();
+ }
+
+ /**
+ * Return a good color model given <tt>transparency</tt>
+ */
+ public ColorModel getColorModel(int transparency) {
+ if (transparency == Transparency.OPAQUE)
+ return BIWithOutAlpha.getColorModel();
+ else
+ return BIWithAlpha.getColorModel();
+ }
+
+ /**
+ * The default transform (1:1).
+ */
+ public AffineTransform getDefaultTransform() {
+ System.out.println("getting getDefaultTransform");
+ return new AffineTransform();
+ }
+
+ /**
+ * The normalizing transform (1:1) (since we currently
+ * render images at 72dpi, which we might want to change
+ * in the future).
+ */
+ public AffineTransform getNormalizingTransform() {
+ System.out.println("getting getNormalizingTransform");
+ return new AffineTransform(2, 0, 0, 2, 0, 0);
+ }
+
+ /**
+ * Return our dummy instance of GraphicsDevice
+ */
+ public GraphicsDevice getDevice() {
+ return new PDFGraphicsDevice(this);
+ }
+
+ /*
+ // for jdk1.4
+ public java.awt.image.VolatileImage createCompatibleVolatileImage(int width, int height) {
+ return null;
+ }
+ */
+}
+
--- /dev/null
+/*
+ * $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.svg;
+
+import java.awt.*;
+import java.awt.Image;
+import java.awt.image.*;
+import java.awt.image.renderable.*;
+
+/**
+ * This implements the GraphicsDevice interface as appropriate for
+ * a PDFGraphics2D. This is quite simple since we only have one
+ * GraphicsConfiguration for now (this might change in the future
+ * I suppose).
+ */
+class PDFGraphicsDevice extends GraphicsDevice {
+
+ /**
+ * The Graphics Config that created us...
+ */
+ GraphicsConfiguration gc;
+
+ /**
+ * @param The gc we should reference
+ */
+ PDFGraphicsDevice(PDFGraphicsConfiguration gc) {
+ this.gc = gc;
+ }
+
+ /**
+ * Ignore template and return the only config we have
+ */
+ public GraphicsConfiguration getBestConfiguration(
+ GraphicsConfigTemplate gct) {
+ return gc;
+ }
+
+ /**
+ * Return an array of our one GraphicsConfig
+ */
+ public GraphicsConfiguration[] getConfigurations() {
+ return new GraphicsConfiguration[]{ gc };
+ }
+
+ /**
+ * Return out sole GraphicsConfig.
+ */
+ public GraphicsConfiguration getDefaultConfiguration() {
+ return gc;
+ }
+
+ /**
+ * Generate an IdString..
+ */
+ public String getIDstring() {
+ return toString();
+ }
+
+ /**
+ * Let the caller know that we are "a printer"
+ */
+ public int getType() {
+ return GraphicsDevice.TYPE_PRINTER;
+ }
+
+}
+
import org.apache.batik.gvt.CompositeGraphicsNode;
import org.apache.batik.gvt.GraphicsNode;
-import org.apache.fop.layout.FontState;
+import org.apache.fop.layout.FontInfo;
import org.w3c.dom.Element;
import org.w3c.dom.Node;
/**
* Constructs a new bridge for the <text> element.
*/
- public PDFTextElementBridge(FontState fs) {
- pdfTextPainter = new PDFTextPainter(fs);
+ public PDFTextElementBridge(FontInfo fi) {
+ pdfTextPainter = new PDFTextPainter(fi);
}
public GraphicsNode createGraphicsNode(BridgeContext ctx, Element e) {
import org.apache.fop.layout.*;
-// TODO properly calculate bounds for links etc.
-
/**
* Renders the attributed character iterator of a <tt>TextNode</tt>.
*
* @version $Id$
*/
public class PDFTextPainter implements TextPainter {
- FontState fontState;
+ FontInfo fontInfo;
+ protected final static TextPainter proxyPainter
+ = StrokingTextPainter.getInstance();
- public PDFTextPainter(FontState fs) {
- fontState = fs;
+ public PDFTextPainter(FontInfo fi) {
+ fontInfo = fi;
}
/**
Vector gvtFonts =
(Vector)aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.GVT_FONT_FAMILIES);
Paint forg = (Paint)aci.getAttribute(TextAttribute.FOREGROUND);
+ Paint strokePaint = (Paint)aci.getAttribute(GVTAttributedCharacterIterator.TextAttribute.STROKE_PAINT);
Float size = (Float)aci.getAttribute(TextAttribute.SIZE);
if(size == null) {
return;
Float posture = (Float)aci.getAttribute(TextAttribute.POSTURE);
Float taWeight = (Float)aci.getAttribute(TextAttribute.WEIGHT);
+ boolean useStrokePainter = false;
+
if (forg instanceof Color) {
- g2d.setColor((Color)forg);
+ Color col = (Color)forg;
+ if(col.getAlpha() != 255) {
+ useStrokePainter = true;
+ }
+ g2d.setColor(col);
}
g2d.setPaint(forg);
g2d.setStroke(stroke);
+ if(strokePaint != null) {
+ // need to draw using AttributedCharacterIterator
+ useStrokePainter = true;
+ }
+
+ if(useStrokePainter) {
+ proxyPainter.paint(node, g2d);
+ return;
+ }
+
String style = ((posture != null) && (posture.floatValue() > 0.0))
? "italic" : "normal";
- String weight = ((taWeight != null) && (taWeight.floatValue() > 1.0))
- ? "bold" : "normal";
+ int weight = ((taWeight != null) && (taWeight.floatValue() > 1.0))
+ ? FontInfo.BOLD : FontInfo.NORMAL;
- FontInfo fi = fontState.getFontInfo();
+ FontState fontState = null;
+ FontInfo fi = fontInfo;
boolean found = false;
+ String fontFamily = null;
if (gvtFonts != null) {
for (Enumeration e = gvtFonts.elements(); e.hasMoreElements(); ) {
GVTFontFamily fam = (GVTFontFamily)e.nextElement();
- String name = fam.getFamilyName();
- if (fi.hasFont(name, weight, style)) {
- try {
- int fsize = (int)(size.floatValue() * 1000);
- fontState = new FontState(fontState.getFontInfo(),
- name, style, weight,
- fsize, 0);
- } catch (org.apache.fop.apps.FOPException fope) {
- fope.printStackTrace();
- }
+ fontFamily = fam.getFamilyName();
+ if (fi.hasFont(fontFamily, style, weight)) {
+ String fname = fontInfo.fontLookup(fontFamily, style, weight);
+ FontMetric metrics = fontInfo.getMetricsFor(fname);
+ int fsize = (int)(size.floatValue() * 1000);
+ fontState = new FontState(fname, metrics, fsize);
found = true;
break;
}
}
}
if (!found) {
- try {
- int fsize = (int)(size.floatValue() * 1000);
- fontState = new FontState(fontState.getFontInfo(), "any",
- style, weight, fsize, 0);
- } catch (org.apache.fop.apps.FOPException fope) {
- fope.printStackTrace();
- }
+ String fname = fontInfo.fontLookup("any", style, FontInfo.NORMAL);
+ FontMetric metrics = fontInfo.getMetricsFor(fname);
+ int fsize = (int)(size.floatValue() * 1000);
+ fontState = new FontState(fname, metrics, fsize);
} else {
if(g2d instanceof PDFGraphics2D) {
((PDFGraphics2D)g2d).setOverrideFontState(fontState);
}
}
int fStyle = Font.PLAIN;
- if (fontState.getFontWeight().equals("bold")) {
- if (fontState.getFontStyle().equals("italic")) {
+ if (weight == FontInfo.BOLD) {
+ if (style.equals("italic")) {
fStyle = Font.BOLD | Font.ITALIC;
} else {
fStyle = Font.BOLD;
}
} else {
- if (fontState.getFontStyle().equals("italic")) {
+ if (style.equals("italic")) {
fStyle = Font.ITALIC;
} else {
fStyle = Font.PLAIN;
}
}
- Font font = new Font(fontState.getFontFamily(), fStyle,
+ Font font = new Font(fontFamily, fStyle,
(int)(fontState.getFontSize() / 1000));
g2d.setFont(font);
-
- float advance = getStringWidth(txt);
+ float advance = getStringWidth(txt, fontState);
float tx = 0;
if (anchor != null) {
switch (anchor.getType()) {
g2d.drawString(txt, (float)(loc.getX() + tx), (float)(loc.getY()));
}
- public float getStringWidth(String str) {
+ public float getStringWidth(String str, FontState fontState) {
float wordWidth = 0;
float whitespaceWidth = fontState.width(fontState.mapChar(' '));
public Shape getShape(TextNode node) {
System.out.println("PDFText getShape");
- return null;
+ return proxyPainter.getShape(node);
}
public Shape getDecoratedShape(TextNode node) {
//System.out.println("PDFText getDecoratedShape");
- return new Rectangle(1, 1);
+ return proxyPainter.getDecoratedShape(node);
}
public Rectangle2D getBounds(TextNode node) {
//System.out.println("PDFText getBounds");
- Rectangle2D bounds = new Rectangle2D.Float(0, 0, 100, 12);
- return bounds;
+ return proxyPainter.getBounds(node);
}
public Rectangle2D getDecoratedBounds(TextNode node) {
System.out.println("PDFText getDecoratedBounds");
- return null;
+ return proxyPainter.getDecoratedBounds(node);
}
public Rectangle2D getPaintedBounds(TextNode node) {
// System.out.println("PDFText getPaintedBounds");
- Point2D loc = node.getLocation();
- return new Rectangle2D.Double(loc.getX(), loc.getY(), 100, 12);
+ return proxyPainter.getPaintedBounds(node);
}
}
import org.w3c.dom.css.*;
import org.w3c.dom.svg.SVGLength;
-import org.apache.fop.svg.*;
+//import org.apache.fop.layout.FontInfo;
import org.apache.fop.pdf.*;
import org.w3c.dom.DOMException;
textPainter = new StrokingTextPainter();
ctx.setTextPainter(textPainter);
- PDFTextElementBridge pdfTextElementBridge = new PDFTextElementBridge(graphics.getFontState());
+ PDFTextElementBridge pdfTextElementBridge = new PDFTextElementBridge(graphics.getFontInfo());
ctx.putBridge(pdfTextElementBridge);
PDFAElementBridge pdfAElementBridge = new PDFAElementBridge();
graphics.setSVGDimension(docWidth, docHeight);
currentTransform.setTransform(1, 0, 0, -1, 0, height);
/*if (!stroke) {
- textPainter = new PDFTextPainter(graphics.getFontState());
+ textPainter = new PDFTextPainter(graphics.getFontInfo());
ctx.setTextPainter(textPainter);
}*/