xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From thomas.dewe...@kodak.com
Subject Re: SVGGraphics2D::drawString
Date Thu, 21 Oct 2010 11:08:37 GMT
Hi Kelsey,

Kelsey Rider <kelseyrider@hotmail.com> wrote on 10/18/2010 12:03:52 PM:

> However, when I supply a SVGGraphics2D object, I observe two 
> problems with the text (probably due to the same issue):
> - the text is distorted - badly positioned, wrong size, etc.
> - certain characters don't appear.  For example, the euro symbol. 
> This particular character actually causes SVGGraphics2D::drawString 
> to put an invalid character (0x02) in the XML.  The string passed to
> drawString contains a single byte, 0x02; however, in the PDF this 
> character is mapped to a type1 font and (I think) describes how to draw 
it.
[...]
> The output is correct when I manually set generatorCtx.svgFont=true,
> but of course this makes the output file bigger (10MB instead of 8MB).

    I don't think there is a lot to be done in this case.  From your 
description of the Euro symbol
problem, it sounds like the PDF contains embedded fonts.  If the SVG 
doesn't contain a similar
set of embedded fonts it can't possibly correctly reproduce the PDF file. 
Setting 'svgFont' to
tells the SVGGraphics2D that it can't simply use the font-name, it needs 
to extract the used
characters from the font and put them in an SVG Font embedded in the 
output document 
(similar to the embedded font in the PDF document).

    It might be possible to only SVG Fontify some of the fonts used by the 
PDF file but I don't know
how the SVGGraphics2D could possibly differentiate between the fonts that 
needed to be
embedded and those that didn't.

    I think you simply need to accept the larger file size.
Thomas DeWeese | CDG Advanced Development | 
Eastman Kodak Company | 343 State Street | Rochester, NY 14650-0128 | 
Thomas.DeWeese@Kodak.com | 585 724-0294 | 
www.kodak.com 

Mime
View raw message