Hi Jared,

Jared Davis wrote:

Why does SVGImageElementBridge createSVGImageNode ignore the current
TextPainter?

This would be an oversight. I'll fix it but I am wary about trying to do this right before the release.

Extending PrintTranscoder to set the TextPainter to PDFTextPainter works -
sort of. The StrokingTextPainter class is still used on svg files referenced
by image tags.


protected GraphicsNode createSVGImageNode(BridgeContext ctx,
Element e,
SVGDocument imgDocument) {
CSSEngine eng = ((SVGOMDocument)imgDocument).getCSSEngine();
if (eng != null) {
subCtx = (BridgeContext)eng.getCSSContext();
} else {
subCtx = new BridgeContext(ctx.getUserAgent(), ctx.getDocumentLoader());
subCtx.setGVTBuilder(ctx.getGVTBuilder());
//
subCtx.setTextPainter(ctx.getTextPainter()); // Added Test Code
//
subCtx.setDocument(imgDocument);
subCtx.initializeDocument(imgDocument);
}


...


public class PrintTranscoderWithRealFonts extends PrintTranscoder {
/** Creates a new instance of PrintTranscoderWithRealFonts */
public PrintTranscoderWithRealFonts() {
}
protected BridgeContext createBridgeContext() {
BridgeContext ctx = new BridgeContext(userAgent);
System.out.println("setting new font painter");
TextPainter textPainter = null;
FontInfo fontInfo = new FontInfo();
try {
FontSetup.setup(fontInfo);
} catch (Exception e) {
e.printStackTrace();
}
System.out.println("is setupValid " + fontInfo.isSetupValid());
textPainter = new PDFTextPainter(fontInfo);
ctx.setTextPainter(textPainter);
return ctx;
}
}




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to