xmlgraphics-batik-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From DeWeese Thomas <thomas.dewe...@gmail.com>
Subject Re: Problem with fonts, ImageTranscoder and Java 7
Date Sat, 16 Feb 2013 12:56:56 GMT
Hi Kölbener,
	My guess is that the font is installed in the Java platform ($JAVA_HOME/lib/fonts/).  I don't
know why Batik picks that one up instead of the Platform one.  One guess would be if they
have the same name it's possible Batik picks the last one (because it builds an internal map
of font names to fonts) but most apps get the first one since they use the normal lookup mechanisms.


On Feb 15, 2013, at 11:29 AM, Kölbener Lukas <lukas.koelbener@scs.ch> wrote:

> Hi Thomas (and others),
> Thank you for the hints. There indeed was a font embedded in one of my svg files (from
one of my earlier tests and I forgot to remove it). This explains a strange behavior in one
of my tests, but the main questions are still the same:
> -          Even if I uninstall the font, delete the Windows Font Cache (fntcache.dat)
the FontFamilyResolver somehow finds the font. Although other tools (editors, svg viewers)
cannot load it anymore.
> -          It finds it, but it cannot display my special glyphs – until I switch to
Java 6.
> So I have two questions in mind: Does batik somehow caches fonts (even longer than a
system restart… which I somehow don’t belive as it is a library) and what is the difference
between the usage of font between java 7&batik and java 6&batik. If I load the font
normally (not while transcoding a svg with batik) everything works as expected with both java
> Thank you again,
> Luke
> From: DeWeese Thomas [mailto:thomas.deweese@gmail.com] 
> Sent: Donnerstag, 14. Februar 2013 12:10
> To: batik-users@xmlgraphics.apache.org
> Subject: Re: Problem with fonts, ImageTranscoder and Java 7
> Hi Luke,
>     Is it possible the SVGDocument embedded the font in it?
>     You can check by seeing if there is a "font" element in the document.
>     Otherwise you might want to take a look at what sources/org/apache/batik/gvt/font/FontFamilyResolver.java
is finding installed on the system.
>     Thomas
> On Feb 14, 2013, at 5:25 AM, Kölbener Lukas <lukas.koelbener@scs.ch> wrote:
> Hello,
> I have a strange behavior I can’t explain and might be a incompatibility bug of batik
and JDK 1.7. That’s what I do:
> 1.       I transcode an SVGDocument to a BufferedImage with a specialization of ImageTranscoder
> 2.       I use a special font in my SVG documents. I customized it and added some special
glyphs. So I install my customized font on the computer and run the program.
> 3.       In the transcoded image the new font has not applied. If I load the font in
a Swing app or in a texteditor I see the system loaded the customized font. But not in image
processed by batik. Somehow it still uses the “old version” of the font, which in my view
should not even exist anymore on the computer.
> This happens when I work with Java 1.7 Update 5. If I uninstall JDK 1.7 and install JDK
1.6 everything works fine.
> I work on a Win 7 computer. Installing and uninstalling fonts is made over the Windows/Fonts
folder (don’t know any other way).
> Anyhone having an Idea what the problem could be?
> Thank you!
> Luke

View raw message