You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Rob Hinst <ro...@exobitnetworks.com> on 2006/11/21 15:30:24 UTC
Font rasterization issues
I finally got external fonts rendering properly in the svg files (I think I
had it all along, I just didn't realize that firefox, ASV, and Adobe
illustrator don't seem to support external font defs. It works fine in
Squiggle, however.
My issue now is as follows. If I use Squiggle to open an svg that references
external fonts and then I export it as a jpeg, the jpeg displays the fonts
correctly. If I use batik-rasterizer from the command line to rasterize the
svg into a jpeg, however, the text appears to lose it's font definition
info. It just shows up in the default font. I've included my exact command
string below. Maybe someone can point out what I'm doing wrong:
/data/jdk1.5.0_08/bin/java -jar
/data/home/ipi/batik-1.6/batik-rasterizer.jar -m "image/jpeg" -q 0.99 -d
"/data/home/ipi/tmp/jpgIn2jZh" "/data/home/ipi/tmp/svgmnB8I4"
Thanks,
Rob Hinst
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
RE: Font rasterization issues
Posted by Rob Hinst <ro...@exobitnetworks.com>.
Using SVN, it yields:
About to transcode 1 SVG file(s)
Converting svgJup7p3 to /data/home/ipi/tmp/jpgBwRVz7 ... ... Success
If I add -validate, I get:
About to transcode 1 SVG file(s)
Converting svgJup7p3 to /data/home/ipi/tmp/jpgBwRVz7 ...
org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
The content of element type "g" must match
"(desc|title|metadata|defs|path|text|rect|circle|ellipse|line|polyline|polyg
on|use|image|svg|g|view|switch|a|altGlyphDef|script|style|symbol|marker|clip
Path|mask|linearGradient|radialGradient|pattern|filter|cursor|font|animate|s
et|animateMotion|animateColor|animateTransform|color-profile|font-face)*".
at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
at
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown
Source)
at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown
Source)
at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source)
at org.apache.batik.apps.rasterizer.Main.main(Unknown Source)
... error (SVGConverter.error.while.rasterizing.file)
-----Original Message-----
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com]
Sent: Sunday, November 26, 2006 6:09 PM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: RE: Font rasterization issues
Hi Rob,
"Rob Hinst" <ro...@exobitnetworks.com> wrote on 11/22/2006 08:35:39 AM:
> Thanks for your reply. I'm running batik in 2 places. On a Debian
> server with no window system, and on my WinXP desktop. I can't run
> squiggle on
the
> Debian box. I can open the file in squiggle on the win xp box. I also
just
> tried to rasterize it with batik-rasterize on the winxp box and it
worked.
> When I run the same command (with paths adjusted accordingly, but the
same
> command line options), I get a jpg with the correct text, but default
fonts.
Well, this tells me something is broken on the Debian box.
Unfortunately,
I can't really tell what. Are you sure you have the same version of
Batik installed in both places?
You might also try the SVN version of Batik as some error reporting
has been improved.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
RE: Font rasterization issues
Posted by th...@kodak.com.
Hi Rob,
"Rob Hinst" <ro...@exobitnetworks.com> wrote on 11/22/2006 08:35:39 AM:
> Thanks for your reply. I'm running batik in 2 places. On a Debian server
> with no window system, and on my WinXP desktop. I can't run squiggle on
the
> Debian box. I can open the file in squiggle on the win xp box. I also
just
> tried to rasterize it with batik-rasterize on the winxp box and it
worked.
> When I run the same command (with paths adjusted accordingly, but the
same
> command line options), I get a jpg with the correct text, but default
fonts.
Well, this tells me something is broken on the Debian box.
Unfortunately,
I can't really tell what. Are you sure you have the same version of
Batik installed in both places?
You might also try the SVN version of Batik as some error reporting
has been improved.
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
RE: Font rasterization issues
Posted by Rob Hinst <ro...@exobitnetworks.com>.
Hi Thomas,
Thanks for your reply. I'm running batik in 2 places. On a Debian server
with no window system, and on my WinXP desktop. I can't run squiggle on the
Debian box. I can open the file in squiggle on the win xp box. I also just
tried to rasterize it with batik-rasterize on the winxp box and it worked.
When I run the same command (with paths adjusted accordingly, but the same
command line options), I get a jpg with the correct text, but default fonts.
My font definitions looks like this:
<font-face font-family="courier">
<font-face-src>
<font-face-uri
xlink:href="http://ipi.exobitnetworks.com/fonts/courier.svg#courier" />
</font-face-src>
</font-face>
And I refer to them in the TEXT element as follows:
<text x="-24.85" y="-5.425" fill="#ff0000" font-family="Tahoma"
font-size="9" >tahoma font here</text>
I am able to successfully wget the URL of the font on the debian server, so
it should be able to access the font definitions it needs.
I don't know if this is relevant, but if I add the -validate option I get
the following error, and no jpg is generated at all:
About to transcode 1 SVG file(s)
Converting sign.svg to
/data/home/ipi/ipi.exobitnetworks.com/www/test/sign.jpg ...
java.io.IOException: The content of element type "g" must match
"(desc|title|metadata|defs|path|text|rect|circle|ellipse|line|polyline|polyg
on|use|image|svg|g|view|switch|a|altGlyphDef|script|style|symbol|marker|clip
Path|mask|linearGradient|radialGradient|pattern|filter|cursor|font|animate|s
et|animateMotion|animateColor|animateTransform|color-profile|font-face)*".
at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
at
org.apache.batik.dom.util.SAXDocumentFactory.createDocument(Unknown Source)
at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown
Source)
at
org.apache.batik.dom.svg.SAXSVGDocumentFactory.createDocument(Unknown
Source)
at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
at
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown
Source)
at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown
Source)
at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source)
at org.apache.batik.apps.rasterizer.Main.main(Unknown Source)
org.apache.batik.transcoder.TranscoderException: null
Enclosed Exception:
The content of element type "g" must match
"(desc|title|metadata|defs|path|text|rect|circle|ellipse|line|polyline|polyg
on|use|image|svg|g|view|switch|a|altGlyphDef|script|style|symbol|marker|clip
Path|mask|linearGradient|radialGradient|pattern|filter|cursor|font|animate|s
et|animateMotion|animateColor|animateTransform|color-profile|font-face)*".
at
org.apache.batik.transcoder.XMLAbstractTranscoder.transcode(Unknown Source)
at
org.apache.batik.transcoder.SVGAbstractTranscoder.transcode(Unknown Source)
at org.apache.batik.apps.rasterizer.SVGConverter.transcode(Unknown
Source)
at org.apache.batik.apps.rasterizer.SVGConverter.execute(Unknown
Source)
at org.apache.batik.apps.rasterizer.Main.execute(Unknown Source)
at org.apache.batik.apps.rasterizer.Main.main(Unknown Source)
... error (SVGConverter.error.while.rasterizing.file)
-Rob
-----Original Message-----
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com]
Sent: Tuesday, November 21, 2006 8:02 PM
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Font rasterization issues
Hi Rob,
"Rob Hinst" <ro...@exobitnetworks.com> wrote on 11/21/2006 09:30:24 AM:
> My issue now is as follows. If I use Squiggle to open an svg that
> references external fonts and then I export it as a jpeg, the jpeg
> displays the fonts correctly. If I use batik-rasterizer from the
> command line to rasterize the svg into a jpeg, however, the text
> appears to lose it's font definition info. It just shows up in the
> default font.
This probably indicates that it can't find the external font for some
reason.
> I've included my exact command string below.
> Maybe someone can point out what I'm doing wrong:
> /data/jdk1.5.0_08/bin/java -jar
> /data/home/ipi/batik-1.6/batik-rasterizer.jar -m "image/jpeg" -q 0.99
> -d "/data/home/ipi/tmp/jpgIn2jZh" "/data/home/ipi/tmp/svgmnB8I4"
So to be clear if you type:
/data/jdk1.5.0_08/bin/java -jar
/data/home/ipi/batik-1.6/batik-squiggle.jar "/data/home/ipi/tmp/svgmnB8I4"
It works fine?
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org
Re: Font rasterization issues
Posted by th...@kodak.com.
Hi Rob,
"Rob Hinst" <ro...@exobitnetworks.com> wrote on 11/21/2006 09:30:24 AM:
> My issue now is as follows. If I use Squiggle to open an svg that
> references external fonts and then I export it as a jpeg, the jpeg
> displays the fonts correctly. If I use batik-rasterizer from the
> command line to rasterize the svg into a jpeg, however, the text
> appears to lose it's font definition info. It just shows up in
> the default font.
This probably indicates that it can't find the external font
for some reason.
> I've included my exact command string below.
> Maybe someone can point out what I'm doing wrong:
> /data/jdk1.5.0_08/bin/java -jar
> /data/home/ipi/batik-1.6/batik-rasterizer.jar -m "image/jpeg" -q 0.99 -d
> "/data/home/ipi/tmp/jpgIn2jZh" "/data/home/ipi/tmp/svgmnB8I4"
So to be clear if you type:
/data/jdk1.5.0_08/bin/java -jar
/data/home/ipi/batik-1.6/batik-squiggle.jar "/data/home/ipi/tmp/svgmnB8I4"
It works fine?
---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org