[FOray-commit] SF.net SVN: foray: [7722] trunk/foray/foray-pdf/src/java/org/foray/pdf/object
Modular XSL-FO Implementation for Java.
Status: Alpha
Brought to you by:
victormote
|
From: <vic...@us...> - 2006-06-19 23:41:15
|
Revision: 7722 Author: victormote Date: 2006-06-19 16:41:08 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/foray/?rev=7722&view=rev Log Message: ----------- Conform to axsl change: Remove font size from the parameters needed to draw an SVG. That information should come from within the SVG itself. Modified Paths: -------------- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-06-19 23:26:34 UTC (rev 7721) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/object/PDFContentStream.java 2006-06-19 23:41:08 UTC (rev 7722) @@ -268,10 +268,10 @@ */ public void drawSVGDocument(SVGDocument doc, Rectangle2D.Float contentRectangle, Rectangle2D.Float clipRectangle, - FontUse font, float fontSize, boolean strokeSVGText) { + FontUse font, boolean strokeSVGText) { closeTextObject(); PDFGraphics2D graphics = getPDFContent4SVG(contentRectangle, font, - fontSize, doc, strokeSVGText); + doc, strokeSVGText); if (graphics == null) { // Error messages have already been logged. return; @@ -327,7 +327,7 @@ } public PDFGraphics2D getPDFContent4SVG(Rectangle2D.Float contentRectangle, - FontUse font, float fontSize, + FontUse font, SVGDocument svgDocument, boolean strokeSVGText) { /* If not running in a graphical environment, log an error message * and skip the SVG. */ @@ -367,7 +367,7 @@ builder = null; PDFGraphics2D graphics = new PDFGraphics2D(true, this.getPDFDocument(), - contentRectangle, font, fontSize, svgDocument); + contentRectangle, font, svgDocument); graphics.setGraphicContext(new GraphicContext()); try { Modified: trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java =================================================================== --- trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-06-19 23:26:34 UTC (rev 7721) +++ trunk/foray/foray-pdf/src/java/org/foray/pdf/svg/batik/PDFGraphics2D.java 2006-06-19 23:41:08 UTC (rev 7722) @@ -110,7 +110,6 @@ PDFAnnotList currentAnnotList = null; protected org.axsl.fontR.FontUse font; - protected float fontSize; protected org.axsl.fontR.FontUse overrideFont = null; protected float overrideFontSize; @@ -143,7 +142,7 @@ */ public PDFGraphics2D(boolean textAsShapes, PDFDocument doc, Rectangle2D.Float contentRectangle, org.axsl.fontR.FontUse font, - float fontSize, SVGDocument svgDocument) { + SVGDocument svgDocument) { super(textAsShapes); pdfDoc = doc; org.axsl.pdfW.PDFFont pdfFont = doc.getCurrentGraphicsState().getFont(); @@ -154,7 +153,6 @@ } currentFontSize = doc.getCurrentGraphicsState().getFontSize(); this.font = font; - this.fontSize = fontSize; initGraphicalEnvironment(); transformCoordinates(contentRectangle, svgDocument); } @@ -933,7 +931,10 @@ for (char ch = iterator.first(); ch != CharacterIterator.DONE; ch = iterator.next()) { org.axsl.fontR.FontUse font = this.font; - float size = this.fontSize; + /* TODO: It looks like currentFont and currentFontSize should + * come from the PDFDocuments GraphicsState, and that the comparison + * items should come from the SVG itself. */ + float size = -1; if ((font != this.currentFont) || (size != this.currentFontSize)) { this.currentFont = font; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |